Class: Gtk::StyleContext
- Inherits:
-
Object
- Object
- Gtk::StyleContext
- Defined in:
- lib/gtk4/style-context.rb
Class Method Summary collapse
- .add_provider_for_display(display, provider, priority = nil) ⇒ Object
- .add_provider_for_display_raw ⇒ Object
- .resolve_priority(priority) ⇒ Object
Instance Method Summary collapse
Class Method Details
.add_provider_for_display(display, provider, priority = nil) ⇒ Object
30 31 32 33 |
# File 'lib/gtk4/style-context.rb', line 30 def add_provider_for_display(display, provider, priority=nil) priority = resolve_priority(priority) add_provider_for_display_raw(display, provider, priority) end |
.add_provider_for_display_raw ⇒ Object
29 |
# File 'lib/gtk4/style-context.rb', line 29 alias_method :add_provider_for_display_raw, :add_provider_for_display |
.resolve_priority(priority) ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/gtk4/style-context.rb', line 20 def resolve_priority(priority) case priority when Symbol, String StyleProvider.const_get("PRIORITY_#{priority.to_s.upcase}") else priority || StyleProvider::PRIORITY_APPLICATION end end |
Instance Method Details
#add_provider(provider, priority = nil) ⇒ Object
37 38 39 40 |
# File 'lib/gtk4/style-context.rb', line 37 def add_provider(provider, priority=nil) priority = self.class.resolve_priority(priority) add_provider_raw(provider, priority) end |
#add_provider_raw ⇒ Object
36 |
# File 'lib/gtk4/style-context.rb', line 36 alias_method :add_provider_raw, :add_provider |