[sushi] mainwindow: don't position the window manually, but use CENTER
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sushi] mainwindow: don't position the window manually, but use CENTER
- Date: Thu, 19 May 2011 06:04:08 +0000 (UTC)
commit 2466dc7bca2fe224090bc8545d716c446f73ea11
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Thu May 19 02:03:25 2011 -0400
mainwindow: don't position the window manually, but use CENTER
src/js/ui/mainWindow.js | 20 ++++----------------
1 files changed, 4 insertions(+), 16 deletions(-)
---
diff --git a/src/js/ui/mainWindow.js b/src/js/ui/mainWindow.js
index 4f65175..d5a95f6 100644
--- a/src/js/ui/mainWindow.js
+++ b/src/js/ui/mainWindow.js
@@ -43,14 +43,15 @@ MainWindow.prototype = {
decorated: false,
hasResizeGrip: false,
skipPagerHint: true,
- skipTaskbarHint: true });
+ skipTaskbarHint: true,
+ windowPosition: Gtk.WindowPosition.CENTER,
+ gravity: Gdk.Gravity.CENTER });
let screen = Gdk.Screen.get_default();
this._gtkWindow.set_visual(screen.get_rgba_visual());
this._gtkWindow.connect("delete-event",
Lang.bind(this, this._onWindowDeleteEvent));
- this._gtkWindow.set_gravity(Gdk.Gravity.CENTER);
},
_createClutterEmbed : function() {
@@ -558,17 +559,6 @@ MainWindow.prototype = {
/**************************************************************************
*********************** Window move/fade helpers *************************
**************************************************************************/
- _moveWindow : function() {
- let screen = this._gtkWindow.get_screen();
- let monitor = screen.get_monitor_at_window(this._parent);
- let geometry = screen.get_monitor_geometry(monitor);
- let windowSize = this._getWindowSize();
-
- this._gtkWindow.resize(windowSize[0], windowSize[1]);
- this._gtkWindow.move(geometry.x + ((geometry.width - windowSize[0]) / 2),
- geometry.y + ((geometry.height - windowSize[1]) / 2));
- },
-
_fadeInWindow : function() {
this._mainGroup.set_opacity(0);
this._titleGroup.set_opacity(0);
@@ -640,10 +630,8 @@ MainWindow.prototype = {
this._createToolbar();
this._createTitle();
- if (!this._gtkWindow.get_visible()) {
- this._moveWindow();
+ if (!this._gtkWindow.get_visible())
this._fadeInWindow();
- }
},
setTitle : function(label) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]