Class: Gtk::StyleContext

Inherits:
Object
  • Object
show all
Defined in:
lib/gtk4/style-context.rb

Class Method Summary collapse

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_rawObject



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_rawObject



36
# File 'lib/gtk4/style-context.rb', line 36

alias_method :add_provider_raw, :add_provider