Module: Lich::Main::StartupTheme
- Defined in:
- documented/main/startup_theme.rb
Overview
Resolves and applies Lich's persisted or explicitly requested startup theme.
Class Method Summary collapse
-
.apply(argv_options) ⇒ Boolean
Apply the effective dark-mode setting for this process.
Class Method Details
.apply(argv_options) ⇒ Boolean
Apply the effective dark-mode setting for this process.
An explicit command-line value takes precedence and becomes the new persisted preference. Otherwise, the existing preference is used.
17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'documented/main/startup_theme.rb', line 17 def self.apply() raise ArgumentError, 'argv_options must be a Hash' unless .is_a?(Hash) explicit = .key?(:dark_mode) theme_state = explicit ? [:dark_mode] : Lich.track_dark_mode unless theme_state == true || theme_state == false raise ArgumentError, 'dark_mode must be true or false' end Lich.track_dark_mode = theme_state if explicit Gtk::Settings.default.gtk_application_prefer_dark_theme = theme_state if defined?(Gtk) theme_state end |