[gnome-software: 74/110] Use layout properties to set GtkGrid child position
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software: 74/110] Use layout properties to set GtkGrid child position
- Date: Tue, 5 Oct 2021 20:32:41 +0000 (UTC)
commit 2c8d0db6c35694bee58dde6bb0e6fad8d885bf4e
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Wed Aug 25 21:07:54 2021 -0300
Use layout properties to set GtkGrid child position
There is no packing in GTK4 anymore, and children of GtkGrid should
have their positions and sizes declared using layout properties. That
means this pattern:
<child>
<object class="...">
...
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
<property name="width">1</property>
<property name="height">3</property>
</packing>
</child>
becomes this:
<child>
<object class="...">
...
<layout>
<property name="column">1</property>
<property name="row">4</property>
<property name="column-span">1</property>
<property name="row-span">1</property>
</layout>
</object>
</child>
src/gs-app-tile.ui | 36 +++---
src/gs-basic-auth-dialog.ui | 60 ++++-----
src/gs-overview-page.ui | 16 +--
src/gs-repo-row.ui | 60 ++++-----
src/gs-review-histogram.ui | 288 ++++++++++++++++++++++----------------------
src/gs-summary-tile.ui | 24 ++--
6 files changed, 242 insertions(+), 242 deletions(-)
---
diff --git a/src/gs-app-tile.ui b/src/gs-app-tile.ui
index e7223c419..4121cf0fc 100644
--- a/src/gs-app-tile.ui
+++ b/src/gs-app-tile.ui
@@ -81,13 +81,13 @@
<style>
<class name="icon-dropshadow"/>
</style>
+ <layout>
+ <property name="column">0</property>
+ <property name="row">0</property>
+ <property name="column-span">1</property>
+ <property name="row-span">3</property>
+ </layout>
</object>
- <packing>
- <property name="left-attach">0</property>
- <property name="top-attach">0</property>
- <property name="width">1</property>
- <property name="height">3</property>
- </packing>
</child>
<child>
<object class="GtkLabel" id="name">
@@ -100,13 +100,13 @@
<style>
<class name="app-tile-label"/>
</style>
+ <layout>
+ <property name="column">1</property>
+ <property name="row">0</property>
+ <property name="column-span">1</property>
+ <property name="row-span">1</property>
+ </layout>
</object>
- <packing>
- <property name="left-attach">1</property>
- <property name="top-attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
</child>
<child>
<object class="GtkLabel" id="summary">
@@ -120,13 +120,13 @@
<style>
<class name="app-tile-label"/>
</style>
+ <layout>
+ <property name="column">1</property>
+ <property name="row">2</property>
+ <property name="column-span">1</property>
+ <property name="row-span">1</property>
+ </layout>
</object>
- <packing>
- <property name="left-attach">1</property>
- <property name="top-attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
</child>
</object>
</child>
diff --git a/src/gs-basic-auth-dialog.ui b/src/gs-basic-auth-dialog.ui
index 4f1d56d32..8487e56ac 100644
--- a/src/gs-basic-auth-dialog.ui
+++ b/src/gs-basic-auth-dialog.ui
@@ -86,13 +86,13 @@
<style>
<class name="dim-label"/>
</style>
+ <layout>
+ <property name="column">0</property>
+ <property name="row">0</property>
+ <property name="column-span">2</property>
+ <property name="row-span">1</property>
+ </layout>
</object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- <property name="width">2</property>
- <property name="height">1</property>
- </packing>
</child>
<child>
<object class="GtkLabel" id="user_label">
@@ -106,13 +106,13 @@
<style>
<class name="dim-label"/>
</style>
+ <layout>
+ <property name="column">0</property>
+ <property name="row">3</property>
+ <property name="column-span">1</property>
+ <property name="row-span">1</property>
+ </layout>
</object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">3</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
</child>
<child>
<object class="GtkLabel" id="password_label">
@@ -126,13 +126,13 @@
<style>
<class name="dim-label"/>
</style>
+ <layout>
+ <property name="column">0</property>
+ <property name="row">4</property>
+ <property name="column-span">1</property>
+ <property name="row-span">1</property>
+ </layout>
</object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">4</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
</child>
<child>
<object class="GtkEntry" id="user_entry">
@@ -146,13 +146,13 @@
<property name="input_purpose">password</property>
<signal name="changed" handler="dialog_validate" object="GsBasicAuthDialog" swapped="yes"/>
<signal name="activate" handler="dialog_validate" object="GsBasicAuthDialog" swapped="yes"/>
+ <layout>
+ <property name="column">1</property>
+ <property name="row">3</property>
+ <property name="column-span">1</property>
+ <property name="row-span">1</property>
+ </layout>
</object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">3</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
</child>
<child>
<object class="GtkEntry" id="password_entry">
@@ -166,13 +166,13 @@
<property name="input_purpose">password</property>
<signal name="changed" handler="dialog_validate" object="GsBasicAuthDialog" swapped="yes"/>
<signal name="activate" handler="dialog_validate" object="GsBasicAuthDialog" swapped="yes"/>
+ <layout>
+ <property name="column">1</property>
+ <property name="row">4</property>
+ <property name="column-span">1</property>
+ <property name="row-span">1</property>
+ </layout>
</object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">4</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
</child>
</object>
<packing>
diff --git a/src/gs-overview-page.ui b/src/gs-overview-page.ui
index dafe1f458..2c9d98433 100644
--- a/src/gs-overview-page.ui
+++ b/src/gs-overview-page.ui
@@ -229,11 +229,11 @@
<style>
<class name="dim-label"/>
</style>
+ <layout>
+ <property name="column">0</property>
+ <property name="row">0</property>
+ </layout>
</object>
- <packing>
- <property name="left-attach">0</property>
- <property name="top-attach">0</property>
- </packing>
</child>
<child>
<object class="GtkLabel" id="noappdata_label">
@@ -245,11 +245,11 @@
<attributes>
<attribute name="scale" value="1.4"/>
</attributes>
+ <layout>
+ <property name="column">1</property>
+ <property name="row">0</property>
+ </layout>
</object>
- <packing>
- <property name="left-attach">1</property>
- <property name="top-attach">0</property>
- </packing>
</child>
</object>
</property>
diff --git a/src/gs-repo-row.ui b/src/gs-repo-row.ui
index 5f65d6732..d18904dc5 100644
--- a/src/gs-repo-row.ui
+++ b/src/gs-repo-row.ui
@@ -19,13 +19,13 @@
<property name="hexpand">True</property>
<property name="ellipsize">end</property>
<property name="xalign">0</property>
+ <layout>
+ <property name="column">0</property>
+ <property name="row">0</property>
+ <property name="column-span">1</property>
+ <property name="row-span">1</property>
+ </layout>
</object>
- <packing>
- <property name="left-attach">0</property>
- <property name="top-attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
</child>
<child>
<object class="GtkLabel" id="hostname_label">
@@ -37,13 +37,13 @@
<attributes>
<attribute name="scale" value="0.8"/>
</attributes>
+ <layout>
+ <property name="column">0</property>
+ <property name="row">1</property>
+ <property name="column-span">1</property>
+ <property name="row-span">1</property>
+ </layout>
</object>
- <packing>
- <property name="left-attach">0</property>
- <property name="top-attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
</child>
<child>
<object class="GtkLabel" id="comment_label">
@@ -60,13 +60,13 @@
<style>
<class name="dim-label"/>
</style>
+ <layout>
+ <property name="column">0</property>
+ <property name="row">2</property>
+ <property name="column-span">1</property>
+ <property name="row-span">1</property>
+ </layout>
</object>
- <packing>
- <property name="left-attach">0</property>
- <property name="top-attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
</child>
<child>
<object class="GtkButton" id="remove_button">
@@ -76,13 +76,13 @@
<property name="valign">center</property>
<property name="hexpand">False</property>
<property name="always-show-image">True</property>
+ <layout>
+ <property name="column">1</property>
+ <property name="row">0</property>
+ <property name="column-span">1</property>
+ <property name="row-span">3</property>
+ </layout>
</object>
- <packing>
- <property name="left-attach">1</property>
- <property name="top-attach">0</property>
- <property name="width">1</property>
- <property name="height">3</property>
- </packing>
</child>
<child>
<object class="GtkSwitch" id="disable_switch">
@@ -91,13 +91,13 @@
<property name="halign">end</property>
<property name="valign">center</property>
<property name="hexpand">False</property>
+ <layout>
+ <property name="column">2</property>
+ <property name="row">0</property>
+ <property name="column-span">1</property>
+ <property name="row-span">3</property>
+ </layout>
</object>
- <packing>
- <property name="left-attach">2</property>
- <property name="top-attach">0</property>
- <property name="width">1</property>
- <property name="height">3</property>
- </packing>
</child>
</object>
</child>
diff --git a/src/gs-review-histogram.ui b/src/gs-review-histogram.ui
index 2852775a0..a7a3c056e 100644
--- a/src/gs-review-histogram.ui
+++ b/src/gs-review-histogram.ui
@@ -22,13 +22,13 @@
<attribute name="scale" value="5.0"/>
<attribute name="weight" value="light"/>
</attributes>
+ <layout>
+ <property name="column">0</property>
+ <property name="row">0</property>
+ <property name="column-span">1</property>
+ <property name="row-span">1</property>
+ </layout>
</object>
- <packing>
- <property name="left-attach">0</property>
- <property name="top-attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
</child>
<child>
<object class="GtkBox" id="value_vbox">
@@ -106,13 +106,13 @@
</attributes>
</object>
</child>
+ <layout>
+ <property name="column">1</property>
+ <property name="row">0</property>
+ <property name="column-span">1</property>
+ <property name="row-span">1</property>
+ </layout>
</object>
- <packing>
- <property name="left-attach">1</property>
- <property name="top-attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
</child>
<child>
<object class="GtkGrid" id="grid2">
@@ -130,13 +130,13 @@
<property name="hexpand">true</property>
<property name="valign">center</property>
<property name="height-request">8</property>
+ <layout>
+ <property name="column">0</property>
+ <property name="row">0</property>
+ <property name="column-span">1</property>
+ <property name="row-span">1</property>
+ </layout>
</object>
- <packing>
- <property name="left-attach">0</property>
- <property name="top-attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
</child>
<child>
<object class="GsStarImage" id="star5_1">
@@ -144,13 +144,13 @@
<property name="sensitive">False</property>
<property name="height-request">10</property>
<property name="width-request">10</property>
+ <layout>
+ <property name="column">1</property>
+ <property name="row">0</property>
+ <property name="column-span">1</property>
+ <property name="row-span">1</property>
+ </layout>
</object>
- <packing>
- <property name="left-attach">1</property>
- <property name="top-attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
</child>
<child>
<object class="GsStarImage" id="star5_2">
@@ -158,13 +158,13 @@
<property name="sensitive">False</property>
<property name="height-request">10</property>
<property name="width-request">10</property>
+ <layout>
+ <property name="column">2</property>
+ <property name="row">0</property>
+ <property name="column-span">1</property>
+ <property name="row-span">1</property>
+ </layout>
</object>
- <packing>
- <property name="left-attach">2</property>
- <property name="top-attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
</child>
<child>
<object class="GsStarImage" id="star5_3">
@@ -172,13 +172,13 @@
<property name="sensitive">False</property>
<property name="height-request">10</property>
<property name="width-request">10</property>
+ <layout>
+ <property name="column">3</property>
+ <property name="row">0</property>
+ <property name="column-span">1</property>
+ <property name="row-span">1</property>
+ </layout>
</object>
- <packing>
- <property name="left-attach">3</property>
- <property name="top-attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
</child>
<child>
<object class="GsStarImage" id="star5_4">
@@ -186,13 +186,13 @@
<property name="sensitive">False</property>
<property name="height-request">10</property>
<property name="width-request">10</property>
+ <layout>
+ <property name="column">4</property>
+ <property name="row">0</property>
+ <property name="column-span">1</property>
+ <property name="row-span">1</property>
+ </layout>
</object>
- <packing>
- <property name="left-attach">4</property>
- <property name="top-attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
</child>
<child>
<object class="GsStarImage" id="star5_5">
@@ -200,13 +200,13 @@
<property name="sensitive">False</property>
<property name="height-request">10</property>
<property name="width-request">10</property>
+ <layout>
+ <property name="column">5</property>
+ <property name="row">0</property>
+ <property name="column-span">1</property>
+ <property name="row-span">1</property>
+ </layout>
</object>
- <packing>
- <property name="left-attach">5</property>
- <property name="top-attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
</child>
<child>
<object class="GsReviewBar" id="bar4">
@@ -216,13 +216,13 @@
<property name="hexpand">true</property>
<property name="valign">center</property>
<property name="height-request">8</property>
+ <layout>
+ <property name="column">0</property>
+ <property name="row">1</property>
+ <property name="column-span">1</property>
+ <property name="row-span">1</property>
+ </layout>
</object>
- <packing>
- <property name="left-attach">0</property>
- <property name="top-attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
</child>
<child>
<object class="GsStarImage" id="star4_1">
@@ -230,13 +230,13 @@
<property name="sensitive">False</property>
<property name="height-request">10</property>
<property name="width-request">10</property>
+ <layout>
+ <property name="column">1</property>
+ <property name="row">1</property>
+ <property name="column-span">1</property>
+ <property name="row-span">1</property>
+ </layout>
</object>
- <packing>
- <property name="left-attach">1</property>
- <property name="top-attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
</child>
<child>
<object class="GsStarImage" id="star4_2">
@@ -244,13 +244,13 @@
<property name="sensitive">False</property>
<property name="height-request">10</property>
<property name="width-request">10</property>
+ <layout>
+ <property name="column">2</property>
+ <property name="row">1</property>
+ <property name="column-span">1</property>
+ <property name="row-span">1</property>
+ </layout>
</object>
- <packing>
- <property name="left-attach">2</property>
- <property name="top-attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
</child>
<child>
<object class="GsStarImage" id="star4_3">
@@ -258,13 +258,13 @@
<property name="sensitive">False</property>
<property name="height-request">10</property>
<property name="width-request">10</property>
+ <layout>
+ <property name="column">3</property>
+ <property name="row">1</property>
+ <property name="column-span">1</property>
+ <property name="row-span">1</property>
+ </layout>
</object>
- <packing>
- <property name="left-attach">3</property>
- <property name="top-attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
</child>
<child>
<object class="GsStarImage" id="star4_4">
@@ -272,13 +272,13 @@
<property name="sensitive">False</property>
<property name="height-request">10</property>
<property name="width-request">10</property>
+ <layout>
+ <property name="column">4</property>
+ <property name="row">1</property>
+ <property name="column-span">1</property>
+ <property name="row-span">1</property>
+ </layout>
</object>
- <packing>
- <property name="left-attach">4</property>
- <property name="top-attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
</child>
<child>
<object class="GsReviewBar" id="bar3">
@@ -288,13 +288,13 @@
<property name="hexpand">true</property>
<property name="valign">center</property>
<property name="height-request">8</property>
+ <layout>
+ <property name="column">0</property>
+ <property name="row">2</property>
+ <property name="column-span">1</property>
+ <property name="row-span">1</property>
+ </layout>
</object>
- <packing>
- <property name="left-attach">0</property>
- <property name="top-attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
</child>
<child>
<object class="GsStarImage" id="star3_1">
@@ -302,13 +302,13 @@
<property name="sensitive">False</property>
<property name="height-request">10</property>
<property name="width-request">10</property>
+ <layout>
+ <property name="column">1</property>
+ <property name="row">2</property>
+ <property name="column-span">1</property>
+ <property name="row-span">1</property>
+ </layout>
</object>
- <packing>
- <property name="left-attach">1</property>
- <property name="top-attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
</child>
<child>
<object class="GsStarImage" id="star3_2">
@@ -316,13 +316,13 @@
<property name="sensitive">False</property>
<property name="height-request">10</property>
<property name="width-request">10</property>
+ <layout>
+ <property name="column">2</property>
+ <property name="row">2</property>
+ <property name="column-span">1</property>
+ <property name="row-span">1</property>
+ </layout>
</object>
- <packing>
- <property name="left-attach">2</property>
- <property name="top-attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
</child>
<child>
<object class="GsStarImage" id="star3_3">
@@ -330,13 +330,13 @@
<property name="sensitive">False</property>
<property name="height-request">10</property>
<property name="width-request">10</property>
+ <layout>
+ <property name="column">3</property>
+ <property name="row">2</property>
+ <property name="column-span">1</property>
+ <property name="row-span">1</property>
+ </layout>
</object>
- <packing>
- <property name="left-attach">3</property>
- <property name="top-attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
</child>
<child>
<object class="GsReviewBar" id="bar2">
@@ -346,13 +346,13 @@
<property name="hexpand">true</property>
<property name="valign">center</property>
<property name="height-request">8</property>
+ <layout>
+ <property name="column">0</property>
+ <property name="row">3</property>
+ <property name="column-span">1</property>
+ <property name="row-span">1</property>
+ </layout>
</object>
- <packing>
- <property name="left-attach">0</property>
- <property name="top-attach">3</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
</child>
<child>
<object class="GsStarImage" id="star2_1">
@@ -360,13 +360,13 @@
<property name="sensitive">False</property>
<property name="height-request">10</property>
<property name="width-request">10</property>
+ <layout>
+ <property name="column">1</property>
+ <property name="row">3</property>
+ <property name="column-span">1</property>
+ <property name="row-span">1</property>
+ </layout>
</object>
- <packing>
- <property name="left-attach">1</property>
- <property name="top-attach">3</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
</child>
<child>
<object class="GsStarImage" id="star2_2">
@@ -374,13 +374,13 @@
<property name="sensitive">False</property>
<property name="height-request">10</property>
<property name="width-request">10</property>
+ <layout>
+ <property name="column">2</property>
+ <property name="row">3</property>
+ <property name="column-span">1</property>
+ <property name="row-span">1</property>
+ </layout>
</object>
- <packing>
- <property name="left-attach">2</property>
- <property name="top-attach">3</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
</child>
<child>
<object class="GsReviewBar" id="bar1">
@@ -390,13 +390,13 @@
<property name="hexpand">true</property>
<property name="valign">center</property>
<property name="height-request">8</property>
+ <layout>
+ <property name="column">0</property>
+ <property name="row">4</property>
+ <property name="column-span">1</property>
+ <property name="row-span">1</property>
+ </layout>
</object>
- <packing>
- <property name="left-attach">0</property>
- <property name="top-attach">4</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
</child>
<child>
<object class="GsStarImage" id="star1_1">
@@ -404,21 +404,21 @@
<property name="sensitive">False</property>
<property name="height-request">10</property>
<property name="width-request">10</property>
+ <layout>
+ <property name="column">1</property>
+ <property name="row">4</property>
+ <property name="column-span">1</property>
+ <property name="row-span">1</property>
+ </layout>
</object>
- <packing>
- <property name="left-attach">1</property>
- <property name="top-attach">4</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
</child>
+ <layout>
+ <property name="column">0</property>
+ <property name="row">1</property>
+ <property name="column-span">2</property>
+ <property name="row-span">1</property>
+ </layout>
</object>
- <packing>
- <property name="left-attach">0</property>
- <property name="top-attach">1</property>
- <property name="width">2</property>
- <property name="height">1</property>
- </packing>
</child>
<child>
<object class="GtkLabel" id="label_total">
@@ -428,13 +428,13 @@
<property name="hexpand">True</property>
<property name="label">0</property>
<property name="margin-top">10</property>
+ <layout>
+ <property name="column">0</property>
+ <property name="row">2</property>
+ <property name="column-span">2</property>
+ <property name="row-span">1</property>
+ </layout>
</object>
- <packing>
- <property name="left-attach">0</property>
- <property name="top-attach">2</property>
- <property name="width">2</property>
- <property name="height">1</property>
- </packing>
</child>
</object>
</child>
diff --git a/src/gs-summary-tile.ui b/src/gs-summary-tile.ui
index 7715d1968..1af93cbdb 100644
--- a/src/gs-summary-tile.ui
+++ b/src/gs-summary-tile.ui
@@ -79,13 +79,13 @@
<style>
<class name="icon-dropshadow"/>
</style>
+ <layout>
+ <property name="column">0</property>
+ <property name="row">0</property>
+ <property name="column-span">1</property>
+ <property name="row-span">1</property>
+ </layout>
</object>
- <packing>
- <property name="left-attach">0</property>
- <property name="top-attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
</child>
<child>
<object class="GtkBox" id="box">
@@ -121,13 +121,13 @@
</style>
</object>
</child>
+ <layout>
+ <property name="column">1</property>
+ <property name="row">0</property>
+ <property name="column-span">1</property>
+ <property name="row-span">1</property>
+ </layout>
</object>
- <packing>
- <property name="left-attach">1</property>
- <property name="top-attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
</child>
</object>
</child>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]