Commands Page: Use AdwEntryRow

This commit is contained in:
Romain Vigier
2024-03-04 15:17:43 +00:00
parent e3c6d67fe9
commit 7bff19f830
6 changed files with 6 additions and 46 deletions
-1
View File
@@ -15,7 +15,6 @@ SPDX-License-Identifier: GPL-3.0-or-later
<file compressed="true" preprocess="xml-stripblanks" alias="icons/scalable/categories/nightthemeswitcher-themes-symbolic.svg">icons/themes-symbolic.svg</file>
<file compressed="true" preprocess="xml-stripblanks">ui/BackgroundButton.ui</file>
<file compressed="true" preprocess="xml-stripblanks">ui/BackgroundsPage.ui</file>
<file compressed="true" preprocess="xml-stripblanks">ui/ClearableEntry.ui</file>
<file compressed="true" preprocess="xml-stripblanks">ui/CommandsPage.ui</file>
<file compressed="true" preprocess="xml-stripblanks">ui/ContributePage.ui</file>
<file compressed="true" preprocess="xml-stripblanks">ui/SchedulePage.ui</file>
+6 -20
View File
@@ -17,31 +17,17 @@ SPDX-License-Identifier: GPL-3.0-or-later
</object>
</property>
<child>
<object class="AdwActionRow">
<object class="AdwEntryRow" id="sunrise_entry">
<property name="title" translatable="yes">Sunrise</property>
<property name="activatable-widget">sunrise_entry</property>
<child>
<object class="ClearableEntry" id="sunrise_entry">
<property name="placeholder-text" translatable="yes" comments="Don't translate the `notify-send` command.">notify-send "Hello sunshine!"</property>
<property name="input-purpose">terminal</property>
<property name="width-chars">28</property>
<property name="valign">center</property>
</object>
</child>
<property name="input-purpose">terminal</property>
<property name="attributes">0 -1 font-desc "Mono"</property>
</object>
</child>
<child>
<object class="AdwActionRow">
<object class="AdwEntryRow" id="sunset_entry">
<property name="title" translatable="yes">Sunset</property>
<property name="activatable-widget">sunset_entry</property>
<child>
<object class="ClearableEntry" id="sunset_entry">
<property name="placeholder-text" translatable="yes" comments="Don't translate the `notify-send` command.">notify-send "Hello moonshine!"</property>
<property name="input-purpose">terminal</property>
<property name="width-chars">28</property>
<property name="valign">center</property>
</object>
</child>
<property name="input-purpose">terminal</property>
<property name="attributes">0 -1 font-desc "Mono"</property>
</object>
</child>
</object>
-1
View File
@@ -34,7 +34,6 @@ modules = [
preferences = [
'preferences/BackgroundButton.js',
'preferences/BackgroundsPage.js',
'preferences/ClearableEntry.js',
'preferences/CommandsPage.js',
'preferences/ContributePage.js',
'preferences/SchedulePage.js',
-2
View File
@@ -8,7 +8,6 @@ src/data/org.gnome.shell.extensions.nightthemeswitcher.gschema.xml
src/data/ui/BackgroundButton.ui
src/data/ui/BackgroundsPage.ui
src/data/ui/ClearableEntry.ui
src/data/ui/CommandsPage.ui
src/data/ui/ContributePage.ui
src/data/ui/SchedulePage.ui
@@ -25,7 +24,6 @@ src/modules/Timer.js
src/preferences/BackgroundButton.js
src/preferences/BackgroundsPage.js
src/preferences/ClearableEntry.js
src/preferences/CommandsPage.js
src/preferences/ContributePage.js
src/preferences/SchedulePage.js
-20
View File
@@ -1,20 +0,0 @@
// SPDX-FileCopyrightText: Night Theme Switcher Contributors
// SPDX-License-Identifier: GPL-3.0-or-later
import GObject from 'gi://GObject';
import Gtk from 'gi://Gtk';
export class ClearableEntry extends Gtk.Entry {
static {
GObject.registerClass({
GTypeName: 'ClearableEntry',
Template: 'resource:///org/gnome/Shell/Extensions/nightthemeswitcher/preferences/ui/ClearableEntry.ui',
}, this);
}
onIconReleased(entry, position) {
if (position === Gtk.EntryIconPosition.SECONDARY)
entry.text = '';
}
}
-2
View File
@@ -39,7 +39,6 @@ export default class NightThemeSwitcherPreferences extends ExtensionPreferences
// Dynamically import all classes
const { BackgroundButton } = await import('./preferences/BackgroundButton.js');
const { BackgroundsPage } = await import('./preferences/BackgroundsPage.js');
const { ClearableEntry } = await import('./preferences/ClearableEntry.js');
const { CommandsPage } = await import('./preferences/CommandsPage.js');
const { ContributePage } = await import('./preferences/ContributePage.js');
const { SchedulePage } = await import('./preferences/SchedulePage.js');
@@ -49,7 +48,6 @@ export default class NightThemeSwitcherPreferences extends ExtensionPreferences
// Make sure all GObjects are registered
GObject.type_ensure(BackgroundButton);
GObject.type_ensure(BackgroundsPage);
GObject.type_ensure(ClearableEntry);
GObject.type_ensure(CommandsPage);
GObject.type_ensure(ContributePage);
GObject.type_ensure(SchedulePage);