aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/flat-button.vala26
-rw-r--r--src/settings.vala2
2 files changed, 26 insertions, 2 deletions
diff --git a/src/flat-button.vala b/src/flat-button.vala
index cf846b8..4b989b7 100644
--- a/src/flat-button.vala
+++ b/src/flat-button.vala
@@ -29,8 +29,30 @@ public class FlatButton : Gtk.Button
try
{
var style = new Gtk.CssProvider ();
- style.load_from_data ("* {outline-width: 1px;
- }", -1);
+ style.load_from_data ("GtkButton, button {\n" +
+ " border-width: 1px;\n" +
+ " background-color: %s;\n".printf(AGSettings.get_string (AGSettings.KEY_FLATBUTTON_BGCOLOR)) +
+ " border-color: %s\n;".printf(AGSettings.get_string (AGSettings.KEY_FLATBUTTON_BORDERCOLOR)) +
+ "}\n" +
+ "button:hover,\n" +
+ "button:active,\n" +
+ "button:hover:active,\n" +
+ "button.selected:hover,\n" +
+ "button.selected {\n" +
+ " border-width: 1px;\n" +
+ " background-color: %s;\n".printf(AGSettings.get_string (AGSettings.KEY_FLATBUTTON_BGCOLOR)) +
+ " border-color: %s\n;".printf(AGSettings.get_string (AGSettings.KEY_FLATBUTTON_BORDERCOLOR)) +
+ "}\n" +
+ "button.high_contrast {\n" +
+ " background-color: %s;\n".printf ("rgba(70, 70, 70, 1.0)") +
+ " border-color: %s\n;".printf ("rgba(0, 0, 0, 1.0)") +
+ "}\n" +
+ "button.high_contrast:hover,\n" +
+ "button.high_contrast:active,\n" +
+ "button.high_contrast:hover:active,\n" +
+ "button.high_contrast.selected {\n" +
+ " background-color: %s;\n".printf ("rgba(0, 0, 0, 1.0)") +
+ "}\n", -1);
get_style_context ().add_provider (style, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
}
catch (Error e)
diff --git a/src/settings.vala b/src/settings.vala
index 9eef320..c90f3da 100644
--- a/src/settings.vala
+++ b/src/settings.vala
@@ -55,6 +55,8 @@ public class AGSettings : Object
public const string KEY_REMOTE_SERVICE_CONFIGURE_URI = "remote-service-configure-uri";
public const string KEY_TOGGLEBOX_FONT_FGCOLOR = "togglebox-font-fgcolor";
public const string KEY_TOGGLEBOX_BUTTON_BGCOLOR = "togglebox-button-bgcolor";
+ public const string KEY_FLATBUTTON_BGCOLOR = "flatbutton-bgcolor";
+ public const string KEY_FLATBUTTON_BORDERCOLOR = "flatbutton-bordercolor";
public const string KEY_ENABLE_HIDPI = "enable-hidpi";
public const string KEY_MENUBAR_ALPHA = "menubar-alpha";