Merge lp:~3v1n0/unity/force-quit-dialog-gtk-3.20-selectors into lp:unity

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Marco Trevisan (Treviño)
Approved revision: no longer in the source branch.
Merged at revision: 4167
Proposed branch: lp:~3v1n0/unity/force-quit-dialog-gtk-3.20-selectors
Merge into: lp:unity
Diff against target: 44 lines (+7/-6)
1 file modified
decorations/DecorationsForceQuitDialog.cpp (+7/-6)
To merge this branch: bzr merge lp:~3v1n0/unity/force-quit-dialog-gtk-3.20-selectors
Reviewer Review Type Date Requested Status
Iain Lane Approve
Unity Team Pending
Review via email: mp+302049@code.launchpad.net

Commit message

DecorationsForceQuitDialog: make CSS selectors work with gtk 3.20

To post a comment you must log in.
Revision history for this message
Iain Lane (laney) wrote :

This looks good, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'decorations/DecorationsForceQuitDialog.cpp'
2--- decorations/DecorationsForceQuitDialog.cpp 2016-03-22 15:29:31 +0000
3+++ decorations/DecorationsForceQuitDialog.cpp 2016-08-06 16:23:25 +0000
4@@ -279,7 +279,7 @@
5 int decoration_radius = std::max({radius.top, radius.left, radius.right, radius.bottom});
6
7 gtk_css_provider_load_from_data(style, (R"(
8- SheetStyleDialog {
9+ SheetStyleDialog, sheet-style-dialog {
10 background-color: #f7f6f5;
11 color: #4a4a4a;
12 border-radius: )"+std::to_string(decoration_radius)+R"(px;
13@@ -291,7 +291,7 @@
14 std::to_string(int(color.alpha))+'.'+std::to_string(int(color.alpha*10000.0))+')'+R"(;
15 }
16
17- SheetStyleDialog:backdrop {
18+ SheetStyleDialog:backdrop, sheet-style-dialog:backdrop {
19 background-color: shade(#f7f6f5, 1.2);
20 color: shade(#4a4a4a, 1.5);
21 border-radius: )"+std::to_string(decoration_radius)+R"(px;
22@@ -327,10 +327,7 @@
23
24 auto* title = gtk_label_new(_("This window is not responding"));
25 glib::Object<GtkCssProvider> title_style(gtk_css_provider_new());
26- gtk_css_provider_load_from_data(title_style, (R"(
27- GtkLabel {
28- font-size: 17px;
29- })"), -1, nullptr);
30+ gtk_css_provider_load_from_data(title_style, (R"(* { font-size: 17px; })"), -1, nullptr);
31 style_ctx = gtk_widget_get_style_context(title);
32 gtk_style_context_add_provider(style_ctx, glib::object_cast<GtkStyleProvider>(title_style), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
33 gtk_style_context_add_class(style_ctx, "unity-force-quit");
34@@ -377,6 +374,10 @@
35 gtk_render_background(gtk_widget_get_style_context(self), cr, 0, 0, a.width, a.height);
36 return GTK_WIDGET_CLASS(sheet_style_dialog_parent_class)->draw(self, cr);
37 };
38+
39+#if GTK_CHECK_VERSION(3, 20, 0)
40+ gtk_widget_class_set_css_name(GTK_WIDGET_CLASS(klass), "sheet-style-dialog");
41+#endif
42 }
43
44 // Close button