Merge lp:~3v1n0/ubuntu-themes/better-destructive-action into lp:ubuntu-themes

Proposed by Marco Trevisan (Treviño) on 2017-08-22
Status: Merged
Approved by: Ken VanDine on 2017-09-07
Approved revision: 556
Merged at revision: 558
Proposed branch: lp:~3v1n0/ubuntu-themes/better-destructive-action
Merge into: lp:ubuntu-themes
Prerequisite: lp:~3v1n0/ubuntu-themes/appmenu-theming-shape-fix
Diff against target: 325 lines (+140/-24)
2 files modified
Ambiance/gtk-3.20/gtk-widgets.css (+70/-12)
Radiance/gtk-3.20/gtk-widgets.css (+70/-12)
To merge this branch: bzr merge lp:~3v1n0/ubuntu-themes/better-destructive-action
Reviewer Review Type Date Requested Status
Ken VanDine 2017-08-22 Approve on 2017-09-07
Didier Roche 2017-08-25 Pending
Review via email: mp+329392@code.launchpad.net

This proposal supersedes a proposal from 2017-08-22.

Commit Message

Ambiance, Radiance: add better definition for button destructive-action

Based on Adwaita

Description of the Change

For example when hitting shift+delete on a file in nautilus

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

Martin is going to review it. I tried it, it's mostly looking good, but there is some offset on the right (the border is smaller than the button background itself)

Ken VanDine (ken-vandine) wrote :

@3v1n0 is going to fix the offset in a separate branch, approving this to unblock getting other theme fixes landed. Either way it's an improvement.

review: Approve
557. By Marco Trevisan (Treviño) on 2017-09-18

Ambiance, Radiance: rebase destructive-action buttons definition on default ones

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-18 18:20:28 +0000
3+++ Ambiance/gtk-3.20/gtk-widgets.css 2017-09-18 18:20:28 +0000
4@@ -67,6 +67,16 @@
5 border-color: transparent;
6 }
7
8+button.destructive-action {
9+ color: white;
10+ text-shadow: 0 1px alpha (shade (@error_bg_color, 1.55), 0.4);
11+ background-color: shade (@error_bg_color, 1.1);
12+ background-image: -gtk-gradient (linear, left top, left bottom,
13+ from (shade (@error_bg_color, 1.1)),
14+ color-stop (0.5, @error_bg_color),
15+ to (shade (@error_bg_color, 0.95)));
16+}
17+
18 button:backdrop {
19 background-image: none;
20 background-color: @bg_color;
21@@ -81,6 +91,13 @@
22 border-image-source: none;
23 }
24
25+button.destructive-action:backdrop {
26+ color: alpha (white, 0.75);
27+ background-color: shade (@error_bg_color, 1.2);
28+ text-shadow: 0 1px alpha (shade (@error_bg_color, 1.55), 0.2);
29+ background-image: none;
30+}
31+
32 button:focus {
33 border-image-source: -gtk-scaled(url("assets/button-focused.png"),
34 url("assets/button-focused@2.png"));
35@@ -96,6 +113,7 @@
36 }
37
38 button:hover:backdrop {
39+ background-image: none;
40 background-color: shade (@bg_color, 1.04);
41 border-image-source: -gtk-scaled(url("assets/backdrop-button-hover.png"),
42 url("assets/backdrop-button-hover@2.png"));
43@@ -106,6 +124,17 @@
44 url("assets/button-focused-hover@2.png"));
45 }
46
47+button.destructive-action:hover {
48+ background-image: -gtk-gradient (linear, left top, left bottom,
49+ from (shade (@error_bg_color, 1.12)),
50+ color-stop (0.5, @error_bg_color),
51+ to (shade (@error_bg_color, 0.96)));
52+}
53+
54+button.destructive-action:hover:backdrop {
55+ background-image: none;
56+ background-color: shade (@error_bg_color, 0.95);
57+}
58
59 button:disabled {
60 background-image: none;
61@@ -143,6 +172,16 @@
62 url("assets/button-active-focused@2.png"));
63 }
64
65+button.destructive-action:checked {
66+ background-image: -gtk-gradient (linear, left top, left bottom,
67+ from (shade (@error_bg_color, 0.80)),
68+ to (shade (@error_bg_color, 1.2)));
69+}
70+
71+button.destructive-action:checked:backdrop {
72+ background-image: none;
73+}
74+
75 button:active {
76 background-image: -gtk-gradient (linear, left top, left bottom,
77 from (#dcdcdc),
78@@ -156,6 +195,12 @@
79 url("assets/button-active-focused-hover@2.png"));
80 }
81
82+button.destructive-action:active {
83+ background-image: -gtk-gradient (linear, left top, left bottom,
84+ from (shade (@error_bg_color, 0.87)),
85+ to (shade (@error_bg_color, 1.1)));
86+}
87+
88 button:checked:disabled,
89 button:active:disabled {
90 background-image: -gtk-gradient (linear, left top, left bottom,
91@@ -201,16 +246,6 @@
92 }
93 */
94
95-button.destructive-action {
96- background-image: linear-gradient(to bottom, #e03d3d, #ef2929);
97- border-color: #8e0b0b;
98- border-image: none;
99- color: white;
100- -gtk-icon-shadow: 0 1px shade(#9d4242, 1.15);
101- outline-color: rgba(255, 255, 255, 0.3);
102- text-shadow: 0 1px shade(#9d4242, 1.15);
103-}
104-
105 /******************
106 * Linked Widgets *
107 *****************/
108@@ -2684,13 +2719,19 @@
109 border-color: @osd_border_color;
110 }
111
112+.osd:backdrop {
113+ border-color: lighter (@osd_border_color);
114+}
115+
116 .osd.toolbar {
117 padding: 12px;
118 border-radius: 8px;
119 }
120
121 .osd button,
122-.osd button:backdrop {
123+.osd button:backdrop,
124+.osd button.destructive-action,
125+.osd button.destructive-action:backdrop {
126 color: @osd_fg_color;
127 background: none;
128 border: none;
129@@ -2710,8 +2751,19 @@
130 border-image: none;
131 }
132
133+button.osd.destructive-action,
134+button.osd.destructive-action:hover,
135+button.osd.destructive-action:active {
136+ color: @osd_fg_color;
137+ background: @error_bg_color;
138+ box-shadow: none;
139+ border-image: none;
140+}
141+
142 button.osd:hover,
143-.osd button:hover {
144+button.osd.destructive-action:hover,
145+.osd button:hover,
146+.osd button.destructive-action:hover {
147 color: lighter(@osd_fg_color);
148 -gtk-icon-shadow: 0 0 3px @osd_fg_color;
149 }
150@@ -2722,6 +2774,12 @@
151 -gtk-icon-shadow: none;
152 }
153
154+button.osd.destructive-action:active,
155+.osd button.destructive-action:active {
156+ color: shade(@osd_fg_color, 0.9);
157+ -gtk-icon-shadow: none;
158+}
159+
160 /*************
161 * overshoot *
162 *************/
163
164=== modified file 'Radiance/gtk-3.20/gtk-widgets.css'
165--- Radiance/gtk-3.20/gtk-widgets.css 2017-09-18 18:20:28 +0000
166+++ Radiance/gtk-3.20/gtk-widgets.css 2017-09-18 18:20:28 +0000
167@@ -66,6 +66,16 @@
168 border-color: transparent;
169 }
170
171+button.destructive-action {
172+ color: white;
173+ text-shadow: 0 1px alpha (shade (@error_bg_color, 1.55), 0.4);
174+ background-color: shade (@error_bg_color, 1.1);
175+ background-image: -gtk-gradient (linear, left top, left bottom,
176+ from (shade (@error_bg_color, 1.1)),
177+ color-stop (0.5, @error_bg_color),
178+ to (shade (@error_bg_color, 0.95)));
179+}
180+
181 button:backdrop {
182 background-image: none;
183 background-color: @bg_color;
184@@ -80,6 +90,13 @@
185 border-image-source: none;
186 }
187
188+button.destructive-action:backdrop {
189+ color: alpha (white, 0.75);
190+ background-color: shade (@error_bg_color, 1.2);
191+ text-shadow: 0 1px alpha (shade (@error_bg_color, 1.55), 0.2);
192+ background-image: none;
193+}
194+
195 button:focus {
196 border-image-source: -gtk-scaled(url("assets/button-focused.png"),
197 url("assets/button-focused.png@2"));
198@@ -95,6 +112,7 @@
199 }
200
201 button:hover:backdrop {
202+ background-image: none;
203 background-color: shade (@bg_color, 1.04);
204 border-image-source: -gtk-scaled(url("assets/backdrop-button-hover.png"),
205 url("assets/backdrop-button-hover@2.png"));
206@@ -105,6 +123,17 @@
207 url("assets/button-focused-hover@2.png"));
208 }
209
210+button.destructive-action:hover {
211+ background-image: -gtk-gradient (linear, left top, left bottom,
212+ from (shade (@error_bg_color, 1.12)),
213+ color-stop (0.5, @error_bg_color),
214+ to (shade (@error_bg_color, 0.96)));
215+}
216+
217+button.destructive-action:hover:backdrop {
218+ background-image: none;
219+ background-color: shade (@error_bg_color, 0.95);
220+}
221
222 button:disabled {
223 background-image: none;
224@@ -142,6 +171,16 @@
225 url("assets/button-active-focused@2.png"));
226 }
227
228+button.destructive-action:checked {
229+ background-image: -gtk-gradient (linear, left top, left bottom,
230+ from (shade (@error_bg_color, 0.80)),
231+ to (shade (@error_bg_color, 1.2)));
232+}
233+
234+button.destructive-action:checked:backdrop {
235+ background-image: none;
236+}
237+
238 button:active {
239 background-image: -gtk-gradient (linear, left top, left bottom,
240 from (#dcdcdc),
241@@ -155,6 +194,12 @@
242 url("assets/button-active-focused-hover@2.png"));
243 }
244
245+button.destructive-action:active {
246+ background-image: -gtk-gradient (linear, left top, left bottom,
247+ from (shade (@error_bg_color, 0.87)),
248+ to (shade (@error_bg_color, 1.1)));
249+}
250+
251 button:checked:disabled,
252 button:active:disabled {
253 background-image: -gtk-gradient (linear, left top, left bottom,
254@@ -200,16 +245,6 @@
255 }
256 */
257
258-button.destructive-action {
259- background-image: linear-gradient(to bottom, #e03d3d, #ef2929);
260- border-color: #8e0b0b;
261- border-image: none;
262- color: white;
263- -gtk-icon-shadow: 0 1px shade(#9d4242, 1.15);
264- outline-color: rgba(255, 255, 255, 0.3);
265- text-shadow: 0 1px shade(#9d4242, 1.15);
266-}
267-
268 /******************
269 * Linked Widgets *
270 *****************/
271@@ -2682,13 +2717,19 @@
272 border-color: @osd_border_color;
273 }
274
275+.osd:backdrop {
276+ border-color: lighter (@osd_border_color);
277+}
278+
279 .osd.toolbar {
280 padding: 12px;
281 border-radius: 8px;
282 }
283
284 .osd button,
285-.osd button:backdrop {
286+.osd button:backdrop,
287+.osd button.destructive-action,
288+.osd button.destructive-action:backdrop {
289 color: @osd_fg_color;
290 background: none;
291 border: none;
292@@ -2708,8 +2749,19 @@
293 border-image: none;
294 }
295
296+button.osd.destructive-action,
297+button.osd.destructive-action:hover,
298+button.osd.destructive-action:active {
299+ color: @osd_fg_color;
300+ background: @error_bg_color;
301+ box-shadow: none;
302+ border-image: none;
303+}
304+
305 button.osd:hover,
306-.osd button:hover {
307+button.osd.destructive-action:hover,
308+.osd button:hover,
309+.osd button.destructive-action:hover {
310 color: lighter(@osd_fg_color);
311 -gtk-icon-shadow: 0 0 3px @osd_fg_color;
312 }
313@@ -2720,6 +2772,12 @@
314 -gtk-icon-shadow: none;
315 }
316
317+button.osd.destructive-action:active,
318+.osd button.destructive-action:active {
319+ color: shade(@osd_fg_color, 0.9);
320+ -gtk-icon-shadow: none;
321+}
322+
323 /*************
324 * overshoot *
325 *************/

Subscribers

People subscribed via source and target branches