mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -04:00
Cleanup of PR cleanup
This commit is contained in:
parent
cf131b765f
commit
cc0feb7681
@ -30,13 +30,9 @@ class LayoutActions(InterfaceAction):
|
|||||||
|
|
||||||
def gui_layout_complete(self):
|
def gui_layout_complete(self):
|
||||||
m = self.qaction.menu()
|
m = self.qaction.menu()
|
||||||
self.button_names = {}
|
|
||||||
m.addAction(_('Hide all'), self.hide_all)
|
m.addAction(_('Hide all'), self.hide_all)
|
||||||
for i, name in enumerate(self.gui.button_order):
|
for button, name in zip(self.gui.layout_buttons, self.gui.button_order):
|
||||||
m.addSeparator()
|
m.addSeparator()
|
||||||
name = self.gui.button_order[i]
|
|
||||||
self.button_names[self.gui.button_order[i]] = i
|
|
||||||
button = self.gui.layout_buttons[i]
|
|
||||||
ic = QIcon.ic(button.icname)
|
ic = QIcon.ic(button.icname)
|
||||||
m.addAction(ic, _('Show {}').format(button.label), partial(self.set_visible, Panel(name), True))
|
m.addAction(ic, _('Show {}').format(button.label), partial(self.set_visible, Panel(name), True))
|
||||||
m.addAction(ic, _('Hide {}').format(button.label), partial(self.set_visible, Panel(name), False))
|
m.addAction(ic, _('Hide {}').format(button.label), partial(self.set_visible, Panel(name), False))
|
||||||
@ -65,3 +61,9 @@ class LayoutActions(InterfaceAction):
|
|||||||
def show_all(self):
|
def show_all(self):
|
||||||
for name in self.gui.button_order:
|
for name in self.gui.button_order:
|
||||||
self.set_visible(Panel(name), show=True)
|
self.set_visible(Panel(name), show=True)
|
||||||
|
|
||||||
|
def button_names(self):
|
||||||
|
names = {}
|
||||||
|
for p in Panel:
|
||||||
|
names[self._button_from_enum(p).label] = p
|
||||||
|
return names
|
||||||
|
Loading…
x
Reference in New Issue
Block a user