summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Greenberg <ifnspifn@gmail.com>2014-02-05 18:02:08 -0800
committerWill Greenberg <ifnspifn@gmail.com>2014-02-05 18:02:08 -0800
commit04879b36e2f31d210d554551a71cecbc1a678c20 (patch)
tree179fd8b67907f4217eb331791316b777ae4fec42
parentbb4e92312ebf909f7c45fecac5780bf43b440acc (diff)
parent7c93c8adc3a1c64298993a92d959e4cf894ce23d (diff)
Merge pull request #552 from endlessm/issues/551
Rounded corners on unmaximized top bar
-rw-r--r--data/css/endless-widgets.css4
-rw-r--r--endless/eostopbar.c7
2 files changed, 11 insertions, 0 deletions
diff --git a/data/css/endless-widgets.css b/data/css/endless-widgets.css
index bfa2027..c820fbc 100644
--- a/data/css/endless-widgets.css
+++ b/data/css/endless-widgets.css
@@ -37,6 +37,10 @@ EosWindow {
from(#464646), to(#1e1e1e));
}
+.top-bar.unmaximized {
+ border-radius: 7px 7px 0px 0px;
+}
+
.top-bar:backdrop {
background-image: -gtk-gradient(linear, center top, center bottom,
from(#282828), to(#1e1e1e));
diff --git a/endless/eostopbar.c b/endless/eostopbar.c
index 735ba6c..85f4753 100644
--- a/endless/eostopbar.c
+++ b/endless/eostopbar.c
@@ -18,6 +18,7 @@
* The action buttons area contain "minimize", "maximize" and "close" buttons.
*/
#define _EOS_STYLE_CLASS_TOP_BAR "top-bar"
+#define _EOS_STYLE_CLASS_UNMAXIMIZED "unmaximized"
#define _EOS_TOP_BAR_HEIGHT_PX 36
#define _EOS_TOP_BAR_BUTTON_PADDING_PX 4
#define _EOS_TOP_BAR_ICON_SIZE_PX 16
@@ -344,4 +345,10 @@ eos_top_bar_update_window_maximized (EosTopBar *self,
gtk_image_set_from_icon_name (GTK_IMAGE (priv->maximize_icon),
icon_name,
GTK_ICON_SIZE_SMALL_TOOLBAR);
+
+ GtkStyleContext *context = gtk_widget_get_style_context (GTK_WIDGET (self));
+ if (!is_maximized)
+ gtk_style_context_add_class (context, _EOS_STYLE_CLASS_UNMAXIMIZED);
+ else
+ gtk_style_context_remove_class (context, _EOS_STYLE_CLASS_UNMAXIMIZED);
}