Fix css loading error by switching to style.css

main
axtloss 2 years ago
parent 68e354d622
commit 4e632180ec
No known key found for this signature in database
GPG Key ID: DD6D66939396C90E

@ -80,64 +80,7 @@ class FirstSetupApplication(Adw.Application):
self.activate() self.activate()
def do_activate(self): def do_activate(self):
"""
Called when the application is activated.
We raise the application's main window, creating it if
necessary.
--
CSS inspired by: Sonny Piers <https://github.com/sonnyp>
"""
css = b"""
.theme-selector {
border-radius: 100px;
margin: 8px;
border: 1px solid rgba(145, 145, 145, 0.1);
padding: 30px;
}
.theme-selector radio {
-gtk-icon-source: none;
border: none;
background: none;
box-shadow: none;
min-width: 12px;
min-height: 12px;
transform: translate(34px, 20px);
padding: 2px;
border-radius: 100px;
}
.theme-selector radio:checked {
-gtk-icon-source: -gtk-icontheme("object-select-symbolic");
background-color: @theme_selected_bg_color;
color: @theme_selected_fg_color;
}
.theme-selector:checked {
border-color: @theme_selected_bg_color;
border-width: 2px;
background-color: @theme_selected_bg_color;
}
.theme-selector.light {
background-color: #ffffff;
}
.theme-selector.dark {
background-color: #202020;
}
.theme-selector.light:checked {
background-color: #eeeeee;
}
.theme-selector.dark:checked {
background-color: #303030;
}
"""
provider = Gtk.CssProvider()
provider.load_from_data(data=css)
Gtk.StyleContext.add_provider_for_display(
display=Gdk.Display.get_default(),
provider=provider,
priority=Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
)
win = self.props.active_window win = self.props.active_window
if not win: if not win:

@ -0,0 +1,41 @@
/* CSS inspired by: Sonny Piers <https://github.com/sonnyp> */
.theme-selector {
border-radius: 100px;
margin: 8px;
border: 1px solid rgba(145, 145, 145, 0.1);
padding: 30px;
}
.theme-selector radio {
-gtk-icon-source: none;
border: none;
background: none;
box-shadow: none;
min-width: 12px;
min-height: 12px;
transform: translate(34px, 20px);
padding: 2px;
border-radius: 100px;
}
.theme-selector radio:checked {
-gtk-icon-source: -gtk-icontheme("object-select-symbolic");
background-color: @theme_selected_bg_color;
color: @theme_selected_fg_color;
}
.theme-selector:checked {
border-color: @theme_selected_bg_color;
border-width: 2px;
background-color: @theme_selected_bg_color;
}
.theme-selector.light {
background-color: #ffffff;
}
.theme-selector.dark {
background-color: #202020;
}
.theme-selector.light:checked {
background-color: #eeeeee;
}
.theme-selector.dark:checked {
background-color: #303030;
}

@ -1,6 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<gresources> <gresources>
<gresource prefix="/io/github/vanilla-os/FirstSetup"> <gresource prefix="/io/github/vanilla-os/FirstSetup">
<file>style.css</file>
<file>gtk/window.ui</file> <file>gtk/window.ui</file>
<file>gtk/done.ui</file> <file>gtk/done.ui</file>
<file>gtk/progress.ui</file> <file>gtk/progress.ui</file>

Loading…
Cancel
Save