backport to python 2.7

ui
Manuel Genoves 2020-02-27 12:22:22 +01:00
parent bcd08397f1
commit bdc2e6cda7
1 changed files with 6 additions and 2 deletions

View File

@ -68,9 +68,13 @@ class BaseHeaderbar:
add_menus(self, app)
settings = Gtk.Settings.get_default()
if global_dark:= settings.props.gtk_theme_name.endswith("-dark"):
# TODO: use walrust operator whenever Python3.8 lands on SDK
# if global_dark:= settings.props.gtk_theme_name.endswith("-dark"):
global_dark = settings.props.gtk_theme_name.endswith("-dark")
if global_dark:
self.light_button.set_sensitive(False)
self.light_button.set_tooltip_text(_("Light mode isn't available while using a dark global theme"))
self.light_button.set_tooltip_text(_(
"Light mode isn't available while using a dark global theme"))
self.dark_button.set_active(self.settings.get_boolean("dark-mode") or global_dark)