Skip to content

Commit

Permalink
Fix IconButton CSS for GTK 3.22
Browse files Browse the repository at this point in the history
  • Loading branch information
donadigo committed Aug 11, 2018
1 parent 443b022 commit 447c2e7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Binary file modified Screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 15 additions & 1 deletion src/IconButton.vala
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,26 @@ public class AppEditor.IconButton : Gtk.MenuButton {
}
""";

private const string BUTTON_CSS_322 = """
button {
border-width: 1px;
border-color: #c8c8c8;
}
""";

static construct {
default_icon = new ThemedIcon ("application-x-executable");
}

construct {
Granite.Widgets.Utils.set_theming (this, BUTTON_CSS, "flat", Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
string css;
if (Application.has_gtk_322 ()) {
css = BUTTON_CSS_322;
} else {
css = BUTTON_CSS;
}

Granite.Widgets.Utils.set_theming (this, css, "flat", Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);

icon_image = new Gtk.Image ();
icon_image.pixel_size = 64;
Expand Down

0 comments on commit 447c2e7

Please sign in to comment.