[gnome-shell-extensions/window-list: 8/13] window-list: Shrink window buttons if running out of space
- From: Florian MÃllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell-extensions/window-list: 8/13] window-list: Shrink window buttons if running out of space
- Date: Fri, 25 Jan 2013 14:25:33 +0000 (UTC)
commit db1cecdd798a28619bcca940510cd1464d9ee2f4
Author: Florian MÃllner <fmuellner gnome org>
Date: Wed Jan 23 21:04:52 2013 +0100
window-list: Shrink window buttons if running out of space
extensions/window-list/extension.js | 16 +++++++++++-----
extensions/window-list/stylesheet.css | 2 +-
2 files changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/extensions/window-list/extension.js b/extensions/window-list/extension.js
index fad4e1b..5a00009 100644
--- a/extensions/window-list/extension.js
+++ b/extensions/window-list/extension.js
@@ -26,6 +26,7 @@ const WindowButton = new Lang.Class({
let box = new St.BoxLayout();
this.actor = new St.Button({ style_class: 'window-button',
+ x_fill: true,
child: box });
this.actor._delegate = this;
@@ -185,10 +186,12 @@ const WindowList = new Lang.Class({
layout_manager: new Clutter.BinLayout()});
this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
- this._windowList = new St.BoxLayout({ style_class: 'window-list',
- x_align: Clutter.ActorAlign.START,
- x_expand: true,
- y_expand: true });
+ let layout = new Clutter.BoxLayout({ homogeneous: true });
+ this._windowList = new St.Widget({ style_class: 'window-list',
+ layout_manager: layout,
+ x_align: Clutter.ActorAlign.START,
+ x_expand: true,
+ y_expand: true });
this.actor.add_actor(this._windowList);
this._trayButton = new TrayButton();
@@ -252,7 +255,10 @@ const WindowList = new Lang.Class({
return;
let button = new WindowButton(win);
- this._windowList.add(button.actor, { y_fill: true });
+ this._windowList.layout_manager.pack(button.actor,
+ true, true, true,
+ Clutter.BoxAlignment.START,
+ Clutter.BoxAlignment.START);
},
_onWindowRemoved: function(ws, win) {
diff --git a/extensions/window-list/stylesheet.css b/extensions/window-list/stylesheet.css
index 8802778..ba9824e 100644
--- a/extensions/window-list/stylesheet.css
+++ b/extensions/window-list/stylesheet.css
@@ -23,7 +23,7 @@
}
.window-button > StWidget {
- width: 250px;
+ max-width: 250px;
color: #bbb;
background-color: black;
border-radius: 4px;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]