def update_tab_label(self, panel, newpath): index = self.indexOf(panel) if self.shorten_tabnames: tabname = fit_text(path(newpath).name, self.tab_width) else: tabname = path(newpath).name if newpath == u'/': tabname = u'/' self.setTabToolTip(index, newpath.replace(path.home(), "~")) self.setTabText(index, tabname)
def formatFilename(self, name): if self.shorten_filename: return fit_text(name, self.thumbdb.size - (self.thumbdb.size // 7)) else: return name