folderView: Center folder icon

The FolderView class is responsible for creating the 4-item
grid of the folder icon, with the preview of the first four
apps inside the folder.

However, with the deprecation of StAlign as child properties,
the folder icon stopped being horizontally centralized.

Center the folder icon horizontally again.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/817
This commit is contained in:
Georges Basile Stavracas Neto 2019-11-11 18:07:19 -03:00
parent 61210fdae1
commit 913990b9ea

View File

@ -1305,8 +1305,11 @@ class FolderView extends BaseAppView {
createFolderIcon(size) { createFolderIcon(size) {
let layout = new Clutter.GridLayout(); let layout = new Clutter.GridLayout();
let icon = new St.Widget({ layout_manager: layout, let icon = new St.Widget({
style_class: 'app-folder-icon' }); layout_manager: layout,
style_class: 'app-folder-icon',
x_align: Clutter.ActorAlign.CENTER,
});
layout.hookup_style(icon); layout.hookup_style(icon);
let subSize = Math.floor(FOLDER_SUBICON_FRACTION * size); let subSize = Math.floor(FOLDER_SUBICON_FRACTION * size);
let scale = St.ThemeContext.get_for_stage(global.stage).scale_factor; let scale = St.ThemeContext.get_for_stage(global.stage).scale_factor;