Skip to content

Commit 8fae06e

Browse files
committed
🚚 Rename settings ui files
1 parent 333b60b commit 8fae06e

25 files changed

+316
-310
lines changed

docs/how-to-create-new-effects.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ This is because starting with GNOME Shell 40, the preference dialog uses GTK4, b
261261
Usually, there are only a few minor differences between the two files.
262262
We will load the respective file in the `initPreferences()` method of your new effect class.
263263

264-
Just save the code below to `resources/ui/gtk3/simpleFadePage.ui` and `resources/ui/gtk4/simpleFadePage.ui` respectively.
264+
Just save the code below to `resources/ui/gtk3/SimpleFade.ui` and `resources/ui/gtk4/SimpleFade.ui` respectively.
265265
Remember to replace any occurrence of `simple-fade` with your effect's nick-name!
266266

267267
<details>
@@ -545,7 +545,7 @@ In order to load the above `*.ui` files, add the following code to your effect's
545545
static initPreferences(dialog) {
546546

547547
// Add the settings page to the builder.
548-
dialog.getBuilder().add_from_resource(`/ui/${utils.getGTKString()}/simpleFadePage.ui`);
548+
dialog.getBuilder().add_from_resource(`/ui/${utils.getGTKString()}/SimpleFade.ui`);
549549

550550
// These connect the settings to the UI elements. Have a look at prefs.js
551551
// on how to bind other types of UI elements.

prefs.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,10 @@ var PreferencesDialog = class PreferencesDialog {
5959
this._builder = new Gtk.Builder();
6060
this._builder.add_from_resource(`/ui/common/main-menu.ui`);
6161
this._builder.add_from_resource(`/ui/${utils.getGTKString()}/prefs.ui`);
62-
this._builder.add_from_resource(`/ui/${utils.getGTKString()}/generalPage.ui`);
6362

6463
// Bind general options properties.
6564
this.bindSwitch('destroy-dialogs');
6665

67-
// Add the General Options page to the main stack.
68-
const stack = this._builder.get_object('main-stack');
69-
stack.add_titled(
70-
this._builder.get_object('general-prefs'), 'general', 'General Options');
71-
7266
// Add all other effect pages.
7367
ALL_EFFECTS.forEach(Effect => {
7468
const [minMajor, minMinor] = Effect.getMinShellVersion();
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

resources/ui/gtk3/generalPage.ui

Lines changed: 0 additions & 160 deletions
This file was deleted.

resources/ui/gtk3/prefs.ui

Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
<interface>
33
<requires lib="gtk" version="3.0" />
44

5+
<menu id="close-effect-menu"></menu>
6+
57
<object class="GtkMenuButton" id="menu-button">
68
<property name="menu-model">main-menu</property>
79
<property name="visible">1</property>
@@ -25,6 +27,171 @@
2527
<property name="transition-type">slide-up-down</property>
2628
<property name="hexpand">1</property>
2729

30+
<child>
31+
<object class="GtkStackPage">
32+
<property name="name">general</property>
33+
<property name="title" translatable="yes">General Options</property>
34+
35+
<property name="child">
36+
<object class="GtkBox" id="general-prefs">
37+
<property name="orientation">vertical</property>
38+
<property name="margin-start">60</property>
39+
<property name="margin-end">60</property>
40+
<property name="margin-top">30</property>
41+
<property name="margin-bottom">30</property>
42+
43+
<child>
44+
<object class="GtkImage">
45+
<property name="valign">center</property>
46+
<property name="icon-name">burn-my-windows-symbolic</property>
47+
<property name="pixel_size">128</property>
48+
</object>
49+
</child>
50+
51+
<child>
52+
<object class="GtkLabel">
53+
<property name="label" translatable="yes">Welcome to Burn-My-Windows!</property>
54+
<property name="margin-top">8</property>
55+
<property name="margin-bottom">6</property>
56+
<style>
57+
<class name="large-title" />
58+
</style>
59+
</object>
60+
</child>
61+
62+
<child>
63+
<object class="GtkLabel">
64+
<property name="label" translatable="yes">If you like this extension, recommend it to your friends :)</property>
65+
<property name="margin-bottom">36</property>
66+
</object>
67+
</child>
68+
69+
70+
<child>
71+
<object class="GtkFrame">
72+
<child>
73+
<object class="GtkListBox">
74+
<property name="selection-mode">none</property>
75+
76+
<child>
77+
<object class="GtkListBoxRow">
78+
<property name="margin-start">10</property>
79+
<property name="margin-end">10</property>
80+
<property name="margin-top">10</property>
81+
<property name="margin-bottom">10</property>
82+
<property name="activatable">0</property>
83+
<child>
84+
<object class="GtkBox">
85+
<property name="spacing">8</property>
86+
<child>
87+
<object class="GtkBox">
88+
<property name="orientation">vertical</property>
89+
<property name="spacing">3</property>
90+
<child>
91+
<object class="GtkLabel">
92+
<property name="label" translatable="yes">Close Window Animation</property>
93+
<property name="xalign">0</property>
94+
<property name="halign">start</property>
95+
<property name="valign">center</property>
96+
<property name="hexpand">1</property>
97+
</object>
98+
</child>
99+
<child>
100+
<object class="GtkLabel">
101+
<property name="label" translatable="yes">If multiple are selected, one is chosen randomly.</property>
102+
<property name="xalign">0</property>
103+
<property name="halign">start</property>
104+
<property name="valign">center</property>
105+
<property name="hexpand">1</property>
106+
<style>
107+
<class name="dim-label" />
108+
<class name="caption" />
109+
</style>
110+
</object>
111+
</child>
112+
</object>
113+
</child>
114+
<child>
115+
<object class="GtkMenuButton" id="close-effect-button">
116+
<property name="menu-model">close-effect-menu</property>
117+
<child>
118+
<object class="GtkBox">
119+
<property name="spacing">8</property>
120+
<child>
121+
<object class="GtkLabel">
122+
<property name="label" translatable="yes">Choose Effects</property>
123+
</object>
124+
</child>
125+
<child>
126+
<object class="GtkImage">
127+
<property name="icon-name">pan-down-symbolic</property>
128+
<property name="icon-size">1</property>
129+
</object>
130+
</child>
131+
</object>
132+
</child>
133+
</object>
134+
</child>
135+
</object>
136+
</child>
137+
</object>
138+
</child>
139+
140+
<child>
141+
<object class="GtkListBoxRow">
142+
<property name="margin-start">10</property>
143+
<property name="margin-end">10</property>
144+
<property name="margin-top">10</property>
145+
<property name="margin-bottom">10</property>
146+
<property name="activatable">0</property>
147+
<child>
148+
<object class="GtkBox">
149+
<property name="spacing">8</property>
150+
<child>
151+
<object class="GtkLabel">
152+
<property name="label" translatable="yes">Also Burn Dialogs</property>
153+
<property name="xalign">0</property>
154+
<property name="halign">start</property>
155+
<property name="valign">center</property>
156+
<property name="hexpand">1</property>
157+
</object>
158+
</child>
159+
<child>
160+
<object class="GtkSwitch" id="destroy-dialogs">
161+
<property name="halign">end</property>
162+
<property name="valign">center</property>
163+
</object>
164+
</child>
165+
<child>
166+
<object class="GtkButton" id="reset-destroy-dialogs">
167+
<child>
168+
<object class="GtkImage">
169+
<property name="icon-name">edit-clear-symbolic</property>
170+
<property name="icon-size">1</property>
171+
</object>
172+
</child>
173+
<property name="tooltip-text">Reset to Default Value</property>
174+
<style>
175+
<class name="flat" />
176+
</style>
177+
</object>
178+
</child>
179+
</object>
180+
</child>
181+
</object>
182+
</child>
183+
184+
</object>
185+
</child>
186+
</object>
187+
</child>
188+
189+
</object>
190+
191+
</property>
192+
</object>
193+
</child>
194+
28195
<!-- Stack pages are inserted here -->
29196

30197
</object>
File renamed without changes.

0 commit comments

Comments
 (0)