summaryrefslogtreecommitdiff
path: root/src/renderers/pieWindow.vala
diff options
context:
space:
mode:
Diffstat (limited to 'src/renderers/pieWindow.vala')
-rw-r--r--src/renderers/pieWindow.vala23
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) {