Sha256: fbb8b17da241edac339818e2cb6656ff56d5ff901e1f1f7ab83f86df5576a6de
Contents?: true
Size: 1.53 KB
Versions: 28
Compression:
Stored size: 1.53 KB
Contents
# Copyright (C) 2015-2022 Ruby-GNOME Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA module Gtk class StyleContext class << self def resolve_priority(priority) case priority when Symbol, String StyleProvider.const_get("PRIORITY_#{priority.to_s.upcase}") else priority || StyleProvider::PRIORITY_APPLICATION end end alias_method :add_provider_for_display_raw, :add_provider_for_display def add_provider_for_display(display, provider, priority=nil) priority = resolve_priority(priority) add_provider_for_display_raw(display, provider, priority) end end alias_method :add_provider_raw, :add_provider def add_provider(provider, priority=nil) priority = self.class.resolve_priority(priority) add_provider_raw(provider, priority) end end end
Version data entries
28 entries across 28 versions & 1 rubygems