Merge lp:~tombeckmann/granite/decoratedwindow-dialog into lp:~elementary-pantheon/granite/granite

Proposed by Tom Beckmann
Status: Rejected
Rejected by: kay van der Zander
Proposed branch: lp:~tombeckmann/granite/decoratedwindow-dialog
Merge into: lp:~elementary-pantheon/granite/granite
Diff against target: 78 lines (+12/-6)
3 files modified
demo/main.vala (+1/-3)
lib/Widgets/CompositedWindow.vala (+1/-1)
lib/Widgets/DecoratedWindow.vala (+10/-2)
To merge this branch: bzr merge lp:~tombeckmann/granite/decoratedwindow-dialog
Reviewer Review Type Date Requested Status
Cody Garver (community) Needs Fixing
Review via email: mp+143147@code.launchpad.net

Description of the change

Inherit from GtkDialog, so we get the escape closing and the wm knows what kind of window we actually got.

To post a comment you must log in.
Revision history for this message
Cody Garver (codygarver) wrote :

When I launched Noise and right clicked on a playlist to access a lightwindow everything froze.

review: Needs Fixing
Revision history for this message
Victor Martinez (victored) wrote :

Good call.

Diff line 63 is not needed, since Utils.set_theming will add the style class as well:
63 + this.get_style_context ().add_class (StyleClass.COMPOSITED);

Since this change implies an API/ABI break, you could post-pone the merge until Luna is released.

Revision history for this message
Rico Tzschichholz (ricotz) wrote :

If I got this right then just set the type_hint to DIALOG and move the Escape-Key handling from LightWindow up to DecoratedWindow which will accomplish that without breaking things.

Unmerged revisions

518. By Tom Beckmann

Remove tabs

517. By Tom Beckmann

decoratedwindow: inherited from GtkDialog to gain the close-on-escape and help the wm

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'demo/main.vala'
--- demo/main.vala 2012-11-30 18:06:35 +0000
+++ demo/main.vala 2013-01-14 17:09:26 +0000
@@ -343,7 +343,7 @@
343 }343 }
344344
345 private void show_light_window () {345 private void show_light_window () {
346 var light_window = new Granite.Widgets.LightWindow ();346 var light_window = new Granite.Widgets.LightWindow ("Properties");
347 347
348 var light_window_notebook = new Granite.Widgets.StaticNotebook ();348 var light_window_notebook = new Granite.Widgets.StaticNotebook ();
349 var entry = new Gtk.Entry ();349 var entry = new Gtk.Entry ();
@@ -385,8 +385,6 @@
385 open_drop.append ("audience", "Audience");385 open_drop.append ("audience", "Audience");
386 open_drop.active = 0;386 open_drop.active = 0;
387 grid.margin = 12;387 grid.margin = 12;
388 grid.margin_top = 24;
389 grid.margin_bottom = 24;
390 entry.text = "Cool Hand Luke";388 entry.text = "Cool Hand Luke";
391 general.column_spacing = 6;389 general.column_spacing = 6;
392 general.row_spacing = 6;390 general.row_spacing = 6;
393391
=== modified file 'lib/Widgets/CompositedWindow.vala'
--- lib/Widgets/CompositedWindow.vala 2012-12-21 00:46:56 +0000
+++ lib/Widgets/CompositedWindow.vala 2013-01-14 17:09:26 +0000
@@ -25,7 +25,7 @@
25 */25 */
26 public class CompositedWindow : Gtk.Window, Gtk.Buildable {26 public class CompositedWindow : Gtk.Window, Gtk.Buildable {
2727
28 private const string STYLESHEET =28 internal static const string STYLESHEET =
29 ".composited { background-color: rgba (0,0,0,0); }";29 ".composited { background-color: rgba (0,0,0,0); }";
3030
31 construct {31 construct {
3232
=== modified file 'lib/Widgets/DecoratedWindow.vala'
--- lib/Widgets/DecoratedWindow.vala 2012-12-21 00:46:56 +0000
+++ lib/Widgets/DecoratedWindow.vala 2013-01-14 17:09:26 +0000
@@ -25,7 +25,7 @@
25 /**25 /**
26 * This class is a standard decorated window.26 * This class is a standard decorated window.
27 */27 */
28 public class DecoratedWindow : CompositedWindow {28 public class DecoratedWindow : Gtk.Dialog {
2929
30 const string DECORATED_WINDOW_FALLBACK_STYLESHEET = """30 const string DECORATED_WINDOW_FALLBACK_STYLESHEET = """
31 .decorated-window {31 .decorated-window {
@@ -90,6 +90,9 @@
90 * @param content_style style to set content to90 * @param content_style style to set content to
91 */91 */
92 public DecoratedWindow (string title = "", string? window_style = null, string? content_style = null) {92 public DecoratedWindow (string title = "", string? window_style = null, string? content_style = null) {
93 this.app_paintable = true;
94 this.set_visual (Gdk.Screen.get_default ().get_rgba_visual ());
95 this.decorated = false;
93 this.resizable = false;96 this.resizable = false;
94 this.has_resize_grip = false;97 this.has_resize_grip = false;
95 this.window_position = Gtk.WindowPosition.CENTER_ON_PARENT;98 this.window_position = Gtk.WindowPosition.CENTER_ON_PARENT;
@@ -124,6 +127,11 @@
124127
125 this.draw_ref = new Gtk.Window ();128 this.draw_ref = new Gtk.Window ();
126129
130 // make our window transparent
131 this.get_style_context ().add_class (StyleClass.COMPOSITED);
132 Utils.set_theming (this, CompositedWindow.STYLESHEET, StyleClass.COMPOSITED,
133 Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
134
127 // set theming135 // set theming
128 set_default_theming (this.draw_ref);136 set_default_theming (this.draw_ref);
129137
@@ -135,7 +143,7 @@
135 this.box.get_style_context ().add_class (content_style);143 this.box.get_style_context ().add_class (content_style);
136144
137 this.box.pack_start (this._title, false);145 this.box.pack_start (this._title, false);
138 base.add (this.box);146 get_content_area ().add (this.box);
139147
140 this.add_events (Gdk.EventMask.BUTTON_PRESS_MASK | Gdk.EventMask.POINTER_MOTION_MASK);148 this.add_events (Gdk.EventMask.BUTTON_PRESS_MASK | Gdk.EventMask.POINTER_MOTION_MASK);
141 this.motion_notify_event.connect (on_motion_notify);149 this.motion_notify_event.connect (on_motion_notify);

Subscribers

People subscribed via source and target branches