mirror of
https://github.com/morgan9e/dash-to-panel
synced 2026-04-14 00:04:17 +09:00
convert behavior tab to adw preferences page
This commit is contained in:
189
SettingsBehavior.ui
Normal file
189
SettingsBehavior.ui
Normal file
@@ -0,0 +1,189 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<requires lib="gtk" version="4.0"/>
|
||||
<object class="AdwPreferencesPage" id="behavior">
|
||||
|
||||
<!-- group applications -->
|
||||
<child>
|
||||
<object class="AdwPreferencesGroup" id="behavior_group_applications">
|
||||
<property name="title">Applications</property>
|
||||
|
||||
<child>
|
||||
<object class="AdwActionRow">
|
||||
<property name="title">Show favorite applications</property>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="show_favorite_switch">
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="AdwActionRow">
|
||||
<property name="title">Show running applications</property>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="show_runnning_apps_switch">
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="AdwActionRow">
|
||||
<property name="title">Show favorite applications on secondary panels</property>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="multimon_multi_show_favorites_switch">
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="AdwActionRow">
|
||||
<property name="title" translatable="yes">Show favorite applications</property>
|
||||
<property name="subtitle">Top Bar > Show App Menu must be enabled in Tweak Tool</property>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="show_appmenu_switch">
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="AdwActionRow">
|
||||
<property name="title" translatable="yes">Ungroup applications</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="show_group_apps_options_button">
|
||||
<property name="receives_default">True</property>
|
||||
<property name="valign">center</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="image_show_group_apps_options">
|
||||
<property name="icon_name">emblem-system-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<style>
|
||||
<class name="circular"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="group_apps_switch">
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<!-- group hover -->
|
||||
<child>
|
||||
<object class="AdwPreferencesGroup" id="behavior_group_hover">
|
||||
<property name="title">Hover</property>
|
||||
|
||||
<child>
|
||||
<object class="AdwActionRow">
|
||||
<property name="title" translatable="yes">Show window previews on hover</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="show_window_previews_button">
|
||||
<property name="receives_default">True</property>
|
||||
<property name="valign">center</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="image_window_previews_options">
|
||||
<property name="icon_name">emblem-system-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<style>
|
||||
<class name="circular"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="show_window_previews_switch">
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="AdwActionRow">
|
||||
<property name="title" translatable="yes">Show tooltip on hover</property>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="show_tooltip_switch">
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<!-- group isolate -->
|
||||
<child>
|
||||
<object class="AdwPreferencesGroup" id="behavior_group_isolate">
|
||||
<property name="title">Isolate</property>
|
||||
|
||||
<child>
|
||||
<object class="AdwActionRow">
|
||||
<property name="title" translatable="yes">Isolate Workspaces</property>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="isolate_workspaces_switch">
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="AdwActionRow">
|
||||
<property name="title" translatable="yes">Isolate monitors</property>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="multimon_multi_isolate_monitor_switch">
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<!-- group overview -->
|
||||
<child>
|
||||
<object class="AdwPreferencesGroup" id="behavior_group_overview">
|
||||
<property name="title">Overview</property>
|
||||
|
||||
<child>
|
||||
<object class="AdwActionRow">
|
||||
<property name="title" translatable="yes">Click empty space to close overview</property>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="clicktoexit_switch">
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="AdwActionRow">
|
||||
<property name="title" translatable="yes">Disable show overview on startup</property>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="hide_overview_on_startup_switch">
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</interface>
|
||||
42
prefs.js
42
prefs.js
@@ -25,6 +25,7 @@ const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Gtk = imports.gi.Gtk;
|
||||
const Adw = imports.gi.Adw;
|
||||
const Gdk = imports.gi.Gdk;
|
||||
const Mainloop = imports.mainloop;
|
||||
|
||||
@@ -2460,20 +2461,41 @@ function init() {
|
||||
|
||||
function fillPreferencesWindow(window) {
|
||||
window.set_default_size(680, 740);
|
||||
|
||||
let pagePosition = new Adw.PreferencesPage();
|
||||
pagePosition.set_title("Position");
|
||||
pagePosition.set_icon_name("document-properties");
|
||||
window.add(pagePosition);
|
||||
|
||||
let preferences = new Preferences();
|
||||
let box = new Gtk.Box({orientation: Gtk.Orientation.VERTICAL});
|
||||
let pageStyle = new Adw.PreferencesPage();
|
||||
pageStyle.set_title("Style");
|
||||
pageStyle.set_icon_name("document-properties");
|
||||
window.add(pageStyle);
|
||||
|
||||
// dummy page to prevent 'Extension did not provide any UI'
|
||||
// error until we migrate to Adw
|
||||
let dummyPage = new imports.gi.Adw.PreferencesPage()
|
||||
builder = new Gtk.Builder();
|
||||
builder.set_scope(new BuilderScope());
|
||||
builder.set_translation_domain(Me.metadata['gettext-domain']);
|
||||
builder.add_from_file(Me.path + '/SettingsBehavior.ui');
|
||||
let pageBehavior = builder.get_object('behavior');
|
||||
|
||||
box.append(new imports.gi.Adw.HeaderBar);
|
||||
window.add(dummyPage);
|
||||
window.visible_page = dummyPage
|
||||
pageBehavior.set_title("Behavior");
|
||||
pageBehavior.set_icon_name("document-properties");
|
||||
window.add(pageBehavior);
|
||||
|
||||
box.append(preferences.notebook);
|
||||
window.set_content(box);
|
||||
let pageAction = new Adw.PreferencesPage();
|
||||
pageAction.set_title("Action");
|
||||
pageAction.set_icon_name("document-properties");
|
||||
window.add(pageAction);
|
||||
|
||||
let pageFineTune = new Adw.PreferencesPage();
|
||||
pageFineTune.set_title("Fine-Tune");
|
||||
pageFineTune.set_icon_name("document-properties");
|
||||
window.add(pageFineTune);
|
||||
|
||||
let pageAbout = new Adw.PreferencesPage();
|
||||
pageAbout.set_title("About");
|
||||
pageAbout.set_icon_name("document-properties");
|
||||
window.add(pageAbout);
|
||||
}
|
||||
|
||||
function buildPrefsWidget() {
|
||||
|
||||
Reference in New Issue
Block a user