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
This commit is contained in:
Mario Sanchez Prada 2017-08-11 11:04:37 +02:00
parent b8eeac6fcf
commit d903978937

View File

@ -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);
}