[gnome-shell/gnome-3-38] Revert "iconGrid/iconGridLayout: Add support for page-padding"
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gnome-3-38] Revert "iconGrid/iconGridLayout: Add support for page-padding"
- Date: Wed, 16 Dec 2020 22:48:15 +0000 (UTC)
commit f63812b0dc63e5c55120132ee099ed806cba3b1e
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Wed Dec 16 21:46:12 2020 +0100
Revert "iconGrid/iconGridLayout: Add support for page-padding"
This reverts commit 72e2732bb695dda41ec138a99114d767e9543423.
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1541
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1541>
js/ui/iconGrid.js | 61 +++++++++++++++----------------------------------------
1 file changed, 16 insertions(+), 45 deletions(-)
---
diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js
index e9343046ea..da33eb6536 100644
--- a/js/ui/iconGrid.js
+++ b/js/ui/iconGrid.js
@@ -295,10 +295,6 @@ var IconGridLayout = GObject.registerClass({
GObject.ParamFlags.READWRITE,
Clutter.ActorAlign.$gtype,
Clutter.ActorAlign.FILL),
- 'page-padding': GObject.ParamSpec.boxed('page-padding',
- 'Page padding', 'Page padding',
- GObject.ParamFlags.READWRITE,
- Clutter.Margin.$gtype),
'page-valign': GObject.ParamSpec.enum('page-valign',
'Vertical page align',
'Vertical page align',
@@ -329,7 +325,6 @@ var IconGridLayout = GObject.registerClass({
max_row_spacing: -1,
orientation: Clutter.Orientation.VERTICAL,
page_halign: Clutter.ActorAlign.FILL,
- page_padding: new Clutter.Margin(),
page_valign: Clutter.ActorAlign.FILL,
row_spacing: 0,
rows_per_page: 4,
@@ -344,7 +339,6 @@ var IconGridLayout = GObject.registerClass({
this._maxRowSpacing = params.max_row_spacing;
this._orientation = params.orientation;
this._pageHAlign = params.page_halign;
- this._pagePadding = params.page_padding;
this._pageVAlign = params.page_valign;
this._rowSpacing = params.row_spacing;
this._rowsPerPage = params.rows_per_page;
@@ -421,11 +415,9 @@ var IconGridLayout = GObject.registerClass({
}
const emptyHSpace =
- this._pageWidth - usedWidth - columnSpacingPerPage -
- this._pagePadding.left - this._pagePadding.right;
+ this._pageWidth - usedWidth - columnSpacingPerPage;
const emptyVSpace =
- this._pageHeight - usedHeight - rowSpacingPerPage -
- this._pagePadding.top - this._pagePadding.bottom;
+ this._pageHeight - usedHeight - rowSpacingPerPage;
if (emptyHSpace >= 0 && emptyVSpace > 0)
return size;
@@ -594,30 +586,28 @@ var IconGridLayout = GObject.registerClass({
const columnSpacingPerPage = this._columnSpacing * (nColumns - 1);
const rowSpacingPerPage = this._rowSpacing * (nRows - 1);
- const emptyHSpace =
- this._pageWidth - usedWidth - columnSpacingPerPage -
- this._pagePadding.left - this._pagePadding.right;
- const emptyVSpace =
- this._pageHeight - usedHeight - rowSpacingPerPage -
- this._pagePadding.top - this._pagePadding.bottom;
- let leftEmptySpace = this._pagePadding.left;
- let topEmptySpace = this._pagePadding.top;
+ let emptyHSpace = this._pageWidth - usedWidth - columnSpacingPerPage;
+ let emptyVSpace = this._pageHeight - usedHeight - rowSpacingPerPage;
+ let leftEmptySpace;
+ let topEmptySpace;
let hSpacing;
let vSpacing;
switch (this._pageHAlign) {
case Clutter.ActorAlign.START:
+ leftEmptySpace = 0;
hSpacing = this._columnSpacing;
break;
case Clutter.ActorAlign.CENTER:
- leftEmptySpace += Math.floor(emptyHSpace / 2);
+ leftEmptySpace = Math.floor(emptyHSpace / 2);
hSpacing = this._columnSpacing;
break;
case Clutter.ActorAlign.END:
- leftEmptySpace += emptyHSpace;
+ leftEmptySpace = emptyHSpace;
hSpacing = this._columnSpacing;
break;
case Clutter.ActorAlign.FILL:
+ leftEmptySpace = 0;
hSpacing = this._columnSpacing + emptyHSpace / (nColumns - 1);
// Maybe constraint horizontal spacing
@@ -626,7 +616,7 @@ var IconGridLayout = GObject.registerClass({
(this._maxColumnSpacing - this._columnSpacing) * (nColumns - 1);
hSpacing = this._maxColumnSpacing;
- leftEmptySpace +=
+ leftEmptySpace =
Math.max((emptyHSpace - extraHSpacing) / 2, 0);
}
break;
@@ -634,17 +624,19 @@ var IconGridLayout = GObject.registerClass({
switch (this._pageVAlign) {
case Clutter.ActorAlign.START:
+ topEmptySpace = 0;
vSpacing = this._rowSpacing;
break;
case Clutter.ActorAlign.CENTER:
- topEmptySpace += Math.floor(emptyVSpace / 2);
+ topEmptySpace = Math.floor(emptyVSpace / 2);
vSpacing = this._rowSpacing;
break;
case Clutter.ActorAlign.END:
- topEmptySpace += emptyVSpace;
+ topEmptySpace = emptyVSpace;
vSpacing = this._rowSpacing;
break;
case Clutter.ActorAlign.FILL:
+ topEmptySpace = 0;
vSpacing = this._rowSpacing + emptyVSpace / (nRows - 1);
// Maybe constraint vertical spacing
@@ -653,7 +645,7 @@ var IconGridLayout = GObject.registerClass({
(this._maxRowSpacing - this._rowSpacing) * (nRows - 1);
vSpacing = this._maxRowSpacing;
- topEmptySpace +=
+ topEmptySpace =
Math.max((emptyVSpace - extraVSpacing) / 2, 0);
}
@@ -1228,23 +1220,6 @@ var IconGridLayout = GObject.registerClass({
this.notify('page-halign');
}
- // eslint-disable-next-line camelcase
- get page_padding() {
- return this._pagePadding;
- }
-
- // eslint-disable-next-line camelcase
- set page_padding(padding) {
- if (this._pagePadding.top === padding.top &&
- this._pagePadding.right === padding.right &&
- this._pagePadding.bottom === padding.bottom &&
- this._pagePadding.left === padding.left)
- return;
-
- this._pagePadding = padding;
- this.notify('page-padding');
- }
-
// eslint-disable-next-line camelcase
get page_valign() {
return this._pageVAlign;
@@ -1412,10 +1387,6 @@ var IconGrid = GObject.registerClass({
}
_findBestModeForSize(width, height) {
- const { pagePadding } = this.layout_manager;
- width -= pagePadding.left + pagePadding.right;
- height -= pagePadding.top + pagePadding.bottom;
-
const sizeRatio = width / height;
let closestRatio = Infinity;
let bestMode = -1;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]