[gnome-shell-extensions/wip/window-list: 8/13] window-list: Shrink window buttons if running out of space



commit 380211356665c32e32f7160c578a808c52eb4374
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 ee06dd7..6798394 100644
--- a/extensions/window-list/extension.js
+++ b/extensions/window-list/extension.js
@@ -15,6 +15,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;
 
@@ -177,10 +178,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();
@@ -244,7 +247,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]