diff options
author | Alessandro Ghedini <al3xbio@gmail.com> | 2012-03-05 12:19:59 +0100 |
---|---|---|
committer | Alessandro Ghedini <al3xbio@gmail.com> | 2012-03-05 12:19:59 +0100 |
commit | 98f3ef2689de06e8ab8b46a91acfa7dd2056a3a6 (patch) | |
tree | b98e438ac1082925e12af6dfec6d9ebeb4e3035e /src/renderers/pieWindow.vala | |
parent | a824c3e5bdab686901b02667609282e7d596a6af (diff) |
Imported Upstream version 0.5.1
Diffstat (limited to 'src/renderers/pieWindow.vala')
-rw-r--r-- | src/renderers/pieWindow.vala | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/renderers/pieWindow.vala b/src/renderers/pieWindow.vala index 54dd691..852a739 100644 --- a/src/renderers/pieWindow.vala +++ b/src/renderers/pieWindow.vala @@ -193,6 +193,28 @@ public class PieWindow : Gtk.Window { } ///////////////////////////////////////////////////////////////////// + /// Opens the window at a given location. + ///////////////////////////////////////////////////////////////////// + + public void open_at(int at_x, int at_y) { + this.open(); + this.move(at_x-this.width_request/2, at_y-this.height_request/2); + } + + ///////////////////////////////////////////////////////////////////// + /// Gets the center position of the window. + ///////////////////////////////////////////////////////////////////// + + public void get_center_pos(out int out_x, out int out_y) { + int x=0, y=0, width=0, height=0; + this.get_position(out x, out y); + this.get_size(out width, out height); + + out_x = x + width/2; + out_y = y + height/2; + } + + ///////////////////////////////////////////////////////////////////// /// Draw the Pie. ///////////////////////////////////////////////////////////////////// @@ -303,6 +325,7 @@ public class PieWindow : Gtk.Window { else if (key >= 65 && key <= 90) index = (int)key - 55; if (index >= 0 && index < this.renderer.slice_count()) { + this.renderer.key_board_control = true; this.renderer.set_highlighted_slice(index); if (this.renderer.active_slice == index) { |