[gnome-shell/gnome-3-38] iconGrid/iconGrid: Hook page-padding with CSS
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gnome-3-38] iconGrid/iconGrid: Hook page-padding with CSS
- Date: Wed, 2 Dec 2020 23:03:51 +0000 (UTC)
commit 541eaf59f22dcb8561cc7f5829883c848512c00c
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Wed Nov 25 18:42:03 2020 -0300
iconGrid/iconGrid: Hook page-padding with CSS
Add support for setting the page padding of the icon grid
through CSS. Unfortunately, each side needs to be specificied
manually, since it's not a regular padding property.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1510>
(cherry picked from commit 4ad32ab66260e5a3547895a05723cf58e459d299)
js/ui/iconGrid.js | 7 +++++++
1 file changed, 7 insertions(+)
---
diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js
index f5da881d64..e88c7faa91 100644
--- a/js/ui/iconGrid.js
+++ b/js/ui/iconGrid.js
@@ -1303,6 +1303,7 @@ var IconGrid = GObject.registerClass({
columns_per_page: 6,
rows_per_page: 4,
page_halign: Clutter.ActorAlign.CENTER,
+ page_padding: new Clutter.Margin(),
page_valign: Clutter.ActorAlign.CENTER,
last_row_align: Clutter.ActorAlign.START,
column_spacing: 0,
@@ -1434,6 +1435,12 @@ var IconGrid = GObject.registerClass({
[found, value] = node.lookup_length('max-row-spacing', false);
this.layout_manager.max_row_spacing = found ? value : -1;
+
+ const padding = new Clutter.Margin();
+ ['top', 'right', 'bottom', 'left'].forEach(side => {
+ padding[side] = node.get_length(`page-padding-${side}`);
+ });
+ this.layout_manager.page_padding = padding;
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]