Skip to content

Commit

Permalink
Fix checkbutton
Browse files Browse the repository at this point in the history
  • Loading branch information
danirabbit committed Nov 16, 2023
1 parent 860d8c6 commit e1e9622
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 17 deletions.
5 changes: 0 additions & 5 deletions data/Check.css

This file was deleted.

3 changes: 1 addition & 2 deletions data/icons.gresource.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
<gresource prefix="/io/elementary/switchboard/plug/pantheon-shell">
<file alias="appearance-default.svg" compressed="true" preprocess="xml-stripblanks">appearance-default.svg</file>
<file alias="appearance-dark.svg" compressed="true" preprocess="xml-stripblanks">appearance-dark.svg</file>
<file compressed="true">Check.css</file>
<file alias="plug.css" compressed="true">plug.css</file>
<file compressed="true">plug.css</file>
</gresource>
<gresource prefix="io/elementary/switchboard/icons">
<file alias="32x32@2/apps/dock-icon-symbolic.svg" compressed="true" preprocess="xml-stripblanks">icons/32.svg</file>
Expand Down
14 changes: 13 additions & 1 deletion data/plug.css
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,19 @@
0 3px 3px alpha(#000, 0.22);
}

radiobutton .card {
.wallpaper-container check {
border-radius: 50%;
min-height: 20px;
min-width: 20px;
-gtk-icon-transform: scale(0.6);
}

.wallpaper-container picture {
min-width: 162px;
min-height: 100px;
}

checkbutton .card {
background-image:
linear-gradient(
to bottom,
Expand Down
13 changes: 4 additions & 9 deletions src/Widgets/WallpaperContainer.vala
Original file line number Diff line number Diff line change
Expand Up @@ -76,26 +76,21 @@ public class PantheonShell.WallpaperContainer : Gtk.FlowBoxChild {

scale = style_context.get_scale ();

image = new Gtk.Picture () {
halign = CENTER,
valign = CENTER
};
image = new Gtk.Picture ();
image.get_style_context ().set_scale (1);

// We need an extra grid to not apply a scale == 1 to the "card" style.
card_box = new Gtk.Box (VERTICAL, 0);
card_box.add_css_class (Granite.STYLE_CLASS_CARD);
card_box.append (image);

var check_provider = new Gtk.CssProvider ();
check_provider.load_from_resource ("/io/elementary/switchboard/plug/pantheon-shell/Check.css");

var check = new Gtk.CheckButton () {
active = true,
halign = START,
valign = START,
can_focus = false
can_focus = false,
can_target = false
};
check.get_style_context ().add_provider (check_provider, Gtk.STYLE_PROVIDER_PRIORITY_USER);

check_revealer = new Gtk.Revealer () {
child = check,
Expand Down

0 comments on commit e1e9622

Please sign in to comment.