diff --git a/data/de.wolfvollprecht.UberWriter.gschema.xml b/data/de.wolfvollprecht.UberWriter.gschema.xml index 34f9300..5c43fd2 100644 --- a/data/de.wolfvollprecht.UberWriter.gschema.xml +++ b/data/de.wolfvollprecht.UberWriter.gschema.xml @@ -18,17 +18,9 @@ - - - true - Set dark mode automatically - - Whether dark mode depends on the system theme, or is set to what the user specifies. - - false - Force dark mode + Use dark mode Enable or disable the dark mode. diff --git a/data/uberwriter.gresource.xml b/data/uberwriter.gresource.xml index b129813..c875ef3 100644 --- a/data/uberwriter.gresource.xml +++ b/data/uberwriter.gresource.xml @@ -8,7 +8,6 @@ media/css/gtk/base.css ui/Export.ui ui/Menu.ui - ui/Menu2.ui ui/Preferences.ui ui/Preview.ui ui/Recents.ui diff --git a/data/ui/Menu.ui b/data/ui/Menu.ui index 33f6df7..cb2214f 100644 --- a/data/ui/Menu.ui +++ b/data/ui/Menu.ui @@ -1,61 +1,228 @@ - - -
- - Focus Mode - app.focus_mode - - - Hemingway Mode - app.hemingway_mode - - - Preview - app.preview - - - Fullscreen - app.fullscreen - -
-
- - Save As - app.save_as - - - Export - app.export - - - Copy HTML - app.copy_html - -
-
- - Find and Replace - app.search_replace - -
-
- - Preferences - app.preferences - - - app.shortcuts - _Keyboard Shortcuts - - - Open Tutorial - app.open_tutorial - - - app.about - _About UberWriter - -
-
+ + + + + False + + + True + False + 12 + 12 + 12 + 12 + vertical + + + True + False + center + 12 + 12 + 6 + 24 + + + True + True + False + center + False + + + True + False + emblem-ok-symbolic + + + + + + False + True + 0 + + + + + True + True + False + center + False + light_mode_button + + + True + False + emblem-ok-symbolic + + + + + + False + True + 1 + + + + + False + True + 0 + + + + + True + False + + + False + True + 1 + + + + + True + True + True + app.hemingway_mode + Hemingway mode + + + False + True + 2 + + + + + True + True + True + app.focus_mode + Focus Mode + + + False + True + 3 + + + + + True + False + + + False + True + 4 + + + + + True + True + True + app.search_replace + Find and Replace + + + False + True + 5 + + + + + True + False + + + False + True + 6 + + + + + True + True + True + app.preferences + Preferences + + + False + True + 7 + + + + + True + False + + + False + True + 8 + + + + + True + True + True + app.open_tutorial + Open Tutorial + + + False + True + 9 + + + + + True + True + True + app.shortcuts + Keyboard Shortcuts + + + False + True + 10 + + + + + True + True + True + app.about + About Uberwriter + + + False + True + 11 + + + + + diff --git a/data/ui/Menu2.ui b/data/ui/Menu2.ui deleted file mode 100644 index 2cc2ade..0000000 --- a/data/ui/Menu2.ui +++ /dev/null @@ -1,229 +0,0 @@ - - - - - - False - - - True - False - 12 - 12 - 12 - 12 - vertical - - - True - False - center - 12 - 12 - 6 - 24 - - - True - True - False - center - app.dark_mode - False - - - True - False - emblem-ok-symbolic - - - - - - False - True - 0 - - - - - True - True - False - center - False - light_mode_button - - - True - False - emblem-ok-symbolic - - - - - - False - True - 1 - - - - - False - True - 0 - - - - - True - False - - - False - True - 1 - - - - - True - True - True - app.hemingway_mode - Hemingway mode - - - False - True - 2 - - - - - True - True - True - app.focus_mode - Focus Mode - - - False - True - 3 - - - - - True - False - - - False - True - 4 - - - - - True - True - True - app.search_replace - Find and Replace - - - False - True - 5 - - - - - True - False - - - False - True - 6 - - - - - True - True - True - app.preferences - Preferences - - - False - True - 7 - - - - - True - False - - - False - True - 8 - - - - - True - True - True - app.open_tutorial - Open Tutorial - - - False - True - 9 - - - - - True - True - True - app.shortcuts - Keyboard Shortcuts - - - False - True - 10 - - - - - True - True - True - app.about - About Uberwriter - - - False - True - 11 - - - - - - diff --git a/uberwriter/application.py b/uberwriter/application.py index badcc9d..35f9d24 100644 --- a/uberwriter/application.py +++ b/uberwriter/application.py @@ -66,11 +66,6 @@ class Application(Gtk.Application): self.add_action(action) # App Menu - action = Gio.SimpleAction.new_stateful( - "dark_mode", None, GLib.Variant.new_boolean(False)) - action.connect("change-state", self.on_dark_mode) - self.add_action(action) - action = Gio.SimpleAction.new_stateful( "focus_mode", None, GLib.Variant.new_boolean(False)) action.connect("change-state", self.on_focus_mode) @@ -219,9 +214,6 @@ class Application(Gtk.Application): def on_new(self, _action, _value): self.window.new_document() - def on_dark_mode(self, action, value): - print(action, value) - def on_open(self, _action, _value): self.window.open_document() diff --git a/uberwriter/main_window.py b/uberwriter/main_window.py index 20dfa97..bd3d931 100644 --- a/uberwriter/main_window.py +++ b/uberwriter/main_window.py @@ -91,6 +91,17 @@ class MainWindow(StyledWindow): self.fs_headerbar = headerbars.FullscreenHeaderbar(builder, app) + # Bind properties between normal and fs headerbar + self.headerbar.light_button.bind_property( + "active", self.fs_headerbar.light_button, "active", + GObject.BindingFlags.BIDIRECTIONAL + | GObject.BindingFlags.SYNC_CREATE) + + self.headerbar.dark_button.bind_property( + "active", self.fs_headerbar.dark_button, "active", + GObject.BindingFlags.BIDIRECTIONAL + | GObject.BindingFlags.SYNC_CREATE) + # The dummy headerbar is a cosmetic hack to be able to # crossfade the hb on top of the window self.dm_headerbar = headerbars.DummyHeaderbar(app)