[sushi] Revert "all: fix underallocations for "floating" widgets"
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sushi] Revert "all: fix underallocations for "floating" widgets"
- Date: Mon, 25 Jul 2011 10:53:55 +0000 (UTC)
commit 1e8a60965677b5b9b3999a3d8c8d6c8e8228bc77
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Mon Jul 25 12:48:22 2011 +0200
Revert "all: fix underallocations for "floating" widgets"
This reverts commit 988737b4850130cbadd309519ea6531053c6b4f7.
src/js/ui/mainWindow.js | 7 ++-----
src/js/ui/utils.js | 8 --------
src/js/viewers/audio.js | 17 ++++++++---------
src/js/viewers/evince.js | 7 +++----
src/js/viewers/gst.js | 16 ++++++++--------
src/js/viewers/html.js | 7 +++----
src/js/viewers/image.js | 7 +++----
7 files changed, 27 insertions(+), 42 deletions(-)
---
diff --git a/src/js/ui/mainWindow.js b/src/js/ui/mainWindow.js
index 66b8aed..0970ebb 100644
--- a/src/js/ui/mainWindow.js
+++ b/src/js/ui/mainWindow.js
@@ -557,7 +557,7 @@ MainWindow.prototype = {
this._titleLabel.get_style_context().add_class("np-decoration");
this._titleLabel.show();
- this._titleActor = Utils.forcedSizeActor(this._titleLabel);
+ this._titleActor = new GtkClutter.Actor({ contents: this._titleLabel });
this._titleActor.add_constraint(
new Clutter.AlignConstraint({ source: this._stage,
factor: 0.5 }));
@@ -576,7 +576,7 @@ MainWindow.prototype = {
Lang.bind(this,
this._clearAndQuit));
- this._quitActor = Utils.forcedSizeActor(this._quitButton);
+ this._quitActor = new GtkClutter.Actor({ contents: this._quitButton });
this._quitActor.set_reactive(true);
this._quitActor.add_constraint(
new Clutter.AlignConstraint({ source: this._stage,
@@ -657,9 +657,6 @@ MainWindow.prototype = {
setTitle : function(label) {
this._titleLabel.set_label(label);
-
- //FIXME: why is this needed?
- this._titleActor.set_size(this._titleLabel.get_preferred_width()[1], this._titleLabel.get_preferred_height()[1]);
},
refreshSize : function() {
diff --git a/src/js/ui/utils.js b/src/js/ui/utils.js
index e89f73c..d4deec6 100644
--- a/src/js/ui/utils.js
+++ b/src/js/ui/utils.js
@@ -29,14 +29,6 @@ let Constants = imports.util.constants;
let slowDownFactor = 0;
-// FIXME: why is this needed?
-function forcedSizeActor(widget) {
- let actor = new GtkClutter.Actor({ contents: widget });
- actor.set_size(widget.get_preferred_width()[1], widget.get_preferred_height()[1]);
-
- return actor;
-}
-
function setSlowDownFactor(factor) {
slowDownFactor = factor;
}
diff --git a/src/js/viewers/audio.js b/src/js/viewers/audio.js
index 3af90b1..421fa8d 100644
--- a/src/js/viewers/audio.js
+++ b/src/js/viewers/audio.js
@@ -248,6 +248,14 @@ AudioRenderer.prototype = {
this._mainToolbar = new Gtk.Toolbar();
this._mainToolbar.get_style_context().add_class("np-toolbar");
this._mainToolbar.set_icon_size(Gtk.IconSize.MENU);
+ this._mainToolbar.show();
+
+ this._toolbarActor = new GtkClutter.Actor({ contents: this._mainToolbar,
+ opacity: 0});
+ this._toolbarActor.add_constraint(
+ new Clutter.BindConstraint({ source: this._actor,
+ coordinate: Clutter.BindCoordinate.WIDTH,
+ offset: -50 }));
this._toolbarPlay = new Gtk.ToolButton({ "icon-name": "media-playback-pause-symbolic" });
this._toolbarPlay.show();
@@ -289,15 +297,6 @@ AudioRenderer.prototype = {
item.show_all();
this._mainToolbar.insert(item, 3);
- this._mainToolbar.show();
-
- this._toolbarActor = Utils.forcedSizeActor(this._mainToolbar);
- this._toolbarActor.add_constraint(
- new Clutter.BindConstraint({ source: this._actor,
- coordinate: Clutter.BindCoordinate.WIDTH,
- offset: -50 }));
-
-
return this._toolbarActor;
},
}
diff --git a/src/js/viewers/evince.js b/src/js/viewers/evince.js
index 3085920..3d4acf6 100644
--- a/src/js/viewers/evince.js
+++ b/src/js/viewers/evince.js
@@ -126,6 +126,9 @@ EvinceRenderer.prototype = {
this._mainToolbar = new Gtk.Toolbar({ "icon-size": Gtk.IconSize.MENU });
this._mainToolbar.get_style_context().add_class("np-toolbar");
this._mainToolbar.set_show_arrow(false);
+ this._mainToolbar.show();
+
+ this._toolbarActor = new GtkClutter.Actor({ contents: this._mainToolbar });
this._toolbarZoom = Utils.createFullScreenButton(this._mainWindow);
this._mainToolbar.insert(this._toolbarZoom, 0);
@@ -159,10 +162,6 @@ EvinceRenderer.prototype = {
this._updatePageLabel();
- this._mainToolbar.show();
-
- this._toolbarActor = Utils.forcedSizeActor(this._mainToolbar);
-
return this._toolbarActor;
},
diff --git a/src/js/viewers/gst.js b/src/js/viewers/gst.js
index 22b9f2e..ba2c595 100644
--- a/src/js/viewers/gst.js
+++ b/src/js/viewers/gst.js
@@ -143,6 +143,14 @@ GstRenderer.prototype = {
createToolbar : function () {
this._mainToolbar = new Gtk.Toolbar({ "icon-size": Gtk.IconSize.MENU });
this._mainToolbar.get_style_context().add_class("np-toolbar");
+ this._mainToolbar.show();
+
+ this._toolbarActor = new GtkClutter.Actor({ contents: this._mainToolbar,
+ opacity: 0 });
+ this._toolbarActor.add_constraint(
+ new Clutter.BindConstraint({ source: this._video,
+ coordinate: Clutter.BindCoordinate.WIDTH,
+ offset: -50 }));
this._toolbarPlay = new Gtk.ToolButton({ "icon-name": "media-playback-pause-symbolic" });
this._toolbarPlay.show();
@@ -188,14 +196,6 @@ GstRenderer.prototype = {
this._toolbarZoom = Utils.createFullScreenButton(this._mainWindow);
this._mainToolbar.insert(this._toolbarZoom, 4);
- this._mainToolbar.show();
-
- this._toolbarActor = Utils.forcedSizeActor(this._mainToolbar);
- this._toolbarActor.add_constraint(
- new Clutter.BindConstraint({ source: this._video,
- coordinate: Clutter.BindCoordinate.WIDTH,
- offset: -50 }));
-
return this._toolbarActor;
},
diff --git a/src/js/viewers/html.js b/src/js/viewers/html.js
index f507d59..71c5bdd 100644
--- a/src/js/viewers/html.js
+++ b/src/js/viewers/html.js
@@ -79,6 +79,9 @@ HTMLRenderer.prototype = {
this._mainToolbar = new Gtk.Toolbar({ "icon-size": Gtk.IconSize.MENU });
this._mainToolbar.get_style_context().add_class("np-toolbar");
this._mainToolbar.set_show_arrow(false);
+ this._mainToolbar.show();
+
+ this._toolbarActor = new GtkClutter.Actor({ contents: this._mainToolbar });
this._toolbarZoom = Utils.createFullScreenButton(this._mainWindow);
this._mainToolbar.insert(this._toolbarZoom, 0);
@@ -90,10 +93,6 @@ HTMLRenderer.prototype = {
this._toolbarRun = Utils.createOpenButton(this._file, this._mainWindow);
this._mainToolbar.insert(this._toolbarRun, 2);
- this._mainToolbar.show();
-
- this._toolbarActor = Utils.forcedSizeActor(this._mainToolbar);
-
return this._toolbarActor;
}
}
diff --git a/src/js/viewers/image.js b/src/js/viewers/image.js
index 19d2a1f..5526d83 100644
--- a/src/js/viewers/image.js
+++ b/src/js/viewers/image.js
@@ -103,14 +103,13 @@ ImageRenderer.prototype = {
this._mainToolbar = new Gtk.Toolbar({ "icon-size": Gtk.IconSize.MENU });
this._mainToolbar.get_style_context().add_class("np-toolbar");
this._mainToolbar.set_show_arrow(false);
+ this._mainToolbar.show();
+
+ this._toolbarActor = new GtkClutter.Actor({ contents: this._mainToolbar });
this._toolbarZoom = Utils.createFullScreenButton(this._mainWindow);
this._mainToolbar.insert(this._toolbarZoom, 0);
- this._mainToolbar.show();
-
- this._toolbarActor = Utils.forcedSizeActor(this._mainToolbar);
-
return this._toolbarActor;
},
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]