Skip to content

Commit

Permalink
Revert back to Avatar for now
Browse files Browse the repository at this point in the history
  • Loading branch information
danirabbit committed Dec 21, 2023
1 parent 947eca7 commit 8073b39
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
13 changes: 10 additions & 3 deletions data/OperatingSystemView.css
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
.card.circular {
background: linear-gradient(
.logo {
color: white;
background-image: linear-gradient(
to bottom,
alpha(@accent_color_500, 0.25),
alpha(@accent_color_700, 0.75)
);
color: white;
border-radius: 100%;
box-shadow:
inset 0 -2px 0 0 alpha(@highlight_color, 0.2),
inset 0 2px 0 0 alpha(@highlight_color, 0.3),
inset 2px 0 0 0 alpha(@highlight_color, 0.07),
inset -2px 0 0 0 alpha(@highlight_color, 0.07),
inset 0 0 0 1px alpha(black, 0.7);
-gtk-icon-shadow:
0 1px 1px alpha(black, 0.3),
0 2px 3px alpha(@accent_color_900, 0.2);
Expand Down
10 changes: 3 additions & 7 deletions src/Views/OperatingSystemView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,17 @@ public class About.OperatingSystemView : Gtk.Box {
);

if (file.query_exists ()) {
var logo = new Gtk.Image.from_file (file.get_path ()) {
overflow = HIDDEN,
pixel_size = 128
var logo = new Adw.Avatar (128, "", false) {
custom_image = Gdk.Texture.from_file (file)
};
logo.add_css_class (Granite.STYLE_CLASS_CIRCULAR);
logo.get_style_context ().add_provider (style_provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);

logo_overlay.child = logo;
logo_overlay.add_overlay (icon);

// 128 minus 3px padding on each side
icon.pixel_size = 128 - 6;

icon.add_css_class (Granite.STYLE_CLASS_CARD);
icon.add_css_class (Granite.STYLE_CLASS_CIRCULAR);
icon.add_css_class ("logo");
icon.get_style_context ().add_provider (style_provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);

break;
Expand Down

0 comments on commit 8073b39

Please sign in to comment.