[gnome-shell/wip/paging-release: 13/74] Spacing dynamic without hanging, using Clutter.BoxLayout instead of St.BoxLayout, since the last has
- From: Carlos Soriano <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/paging-release: 13/74] Spacing dynamic without hanging, using Clutter.BoxLayout instead of St.BoxLayout, since the last has
- Date: Mon, 12 Aug 2013 21:11:19 +0000 (UTC)
commit 42ceaca657b65611c1517c1770efb4157df924ac
Author: Carlos Soriano <carlos soriano89 gmail com>
Date: Thu Jul 4 19:49:03 2013 +0200
Spacing dynamic without hanging, using Clutter.BoxLayout instead of
St.BoxLayout, since the last has some bug overriding the allocate
function
js/ui/appDisplay.js | 31 +++++++++++++++++++++----------
js/ui/iconGrid.js | 3 ---
2 files changed, 21 insertions(+), 13 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index f91dc8e..bd45067 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -807,14 +807,18 @@ const ControlsBoxLayout = Lang.Class({
const AppDisplayActor = new Lang.Class({
Name: 'AppDisplayActor',
- Extends: St.BoxLayout,
+ Extends: Clutter.BoxLayout,
- vfunc_allocate: function (box, flags) {
+ vfunc_allocate: function (actor, box, flags) {
+ global.log("####~~~~~~~~~~~~~#######");
let availWidth = box.x2 - box.x1;
- global.log("Signal to emit " + availWidth);
+ let availheight = box.y2 - box.y1;
+ global.log("Signal to emit " + [availWidth, availheight]);
this.emit('allocated-width-changed', availWidth);
- global.log("Signal emitted " + availWidth);
- this.parent(box, flags);
+ global.log("Signal emitted " + [availWidth, availheight]);
+ this.parent(actor, box, flags);
+ global.log("ALLOATED " + [availWidth, availheight]);
+ global.log("####*****************#######");
}
});
Signals.addSignalMethods(AppDisplayActor.prototype);
@@ -854,14 +858,16 @@ const AppDisplay = new Lang.Class({
x_expand: true });
this._views[Views.ALL] = { 'view': view, 'control': button };
- this.actor = new AppDisplayActor({ style_class: 'app-display',
- vertical: true,
+ this.actor = new St.Widget({ style_class: 'app-display',
x_expand: true, y_expand: true });
- this.actor.connect('allocated-width-changed', Lang.bind(this, this._updateViewsSpacing));
+ this._actorLayout = new AppDisplayActor({vertical: true});
+ this.actor.set_layout_manager(this._actorLayout);
+ this._actorLayout.connect('allocated-width-changed', Lang.bind(this, this._updateViewsSpacing));
this._viewStack = new St.Widget({ layout_manager: new Clutter.BinLayout(),
x_expand: true, y_expand: true });
- this.actor.add(this._viewStack, { expand: true });
+ //FIXME
+ this.actor.add_actor(this._viewStack, { expand: true });
let layout = new ControlsBoxLayout({ homogeneous: true });
this._controls = new St.Widget({ style_class: 'app-view-controls',
@@ -869,7 +875,6 @@ const AppDisplay = new Lang.Class({
layout.hookup_style(this._controls);
this.actor.add_actor(new St.Bin({ child: this._controls }));
-
for (let i = 0; i < this._views.length; i++) {
this._viewStack.add_actor(this._views[i].view.actor);
this._controls.add_actor(this._views[i].control);
@@ -889,8 +894,14 @@ const AppDisplay = new Lang.Class({
this._focusDummy = new St.Bin({ can_focus: true });
this._viewStack.add_actor(this._focusDummy);
+ /*for (let i = 0; i < this._views.length; i++) {
+ this._views[i].view.updateSpacing(1920);
+ }*/
+
+
this._allAppsWorkId = Main.initializeDeferredWork(this.actor, Lang.bind(this,
this._redisplayAllApps));
this._frequentAppsWorkId = Main.initializeDeferredWork(this.actor, Lang.bind(this,
this._redisplayFrequentApps));
+
},
_showView: function(activeIndex) {
diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js
index 99196db..98e99b6 100644
--- a/js/ui/iconGrid.js
+++ b/js/ui/iconGrid.js
@@ -483,14 +483,11 @@ const IconGrid = new Lang.Class({
},
setSpacing: function(spacing) {
- if(this._fixedSpacing != spacing) {
this._fixedSpacing = spacing;
/*Meta.later_add(Meta.LaterType.BEFORE_REDRAW, Lang.bind(this, function() {
this._grid.queue_relayout();
return false;
}));*/
- }
-
},
getSpacing: function() {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]