[polari] ui: Fix CSD window decorations
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari] ui: Fix CSD window decorations
- Date: Fri, 6 Sep 2013 15:05:37 +0000 (UTC)
commit 64bc6cf34e8dba426bdf50e726b33d0e93df2d5a
Author: Florian Müllner <fmuellner gnome org>
Date: Fri Sep 6 16:42:52 2013 +0200
ui: Fix CSD window decorations
Tricky. GTK+ automatically sets the .titlebar style on custom titlebars,
which will give us a nice gradient background and rounded corners in
Adwaita. Except that GtkBox we are using as container for the two
HeaderBars does not have a window to paint on, so our titlebar ends
up with the default header-bar style - no gradient, no rounded corners.
Work around this by manually adding the .titlebar class to both
HeaderBars and use custom CSS to remove the unwanted border-radii.
data/resources/application.css | 10 ++++++++++
data/resources/main-window.ui | 2 ++
2 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/data/resources/application.css b/data/resources/application.css
index a3b3e4f..eb76b9e 100644
--- a/data/resources/application.css
+++ b/data/resources/application.css
@@ -83,6 +83,16 @@
padding: 6px 1px 0;
}
+.polari-titlebar-left:dir(ltr),
+.polari-titlebar-right:dir(rtl) {
+ border-top-right-radius: 0;
+}
+
+.polari-titlebar-right:dir(ltr),
+.polari-titlebar-left:dir(rtl) {
+ border-top-left-radius: 0;
+}
+
.polari-titlebar-separator {
border-image: linear-gradient(to bottom, @theme_bg_color, shade(@borders, 1.2));
border-image-width: 0 1px 0 0;
diff --git a/data/resources/main-window.ui b/data/resources/main-window.ui
index f06946d..7e77327 100644
--- a/data/resources/main-window.ui
+++ b/data/resources/main-window.ui
@@ -31,6 +31,7 @@
<property name="hexpand">False</property>
<style>
<class name="polari-titlebar-left"/>
+ <class name="titlebar"/>
</style>
<child>
<object class="GtkMenuButton" id="button1">
@@ -102,6 +103,7 @@
<property name="show_close_button">True</property>
<style>
<class name="polari-titlebar-right"/>
+ <class name="titlebar"/>
</style>
<child>
<object class="GtkLabel" id="label1">
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]