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
=== modified file 'decorations/DecorationsForceQuitDialog.cpp'
--- decorations/DecorationsForceQuitDialog.cpp 2016-03-22 15:29:31 +0000
+++ decorations/DecorationsForceQuitDialog.cpp 2016-08-06 16:23:25 +0000
@@ -279,7 +279,7 @@
279 int decoration_radius = std::max({radius.top, radius.left, radius.right, radius.bottom});279 int decoration_radius = std::max({radius.top, radius.left, radius.right, radius.bottom});
280280
281 gtk_css_provider_load_from_data(style, (R"(281 gtk_css_provider_load_from_data(style, (R"(
282 SheetStyleDialog {282 SheetStyleDialog, sheet-style-dialog {
283 background-color: #f7f6f5;283 background-color: #f7f6f5;
284 color: #4a4a4a;284 color: #4a4a4a;
285 border-radius: )"+std::to_string(decoration_radius)+R"(px;285 border-radius: )"+std::to_string(decoration_radius)+R"(px;
@@ -291,7 +291,7 @@
291 std::to_string(int(color.alpha))+'.'+std::to_string(int(color.alpha*10000.0))+')'+R"(;291 std::to_string(int(color.alpha))+'.'+std::to_string(int(color.alpha*10000.0))+')'+R"(;
292 }292 }
293293
294 SheetStyleDialog:backdrop {294 SheetStyleDialog:backdrop, sheet-style-dialog:backdrop {
295 background-color: shade(#f7f6f5, 1.2);295 background-color: shade(#f7f6f5, 1.2);
296 color: shade(#4a4a4a, 1.5);296 color: shade(#4a4a4a, 1.5);
297 border-radius: )"+std::to_string(decoration_radius)+R"(px;297 border-radius: )"+std::to_string(decoration_radius)+R"(px;
@@ -327,10 +327,7 @@
327327
328 auto* title = gtk_label_new(_("This window is not responding"));328 auto* title = gtk_label_new(_("This window is not responding"));
329 glib::Object<GtkCssProvider> title_style(gtk_css_provider_new());329 glib::Object<GtkCssProvider> title_style(gtk_css_provider_new());
330 gtk_css_provider_load_from_data(title_style, (R"(330 gtk_css_provider_load_from_data(title_style, (R"(* { font-size: 17px; })"), -1, nullptr);
331 GtkLabel {
332 font-size: 17px;
333 })"), -1, nullptr);
334 style_ctx = gtk_widget_get_style_context(title);331 style_ctx = gtk_widget_get_style_context(title);
335 gtk_style_context_add_provider(style_ctx, glib::object_cast<GtkStyleProvider>(title_style), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);332 gtk_style_context_add_provider(style_ctx, glib::object_cast<GtkStyleProvider>(title_style), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
336 gtk_style_context_add_class(style_ctx, "unity-force-quit");333 gtk_style_context_add_class(style_ctx, "unity-force-quit");
@@ -377,6 +374,10 @@
377 gtk_render_background(gtk_widget_get_style_context(self), cr, 0, 0, a.width, a.height);374 gtk_render_background(gtk_widget_get_style_context(self), cr, 0, 0, a.width, a.height);
378 return GTK_WIDGET_CLASS(sheet_style_dialog_parent_class)->draw(self, cr);375 return GTK_WIDGET_CLASS(sheet_style_dialog_parent_class)->draw(self, cr);
379 };376 };
377
378#if GTK_CHECK_VERSION(3, 20, 0)
379 gtk_widget_class_set_css_name(GTK_WIDGET_CLASS(klass), "sheet-style-dialog");
380#endif
380}381}
381382
382// Close button383// Close button