@@ -97,6 +97,7 @@ class WindowActions(ActionsEnum):
97
97
export_icons = "icons"
98
98
export_theme = "theme"
99
99
export_terminal = "terminal"
100
+
export_menu = "export_menu"
100
101
menu = "menu"
101
102
remove = "remove"
102
103
rename = "rename"
@@ -505,7 +506,7 @@ def _on_pane_resize(self, _action, _param=None):
505
506
# Init widgets:
506
507
###########################################################################
507
508
508
-
def _init_headerbar(self): # pylint: disable=too-many-locals
509
+
def _init_headerbar(self): # pylint: disable=too-many-locals,too-many-statements
509
510
self.headerbar = Gtk.HeaderBar()
510
511
self.headerbar.set_show_close_button(True)
511
512
self.headerbar.props.title = _("Oo-mox GUI")
@@ -517,7 +518,7 @@ def _init_headerbar(self): # pylint: disable=too-many-locals
517
518
import_menu = Gio.Menu()
518
519
import_menu.append_item(Gio.MenuItem.new(
519
520
_("Oomox Colors File"),
520
-
"win.import_themix_colors"
521
+
WindowActions.import_themix_colors
521
522
))
522
523
523
524
for plugin_name, plugin in IMPORT_PLUGINS.items():
@@ -540,41 +541,46 @@ def _init_headerbar(self): # pylint: disable=too-many-locals
540
541
))
541
542
self.headerbar.pack_start(import_button)
542
543
543
-
clone_button = ImageButton(
544
-
"edit-copy-symbolic", _("Clone Current Theme…")
545
-
)
546
-
self.attach_action(clone_button, WindowActions.clone)
547
-
self.headerbar.pack_start(clone_button)
544
+
#
548
545
549
546
save_button = ImageButton(
550
547
"document-save-symbolic", _("Save Theme")
551
548
)
552
549
self.attach_action(save_button, WindowActions.save)
553
-
self.headerbar.pack_start(save_button)
550
+
# self.headerbar.pack_start(save_button)
551
+
552
+
clone_button = ImageButton(
553
+
"document-save-as-symbolic", _("Save as…")
554
+
)
555
+
self.attach_action(clone_button, WindowActions.clone)
556
+
# self.headerbar.pack_start(clone_button)
554
557
555
558
rename_button = ImageButton(
556
559
# "preferences-desktop-font-symbolic", "Rename theme"
557
560
"pda-symbolic", _("Rename Theme…")
558
561
)
559
562
self.attach_action(rename_button, WindowActions.rename)
560
-
self.headerbar.pack_start(rename_button)
563
+
# self.headerbar.pack_start(rename_button)
561
564
562
565
remove_button = ImageButton(
563
566
"edit-delete-symbolic", _("Remove Theme…")
564
567
)
565
568
self.attach_action(remove_button, WindowActions.remove)
566
-
self.headerbar.pack_start(remove_button)
569
+
# self.headerbar.pack_start(remove_button)
570
+
571
+
linked_preset_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
572
+
Gtk.StyleContext.add_class(
573
+
linked_preset_box.get_style_context(), "linked"
574
+
)
575
+
linked_preset_box.add(save_button)
576
+
linked_preset_box.add(clone_button)
577
+
linked_preset_box.add(rename_button)
578
+
linked_preset_box.add(remove_button)
579
+
self.headerbar.pack_start(linked_preset_box)
567
580
568
581
#
569
582
570
583
menu = Gio.Menu()
571
-
if EXPORT_PLUGINS:
572
-
for plugin_name, plugin in EXPORT_PLUGINS.items():
573
-
menu.append_item(Gio.MenuItem.new(
574
-
plugin.export_text or plugin.display_name,
575
-
"win.export_plugin_{}".format(plugin_name)
576
-
))
577
-
578
584
menu_button = ImageMenuButton("open-menu-symbolic")
579
585
menu_button.set_use_popover(True)
580
586
menu_button.set_menu_model(menu)
@@ -593,31 +599,57 @@ def _init_headerbar(self): # pylint: disable=too-many-locals
593
599
594
600
#
595
601
596
-
export_terminal_button = Gtk.Button(
597
-
label=_("Export _Terminal"),
598
-
# label=_("Export _Terminal…"),
602
+
export_theme_button = Gtk.Button(
603
+
# label=_("_Export Theme"),
604
+
label=_("_Export Theme…"),
599
605
use_underline=True,
600
-
tooltip_text=_("Export Terminal Theme")
606
+
tooltip_text=_("Export GTK Theme")
601
607
)
602
-
self.attach_action(export_terminal_button, WindowActions.export_terminal)
603
-
self.headerbar.pack_end(export_terminal_button)
608
+
self.attach_action(export_theme_button, WindowActions.export_theme)
604
609
605
-
export_icons_button = Gtk.Button(label=_("Export _Icons"),
606
-
use_underline=True,
607
-
tooltip_text=_("Export Icon Theme"))
610
+
export_icons_button = Gtk.Button(
611
+
label=_("Export _Icons"),
612
+
use_underline=True,
613
+
tooltip_text=_("Export Icon Theme")
614
+
)
608
615
self.attach_action(export_icons_button, WindowActions.export_icons)
609
-
self.headerbar.pack_end(export_icons_button)
610
616
611
-
# export_button = Gtk.Button(label=_("_Export Theme…"),
612
-
export_button = Gtk.Button(label=_("_Export Theme"),
613
-
use_underline=True,
614
-
tooltip_text=_("Export GTK Theme"))
615
-
self.attach_action(export_button, WindowActions.export_theme)
616
-
self.headerbar.pack_end(export_button)
617
+
export_menu = Gio.Menu()
618
+
export_menu.append_item(Gio.MenuItem.new(
619
+
_("Export _Terminal…"),
620
+
WindowActions.export_terminal.get_id()
621
+
))
622
+
if EXPORT_PLUGINS:
623
+
for plugin_name, plugin in EXPORT_PLUGINS.items():
624
+
export_menu.append_item(Gio.MenuItem.new(
625
+
plugin.export_text or plugin.display_name,
626
+
"win.export_plugin_{}".format(plugin_name)
627
+
))
628
+
export_button = ImageMenuButton(
629
+
icon_name="pan-down-symbolic",
630
+
tooltip_text=_("Export Themes")
631
+
)
632
+
export_button.set_use_popover(True)
633
+
export_button.set_menu_model(export_menu)
634
+
self.add_action(Gio.PropertyAction(
635
+
name=WindowActions.export_menu,
636
+
object=export_button,
637
+
property_name="active"
638
+
))
639
+
640
+
linked_export_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
641
+
Gtk.StyleContext.add_class(
642
+
linked_export_box.get_style_context(), "linked"
643
+
)
644
+
linked_export_box.add(export_theme_button)
645
+
linked_export_box.add(export_icons_button)
646
+
linked_export_box.add(export_button)
647
+
self.headerbar.pack_end(linked_export_box)
648
+
649
+
#
617
650
618
651
self.spinner = Gtk.Spinner()
619
652
self.headerbar.pack_end(self.spinner)
620
-
621
653
self.set_titlebar(self.headerbar)
622
654
623
655
def _init_window(self):
@@ -735,6 +767,7 @@ def set_accels_for_action(action, accels):
735
767
set_accels_for_action(WindowActions.remove, ["<Primary>Delete"])
736
768
set_accels_for_action(WindowActions.export_theme, ["<Primary>E"])
737
769
set_accels_for_action(WindowActions.export_icons, ["<Primary>I"])
770
+
set_accels_for_action(WindowActions.export_menu, ["<Primary>O"])
738
771
set_accels_for_action(WindowActions.export_terminal, ["<Primary>T"])
739
772
set_accels_for_action(WindowActions.menu, ["F10"])
740
773
set_accels_for_action(WindowActions.show_help, ["<Primary>question"])
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4