[gnome-shell] Explicitly set the width and height for subicons' containers in folders
- From: Mario Sanchez Prada <msanchez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] Explicitly set the width and height for subicons' containers in folders
- Date: Fri, 11 Aug 2017 10:48:14 +0000 (UTC)
commit d903978937499a365d5d8586b83eb7323b21efd0
Author: Mario Sanchez Prada <mario endlessm com>
Date: Fri Aug 11 11:04:37 2017 +0200
Explicitly set the width and height for subicons' containers in folders
Otherwise the smaller icons will try to take too much space since the
texture rendering the icons will be scaled up on HiDPI displays according
to the scale factor, which will push the size of the StBin containing the
texture up, causing them to completely fill the folder's total space.
Explicitly setting the size of the StBin container in this case, in a
similar fashion to what we do when creating the empty placeholders (in
case where there are less than 4 apps in a folder), ensures that each
"cell" of the grid-like widget representing the folder does not take
too much space.
https://bugzilla.gnome.org/show_bug.cgi?id=786145
js/ui/appDisplay.js | 10 +++-------
1 files changed, 3 insertions(+), 7 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 1cb8303..428b3c0 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -1172,13 +1172,9 @@ var FolderView = new Lang.Class({
let numItems = this._allItems.length;
let rtl = icon.get_text_direction() == Clutter.TextDirection.RTL;
for (let i = 0; i < 4; i++) {
- let bin;
- if (i < numItems) {
- let texture = this._allItems[i].app.create_icon_texture(subSize);
- bin = new St.Bin({ child: texture });
- } else {
- bin = new St.Bin({ width: subSize, height: subSize });
- }
+ let bin = new St.Bin({ width: subSize, height: subSize });
+ if (i < numItems)
+ bin.child = this._allItems[i].app.create_icon_texture(subSize);
layout.attach(bin, rtl ? (i + 1) % 2 : i % 2, Math.floor(i / 2), 1, 1);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]