Refactor: Simplify PrefsPage UI file and get rid of InternalChildren

This commit is contained in:
Julian 2023-01-22 21:12:05 +01:00
parent 503fdcb90d
commit f7309e7f65
Signed by: julian
GPG Key ID: 094C2AC34192FA11
2 changed files with 30 additions and 50 deletions

View File

@ -5,9 +5,6 @@
<object class="AdwPreferencesGroup"> <object class="AdwPreferencesGroup">
<property name="title">Item Order</property> <property name="title">Item Order</property>
<property name="description">Simply use drag and drop to order the items any way you want.</property> <property name="description">Simply use drag and drop to order the items any way you want.</property>
<child>
<object class="GtkBox" id="left-box">
<property name="orientation">vertical</property>
<child> <child>
<object class="GtkLabel"> <object class="GtkLabel">
<property name="label">Left Top Bar Box</property> <property name="label">Left Top Bar Box</property>
@ -20,11 +17,6 @@
<property name="box-order">left-box-order</property> <property name="box-order">left-box-order</property>
</object> </object>
</child> </child>
</object>
</child>
<child>
<object class="GtkBox" id="center-box">
<property name="orientation">vertical</property>
<child> <child>
<object class="GtkLabel"> <object class="GtkLabel">
<property name="label">Center Top Bar Box</property> <property name="label">Center Top Bar Box</property>
@ -38,11 +30,6 @@
<property name="box-order">center-box-order</property> <property name="box-order">center-box-order</property>
</object> </object>
</child> </child>
</object>
</child>
<child>
<object class="GtkBox" id="right-box">
<property name="orientation">vertical</property>
<child> <child>
<object class="GtkLabel"> <object class="GtkLabel">
<property name="label">Right Top Bar Box</property> <property name="label">Right Top Bar Box</property>
@ -58,7 +45,5 @@
</child> </child>
</object> </object>
</child> </child>
</object>
</child>
</template> </template>
</interface> </interface>

View File

@ -15,12 +15,7 @@ const ScrollManager = Me.imports.prefsModules.ScrollManager;
var PrefsPage = GObject.registerClass({ var PrefsPage = GObject.registerClass({
GTypeName: "PrefsPage", GTypeName: "PrefsPage",
Template: Me.dir.get_child("ui").get_child("prefs-page.ui").get_uri(), Template: Me.dir.get_child("ui").get_child("prefs-page.ui").get_uri()
InternalChildren: [
"left-box",
"center-box",
"right-box"
]
}, class PrefsPage extends Adw.PreferencesPage { }, class PrefsPage extends Adw.PreferencesPage {
constructor(params = {}) { constructor(params = {}) {
super(params); super(params);