MCPcopy Index your code
hub / github.com/rawpython/remi / resize_tab_titles

Method resize_tab_titles

remi/gui.py:2068–2081  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2066 self.tab_keys_ordered_list = []
2067
2068 def resize_tab_titles(self):
2069 nch=len(self.container_tab_titles.children.values())
2070 # the rounding errors of "%.1f" add upt to more than 100.0% (e.g. at 7 tabs) , so be more precise here
2071 tab_w = 0
2072 if nch > 0:
2073 if 1000.0 // nch > 0:
2074 tab_w = 1000.0 // nch /10
2075 l = None
2076 for l in self.container_tab_titles.children.values():
2077 l.set_size("%.1f%%" % tab_w, "auto")
2078 # and make last tab consume the rounding rest, looks better
2079 if not l is None:
2080 last_tab_w=100.0-tab_w*(nch-1)
2081 l.set_size("%.1f%%" % last_tab_w, "auto")
2082
2083
2084 def append(self, widget, key=''):

Callers 2

appendMethod · 0.95
remove_childMethod · 0.95

Calls 1

set_sizeMethod · 0.45

Tested by

no test coverage detected