Commands Page: Use AdwEntryRow
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -34,7 +34,6 @@ modules = [
|
||||
preferences = [
|
||||
'preferences/BackgroundButton.js',
|
||||
'preferences/BackgroundsPage.js',
|
||||
'preferences/ClearableEntry.js',
|
||||
'preferences/CommandsPage.js',
|
||||
'preferences/ContributePage.js',
|
||||
'preferences/SchedulePage.js',
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 = '';
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user