From e2a886ea322a5a3e4a3883ce6c8a16685128667f Mon Sep 17 00:00:00 2001
From: Simon Schampijer <simon@laptop.org>
Date: Fri, 26 Oct 2012 12:02:53 +0200
Subject: [PATCH shell] Move Wireless Key dialog to an upper screen position,
SL #4050
In ebook mode the dialog would be obscured by the OSK
otherwise.
The y position is style.GRID_CELL_SIZE below the toolbar. The x
value is centered based on the screen width. Using gtk-window-get-size
we know the size of the dialog before it is on screen to do the
calculation [1].
[1] http://developer.gnome.org/gtk3/3.4/GtkWindow.html#gtk-window-get-size
Signed-off-by: Simon Schampijer <simon@laptop.org>
---
src/jarabe/desktop/keydialog.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/jarabe/desktop/keydialog.py b/src/jarabe/desktop/keydialog.py
index a4c8e36..a66045f 100644
a
|
b
|
import hashlib |
19 | 19 | from gettext import gettext as _ |
20 | 20 | |
21 | 21 | from gi.repository import Gtk |
| 22 | from gi.repository import Gdk |
| 23 | |
22 | 24 | import dbus |
23 | 25 | |
24 | 26 | from sugar3.graphics.icon import Icon |
| 27 | from sugar3.graphics import style |
25 | 28 | |
26 | 29 | from jarabe.model import network |
27 | 30 | |
… |
… |
def create(ssid, flags, wpa_flags, rsn_flags, dev_caps, response): |
301 | 304 | |
302 | 305 | key_dialog.connect('response', _key_dialog_response_cb) |
303 | 306 | key_dialog.show_all() |
| 307 | width, height = key_dialog.get_size() |
| 308 | key_dialog.move(Gdk.Screen.width() / 2 - width / 2, |
| 309 | style.GRID_CELL_SIZE * 2) |
304 | 310 | |
305 | 311 | |
306 | 312 | def _key_dialog_response_cb(key_dialog, response_id): |