[gnome-shell] altTab: Scale thumbnails by the scale factor



commit 3b7593ed7f4649977a3d659cf4285ad972fe8c30
Author: Adel Gadllah <adel gadllah gmail com>
Date:   Sun Feb 16 10:13:26 2014 +0100

    altTab: Scale thumbnails by the scale factor
    
    Fixes their size on high dpi.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=705410

 js/ui/altTab.js |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/altTab.js b/js/ui/altTab.js
index 57db134..e318375 100644
--- a/js/ui/altTab.js
+++ b/js/ui/altTab.js
@@ -655,17 +655,19 @@ const ThumbnailList = new Lang.Class({
         totalPadding += this.actor.get_theme_node().get_horizontal_padding() + 
this.actor.get_theme_node().get_vertical_padding();
         let [labelMinHeight, labelNaturalHeight] = this._labels[0].get_preferred_height(-1);
         let spacing = this._items[0].child.get_theme_node().get_length('spacing');
+        let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
+        let thumbnailSize = THUMBNAIL_DEFAULT_SIZE * scaleFactor;
 
-        availHeight = Math.min(availHeight - labelNaturalHeight - totalPadding - spacing, 
THUMBNAIL_DEFAULT_SIZE);
+        availHeight = Math.min(availHeight - labelNaturalHeight - totalPadding - spacing, thumbnailSize);
         let binHeight = availHeight + this._items[0].get_theme_node().get_vertical_padding() + 
this.actor.get_theme_node().get_vertical_padding() - spacing;
-        binHeight = Math.min(THUMBNAIL_DEFAULT_SIZE, binHeight);
+        binHeight = Math.min(thumbnailSize, binHeight);
 
         for (let i = 0; i < this._thumbnailBins.length; i++) {
             let mutterWindow = this._windows[i].get_compositor_private();
             if (!mutterWindow)
                 continue;
 
-            let clone = _createWindowClone(mutterWindow, THUMBNAIL_DEFAULT_SIZE);
+            let clone = _createWindowClone(mutterWindow, thumbnailSize);
             this._thumbnailBins[i].set_height(binHeight);
             this._thumbnailBins[i].add_actor(clone);
             this._clones.push(clone);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]