def __init_css(self):
"""
Initialize the main css files and providers.
Add css classes to the default screen style context.
"""
if Gtk.get_minor_version() > 18:
log.debug("Fanciest design possible")
cssProviderFile = Gio.File.new_for_uri(
"resource:///de/geigi/cozy/application.css")
else:
log.debug("Using legacy css file")
cssProviderFile = Gio.File.new_for_uri(
"resource:///de/geigi/cozy/application_legacy.css")
cssProvider = Gtk.CssProvider()
cssProvider.load_from_file(cssProviderFile)
# add the bordered css class to the default screen for the borders around album art
screen = Gdk.Screen.get_default()
styleContext = Gtk.StyleContext()
styleContext.add_provider_for_screen(
screen, cssProvider, Gtk.STYLE_PROVIDER_PRIORITY_USER)
styleContext.add_class("bordered")
评论列表
文章目录