From 98f3ef2689de06e8ab8b46a91acfa7dd2056a3a6 Mon Sep 17 00:00:00 2001 From: Alessandro Ghedini Date: Mon, 5 Mar 2012 12:19:59 +0100 Subject: Imported Upstream version 0.5.1 --- src/renderers/pieWindow.vala | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/renderers/pieWindow.vala') 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 @@ -192,6 +192,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) { -- cgit v1.2.3