🔧 Hack the flap into the widget tree
This commit is contained in:
@@ -119,11 +119,7 @@ var PreferencesDialog = class PreferencesDialog {
|
|||||||
if (utils.isADW()) {
|
if (utils.isADW()) {
|
||||||
|
|
||||||
// This is our top-level widget which we will return later.
|
// This is our top-level widget which we will return later.
|
||||||
this._widget = new Gtk.Box({orientation: Gtk.Orientation.VERTICAL});
|
this._widget = this._builder.get_object('general-prefs');
|
||||||
|
|
||||||
// Add the general options page to the settings dialog.
|
|
||||||
const generalPrefs = this._builder.get_object('general-prefs');
|
|
||||||
this.gtkBoxAppend(this._widget, generalPrefs);
|
|
||||||
|
|
||||||
// Then add a preferences group for the effect expander rows.
|
// Then add a preferences group for the effect expander rows.
|
||||||
const group = this._builder.get_object('effects-group');
|
const group = this._builder.get_object('effects-group');
|
||||||
@@ -276,8 +272,20 @@ var PreferencesDialog = class PreferencesDialog {
|
|||||||
header.pack_start(menu);
|
header.pack_start(menu);
|
||||||
header.set_title_widget(this._builder.get_object('profile-button'));
|
header.set_title_widget(this._builder.get_object('profile-button'));
|
||||||
|
|
||||||
// Allow closing of the sub pages.
|
const flap = this._builder.get_object('profile-editor-flap');
|
||||||
window.can_navigate_back = true;
|
const clamp = this._findWidgetByType(window.get_content(), Adw.Clamp);
|
||||||
|
const viewport = clamp.get_parent();
|
||||||
|
viewport.get_parent().set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.NEVER);
|
||||||
|
viewport.set_child(flap);
|
||||||
|
|
||||||
|
const scrolledWindow = Gtk.ScrolledWindow.new();
|
||||||
|
scrolledWindow.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC);
|
||||||
|
scrolledWindow.set_propagate_natural_height(true);
|
||||||
|
scrolledWindow.set_vexpand(true);
|
||||||
|
scrolledWindow.set_child(clamp);
|
||||||
|
|
||||||
|
flap.set_content(scrolledWindow);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
window.get_titlebar().pack_start(menu);
|
window.get_titlebar().pack_start(menu);
|
||||||
}
|
}
|
||||||
@@ -679,3 +687,8 @@ function buildPrefsWidget() {
|
|||||||
var dialog = new PreferencesDialog();
|
var dialog = new PreferencesDialog();
|
||||||
return dialog.getWidget();
|
return dialog.getWidget();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function fillPreferencesWindow(window) {
|
||||||
|
var dialog = new PreferencesDialog();
|
||||||
|
window.add(dialog.getWidget());
|
||||||
|
}
|
||||||
+36
-18
@@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
<!--
|
<!--
|
||||||
SPDX-FileCopyrightText: Simon Schneegans <code@simonschneegans.de>
|
SPDX-FileCopyrightText: Simon Schneegans <code@simonschneegans.de>
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier:
|
||||||
|
GPL-3.0-or-later
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<interface domain="burn-my-windows">
|
<interface domain="burn-my-windows">
|
||||||
@@ -17,9 +18,13 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
|||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkButton">
|
<object class="GtkToggleButton" id="edit-profile-button">
|
||||||
<property name="icon-name">edit-symbolic</property>
|
<property name="icon-name">edit-symbolic</property>
|
||||||
<property name="valign">center</property>
|
<property name="valign">center</property>
|
||||||
|
|
||||||
|
<binding name="active">
|
||||||
|
<lookup name="reveal-flap">profile-editor-flap</lookup>
|
||||||
|
</binding>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<style>
|
<style>
|
||||||
@@ -27,24 +32,27 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
|||||||
</style>
|
</style>
|
||||||
</object>
|
</object>
|
||||||
|
|
||||||
<object class="GtkMenuButton" id="menu-button">
|
<object class="AdwFlap" id="profile-editor-flap">
|
||||||
<property name="menu-model">main-menu</property>
|
|
||||||
<property name="icon-name">heart-filled-symbolic</property>
|
|
||||||
</object>
|
|
||||||
|
|
||||||
<object class="AdwFlap" id="general-prefs">
|
|
||||||
<property name="orientation">vertical</property>
|
<property name="orientation">vertical</property>
|
||||||
<property name="reveal-flap">true</property>
|
<property name="fold-threshold-policy">natural</property>
|
||||||
<property name="locked">true</property>
|
|
||||||
<property name="swipe-to-open">false</property>
|
<binding name="reveal-flap">
|
||||||
<property name="swipe-to-close">false</property>
|
<lookup name="active">edit-profile-button</lookup>
|
||||||
|
</binding>
|
||||||
|
|
||||||
<child type="flap">
|
<child type="flap">
|
||||||
<object class="AdwPreferencesGroup">
|
<object class="AdwClamp">
|
||||||
<style>
|
<style>
|
||||||
<class name="background" />
|
<class name="background" />
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<property name="child">
|
||||||
|
<object class="AdwPreferencesGroup">
|
||||||
|
<property name="margin-top">20</property>
|
||||||
|
<property name="margin-bottom">20</property>
|
||||||
|
<property name="margin-start">20</property>
|
||||||
|
<property name="margin-end">20</property>
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<object class="AdwEntryRow">
|
<object class="AdwEntryRow">
|
||||||
<property name="title" translatable="yes">Application</property>
|
<property name="title" translatable="yes">Application</property>
|
||||||
@@ -106,15 +114,25 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
|||||||
</child>
|
</child>
|
||||||
|
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</property>
|
||||||
|
|
||||||
<child type="content">
|
|
||||||
<object class="AdwPreferencesGroup" id="effects-group">
|
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
</object>
|
||||||
|
|
||||||
|
<object class="GtkMenuButton" id="menu-button">
|
||||||
|
<property name="menu-model">main-menu</property>
|
||||||
|
<property name="icon-name">heart-filled-symbolic</property>
|
||||||
|
</object>
|
||||||
|
|
||||||
|
<object class="AdwPreferencesPage" id="general-prefs">
|
||||||
|
<child>
|
||||||
|
<object class="AdwPreferencesGroup" id="effects-group">
|
||||||
|
<property name="margin-top">20</property>
|
||||||
|
<property name="margin-bottom">20</property>
|
||||||
|
<property name="margin-start">20</property>
|
||||||
|
<property name="margin-end">20</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
|
||||||
</interface>
|
</interface>
|
||||||
Reference in New Issue
Block a user