diff options
-rw-r--r-- | deluge/ui/gtk3/glade/preferences_dialog.ui | 113 | ||||
-rw-r--r-- | deluge/ui/gtk3/gtkui.py | 2 | ||||
-rw-r--r-- | deluge/ui/gtk3/mainwindow.py | 2 | ||||
-rw-r--r-- | deluge/ui/gtk3/preferences.py | 12 |
4 files changed, 50 insertions, 79 deletions
diff --git a/deluge/ui/gtk3/glade/preferences_dialog.ui b/deluge/ui/gtk3/glade/preferences_dialog.ui index 44bcafe4c..720dc6b40 100644 --- a/deluge/ui/gtk3/glade/preferences_dialog.ui +++ b/deluge/ui/gtk3/glade/preferences_dialog.ui @@ -430,77 +430,6 @@ </packing> </child> <child> - <object class="GtkFrame" id="frame_theme"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label_xalign">0</property> - <property name="shadow_type">none</property> - <child> - <object class="GtkAlignment" id="alignment_theme"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="top_padding">3</property> - <property name="left_padding">10</property> - <child> - <object class="GtkBox" id="hbox_theme"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <child> - <object class="GtkRadioButton" id="radio_theme_light"> - <property name="label" translatable="yes">Light</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="tooltip_text" translatable="yes">The light theme</property> - <property name="active">True</property> - <property name="draw_indicator">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkRadioButton" id="radio_theme_dark"> - <property name="label" translatable="yes">Dark</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="tooltip_text" translatable="yes">The dark theme</property> - <property name="draw_indicator">True</property> - <property name="group">radio_theme_light</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="padding">7</property> - <property name="position">1</property> - </packing> - </child> - </object> - </child> - </object> - </child> - <child type="label"> - <object class="GtkLabel" id="label_theme"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes">Theme</property> - <attributes> - <attribute name="weight" value="bold"/> - </attributes> - </object> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="padding">5</property> - <property name="position">1</property> - </packing> - </child> - <child> <object class="GtkFrame" id="frame29"> <property name="visible">True</property> <property name="can_focus">False</property> @@ -1035,6 +964,48 @@ and daemon (does not apply in Standalone mode).</property> <property name="expand">False</property> <property name="fill">True</property> <property name="padding">5</property> + <property name="position">2</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="frame_theme"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label-xalign">0</property> + <property name="shadow-type">none</property> + <child> + <object class="GtkAlignment" id="alignment_theme"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="top-padding">3</property> + <property name="left-padding">10</property> + <child> + <object class="GtkCheckButton" id="chk_prefer_dark_theme"> + <property name="label" translatable="yes">Prefer Dark</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="tooltip_text" translatable="yes">If available, use dark variant of GTK theme.</property> + <property name="draw-indicator">True</property> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label_theme"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label" translatable="yes">Theme</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="padding">5</property> <property name="position">3</property> </packing> </child> diff --git a/deluge/ui/gtk3/gtkui.py b/deluge/ui/gtk3/gtkui.py index 0fbb5b773..73a7c97ae 100644 --- a/deluge/ui/gtk3/gtkui.py +++ b/deluge/ui/gtk3/gtkui.py @@ -84,7 +84,7 @@ except ImportError: DEFAULT_PREFS = { 'standalone': True, - 'dark_theme': False, + 'prefer_dark_theme': False, 'interactive_add': True, 'focus_add_dialog': True, 'enable_system_tray': True, diff --git a/deluge/ui/gtk3/mainwindow.py b/deluge/ui/gtk3/mainwindow.py index 84956f2cd..6c871d2d8 100644 --- a/deluge/ui/gtk3/mainwindow.py +++ b/deluge/ui/gtk3/mainwindow.py @@ -75,7 +75,7 @@ class MainWindow(component.Component): # Set theme Gtk.Settings.get_default().set_property( 'gtk-application-prefer-dark-theme', - self.config['dark_theme'], + self.config['prefer_dark_theme'], ) # Patch this GtkBuilder to avoid connecting signals from elsewhere diff --git a/deluge/ui/gtk3/preferences.py b/deluge/ui/gtk3/preferences.py index cf303d75a..cd67a5b09 100644 --- a/deluge/ui/gtk3/preferences.py +++ b/deluge/ui/gtk3/preferences.py @@ -174,7 +174,7 @@ class Preferences(component.Component): # Initialize a binding for dark theme Gtk.Settings.get_default().bind_property( 'gtk-application-prefer-dark-theme', - self.builder.get_object('radio_theme_dark'), + self.builder.get_object('chk_prefer_dark_theme'), 'active', GObject.BindingFlags.BIDIRECTIONAL | GObject.BindingFlags.SYNC_CREATE, ) @@ -565,8 +565,8 @@ class Preferences(component.Component): self.builder.get_object('radio_thinclient').set_active( not self.gtkui_config['standalone'] ) - self.builder.get_object('radio_theme_dark').set_active( - self.gtkui_config['dark_theme'] + self.builder.get_object('chk_prefer_dark_theme').set_active( + self.gtkui_config['prefer_dark_theme'] ) self.builder.get_object('chk_show_rate_in_title').set_active( self.gtkui_config['show_rate_in_title'] @@ -752,8 +752,8 @@ class Preferences(component.Component): ).get_active() # Interface tab # - new_gtkui_config['dark_theme'] = self.builder.get_object( - 'radio_theme_dark' + new_gtkui_config['prefer_dark_theme'] = self.builder.get_object( + 'chk_prefer_dark_theme' ).get_active() new_gtkui_config['enable_system_tray'] = self.builder.get_object( 'chk_use_tray' @@ -1090,7 +1090,7 @@ class Preferences(component.Component): log.debug('on_button_cancel_clicked') Gtk.Settings.get_default().set_property( 'gtk-application-prefer-dark-theme', - self.gtkui_config['dark_theme'], + self.gtkui_config['prefer_dark_theme'], ) self.hide() return True |