Merge lp:~3v1n0/ubuntu-themes/headerbars-as-titlebar-children-fix into lp:ubuntu-themes

Proposed by Marco Trevisan (Treviño) on 2017-09-23
Status: Merged
Approved by: Iain Lane on 2017-09-25
Approved revision: 569
Merged at revision: 566
Proposed branch: lp:~3v1n0/ubuntu-themes/headerbars-as-titlebar-children-fix
Merge into: lp:ubuntu-themes
Prerequisite: lp:~3v1n0/ubuntu-themes/fix-dialog-headerbar-min-height
Diff against target: 227 lines (+86/-17)
2 files modified
Ambiance/gtk-3.20/gtk-widgets.css (+44/-9)
Radiance/gtk-3.20/gtk-widgets.css (+42/-8)
To merge this branch: bzr merge lp:~3v1n0/ubuntu-themes/headerbars-as-titlebar-children-fix
Reviewer Review Type Date Requested Status
Didier Roche 2017-09-23 Approve on 2017-09-25
Review via email: mp+331242@code.launchpad.net

Commit Message

Ambiance,Radiance: refactor .titlebar theming to properly support headerbar children

Sometimes we've a widget as titlebar containing two or more headerbars
as children, thus we should paint the background in the parent, and only apply
rounded corners to the first and last headerbars.

So we now define paddings and main theming for .titlebar, while the border
radius only for headerbars.

Code inspired on upstream changes, keeping unity7 working too.

To post a comment you must log in.
Didier Roche (didrocks) wrote :

Looking good to me, even if more complicated than I was anticipated :)
Good work!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Ambiance/gtk-3.20/gtk-widgets.css'
2--- Ambiance/gtk-3.20/gtk-widgets.css 2017-09-23 03:58:24 +0000
3+++ Ambiance/gtk-3.20/gtk-widgets.css 2017-09-23 03:58:24 +0000
4@@ -2152,11 +2152,6 @@
5 border-radius: 0;
6 }
7
8-.titlebar:not(headerbar),
9-headerbar {
10- min-height: 26px;
11-}
12-
13 .solid-csd .titlebar:backdrop:dir(rtl):not(headerbar),
14 .solid-csd .titlebar:backdrop:dir(ltr):not(headerbar),
15 .solid-csd .titlebar:dir(rtl):not(headerbar),
16@@ -2185,10 +2180,11 @@
17 border-color: @dark_bg_color
18 }
19
20-.titlebar,
21+.titlebar:not(headerbar),
22+headerbar:not(.toolbar-mode),
23 UnityDecoration .top {
24+ min-height: 26px;
25 border: 1px solid rgba (0, 3, 5, 0.03); /* shade (@dark_bg_color, 1.04) - shade (@dark_bg_color, 1.5) */
26- border-radius: 6px 6px 0 0;
27 padding: 1px 6px 1px 6px;
28
29 box-shadow: inset 0 0 transparent, inset 0 0 transparent,
30@@ -2204,7 +2200,8 @@
31 text-shadow: 1px 0 #333, -1px 0 #333, 0 1px #333, 0 -1px #333;
32 }
33
34-.titlebar:backdrop,
35+.titlebar:not(headerbar):backdrop,
36+headerbar:not(.toolbar-mode):backdrop,
37 UnityDecoration .top:backdrop {
38 border: 1px solid rgba (14, 13, 0, 0.03); /* @dark_bg_color - shade (#474642, 0.92) */;
39 background-color: transparent;
40@@ -2217,8 +2214,30 @@
41 color: #807d78;
42 }
43
44+UnityDecoration .top,
45+.background:not(.tiled):not(.maximized):not(.solid-csd) .titlebar {
46+ border-top-left-radius: 6px;
47+ border-top-right-radius: 6px;
48+}
49+
50+window.csd:not(.tiled):not(.maximized):not(.fullscreen):not(.solid-csd) separator:first-child + headerbar,
51+window.csd:not(.tiled):not(.maximized):not(.fullscreen):not(.solid-csd) headerbar:first-child {
52+ border-top-left-radius: 6px;
53+}
54+
55+window.csd:not(.tiled):not(.maximized):not(.fullscreen):not(.solid-csd) headerbar:last-child {
56+ border-top-right-radius: 6px;
57+}
58+
59+window.csd:not(.tiled):not(.maximized):not(.fullscreen):not(.solid-csd) stack headerbar:first-child,
60+window.csd:not(.tiled):not(.maximized):not(.fullscreen):not(.solid-csd) stack headerbar:last-child {
61+ border-top-left-radius: 6px;
62+ border-top-right-radius: 6px;
63+}
64+
65 .maximized .titlebar,
66-.tiled .titlebar {
67+.tiled .titlebar,
68+.fullscreen .titlebar {
69 border-radius: 0;
70 border-image: none;
71 border: none;
72@@ -2230,6 +2249,19 @@
73 box-shadow: inset 0 1px shade (@dark_bg_color, 1.6);
74 }
75
76+window.csd > .titlebar:not(headerbar) {
77+ padding: 0;
78+ background-color: transparent;
79+ /* It would be nice to do this, but it would break separators between
80+ * headerbars (as g-c-c has) since we use the border to get the
81+ * separator effect here. We can enable this back if we ever just use bg
82+ * background-image: none;
83+ */
84+ border-style: none;
85+ border-color: transparent;
86+ box-shadow: none;
87+}
88+
89 .titlebar .title {
90 font-weight: bold;
91 }
92@@ -2333,6 +2365,7 @@
93 .primary-toolbar,
94 /* Workaround for LP: #1689239, selects headerbars used as toolbar in Unity */
95 :not(.titlebar) > headerbar:not(.titlebar),
96+window.csd.unity-csd.maximized .titlebar,
97 .titlebar.toolbar-mode {
98 -GtkWidget-window-dragging: true;
99
100@@ -2354,6 +2387,7 @@
101 .primary-toolbar:backdrop,
102 /* Workaround for LP: #1689239, selects headerbars used as toolbar in Unity */
103 :not(.titlebar) > headerbar:not(.titlebar):backdrop,
104+window.csd.unity-csd.maximized .titlebar:backdrop,
105 .titlebar.toolbar-mode:backdrop {
106 background-image: none;
107 background-color: @dark_bg_color;
108@@ -2366,6 +2400,7 @@
109
110 .primary-toolbar:disabled,
111 .titlebar.toolbar-mode:disabled,
112+window.csd.unity-csd.maximized .titlebar:disabled,
113 headerbar:disabled {
114 text-shadow: 0 -1px shade (@dark_bg_color, 0.7);
115 }
116
117=== modified file 'Radiance/gtk-3.20/gtk-widgets.css'
118--- Radiance/gtk-3.20/gtk-widgets.css 2017-09-23 03:58:24 +0000
119+++ Radiance/gtk-3.20/gtk-widgets.css 2017-09-23 03:58:24 +0000
120@@ -2151,11 +2151,6 @@
121 border-radius: 0;
122 }
123
124-.titlebar:not(headerbar),
125-headerbar {
126- min-height: 26px;
127-}
128-
129 .solid-csd .titlebar:backdrop:dir(rtl):not(headerbar),
130 .solid-csd .titlebar:backdrop:dir(ltr):not(headerbar),
131 .solid-csd .titlebar:dir(rtl):not(headerbar),
132@@ -2184,10 +2179,11 @@
133 border-color: @dark_bg_color
134 }
135
136-.titlebar,
137+.titlebar:not(headerbar),
138+headerbar:not(.toolbar-mode),
139 UnityDecoration .top {
140+ min-height: 26px;
141 border: 1px solid rgba (85, 40, 0, 0.04); /* shade (@dark_bg_color) (shade (#edebe6, 1.06) */
142- border-radius: 6px 6px 0 0;
143 padding: 1px 6px 1px 6px;
144
145 box-shadow: inset 0 0 transparent, inset 0 0 transparent,
146@@ -2204,7 +2200,8 @@
147 0 1px shade (@dark_bg_color, 1.06), 0 -1px shade (@dark_bg_color, 1.06);
148 }
149
150-.titlebar:backdrop,
151+.titlebar:not(headerbar):backdrop,
152+headerbar:not(.toolbar-mode):backdrop,
153 UnityDecoration .top:backdrop {
154 border: 1px solid rgba (110, 27, 0, 0.04); /* shade @dark_bg_color - shade (#edebe6, 0.96) */
155 background-color: transparent;
156@@ -2220,6 +2217,27 @@
157 0 1px 1px shade (@dark_bg_color, 1.08), 0 -1px 1px shade (@dark_bg_color, 1.08);
158 }
159
160+UnityDecoration .top,
161+.background:not(.tiled):not(.maximized):not(.solid-csd) .titlebar {
162+ border-top-left-radius: 6px;
163+ border-top-right-radius: 6px;
164+}
165+
166+window.csd:not(.tiled):not(.maximized):not(.fullscreen):not(.solid-csd) separator:first-child + headerbar,
167+window.csd:not(.tiled):not(.maximized):not(.fullscreen):not(.solid-csd) headerbar:first-child {
168+ border-top-left-radius: 6px;
169+}
170+
171+window.csd:not(.tiled):not(.maximized):not(.fullscreen):not(.solid-csd) headerbar:last-child {
172+ border-top-right-radius: 6px;
173+}
174+
175+window.csd:not(.tiled):not(.maximized):not(.fullscreen):not(.solid-csd) stack headerbar:first-child,
176+window.csd:not(.tiled):not(.maximized):not(.fullscreen):not(.solid-csd) stack headerbar:last-child {
177+ border-top-left-radius: 6px;
178+ border-top-right-radius: 6px;
179+}
180+
181 .maximized .titlebar,
182 .tiled .titlebar {
183 border-radius: 0;
184@@ -2233,6 +2251,19 @@
185 box-shadow: inset 0 1px shade (#edebe6, 1.08);
186 }
187
188+window.csd > .titlebar:not(headerbar) {
189+ padding: 0;
190+ background-color: transparent;
191+ /* It would be nice to do this, but it would break separators between
192+ * headerbars (as g-c-c has) since we use the border to get the
193+ * separator effect here. We can enable this back if we ever just use bg
194+ * background-image: none;
195+ */
196+ border-style: none;
197+ border-color: transparent;
198+ box-shadow: none;
199+}
200+
201 .titlebar .title {
202 font-weight: bold;
203 }
204@@ -2336,6 +2367,7 @@
205 .primary-toolbar,
206 /* Workaround for LP: #1689239, selects headerbars used as toolbar in Unity */
207 :not(.titlebar) > headerbar:not(.titlebar),
208+window.csd.unity-csd.maximized .titlebar,
209 .titlebar.toolbar-mode {
210 -GtkWidget-window-dragging: true;
211
212@@ -2357,6 +2389,7 @@
213 .primary-toolbar:backdrop,
214 /* Workaround for LP: #1689239, selects headerbars used as toolbar in Unity */
215 :not(.titlebar) > headerbar:not(.titlebar):backdrop,
216+window.csd.unity-csd.maximized .titlebar:backdrop,
217 .titlebar.toolbar-mode:backdrop {
218 background-image: none;
219 background-color: @dark_bg_color;
220@@ -2369,6 +2402,7 @@
221
222 .primary-toolbar:disabled,
223 .titlebar.toolbar-mode:disabled,
224+window.csd.unity-csd.maximized .titlebar:disabled,
225 headerbar:disabled {
226 text-shadow: 0 -1px shade (@dark_bg_color, 0.7);
227 }

Subscribers

People subscribed via source and target branches