[gnome-builder] libide/tweaks: add basic tweaks window controls
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] libide/tweaks: add basic tweaks window controls
- Date: Sun, 31 Jul 2022 21:37:23 +0000 (UTC)
commit f84c14673ebe4dd299e0aac61dda59be830b125a
Author: Christian Hergert <chergert redhat com>
Date: Sun Jul 31 14:37:17 2022 -0700
libide/tweaks: add basic tweaks window controls
Based on control center with a bit of cleanup. We can probably go a similar
route to abstract sidebar contents and page contents too.
src/libide/tweaks/ide-tweaks-window.ui | 138 +++++++++++++++++++++++++++++++++
src/libide/tweaks/tests/test-tweaks.c | 1 +
2 files changed, 139 insertions(+)
---
diff --git a/src/libide/tweaks/ide-tweaks-window.ui b/src/libide/tweaks/ide-tweaks-window.ui
index 749066f43..22e44ee30 100644
--- a/src/libide/tweaks/ide-tweaks-window.ui
+++ b/src/libide/tweaks/ide-tweaks-window.ui
@@ -1,5 +1,143 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="IdeTweaksWindow" parent="AdwWindow">
+ <property name="default-width">1080</property>
+ <property name="default-height">720</property>
+ <child>
+ <object class="AdwLeaflet" id="leaflet">
+ <property name="can-navigate-back">true</property>
+ <property name="can-unfold">true</property>
+ <property name="fold-threshold-policy">minimum</property>
+ <property name="homogeneous">true</property>
+ <property name="mode-transition-duration">250</property>
+ <property name="transition-type">over</property>
+ <child>
+ <object class="GtkBox" id="sidebar_box">
+ <property name="orientation">vertical</property>
+ <property name="hexpand">false</property>
+ <child>
+ <object class="AdwHeaderBar" id="sidebar_header">
+ <property name="show-start-title-buttons">true</property>
+ <property name="show-end-title-buttons" bind-source="leaflet" bind-property="folded"
bind-flags="sync-create"/>
+ <property name="title-widget">
+ <object class="AdwWindowTitle" id="sidebar_title">
+ <property name="title" translatable="yes">Preferences</property>
+ </object>
+ </property>
+ <child>
+ <object class="GtkButton" id="sidebar_previous_button">
+ <property name="action-name">navigation.back</property>
+ <property name="icon-name">go-previous-symbolic</property>
+ <accessibility>
+ <property name="label" translatable="yes">All Preferences</property>
+ </accessibility>
+ <style>
+ <class name="image-button"/>
+ </style>
+ </object>
+ </child>
+ <child>
+ <object class="GtkToggleButton" id="sidebar_search_button">
+ <property name="icon-name">edit-find-symbolic</property>
+ <accessibility>
+ <property name="label" translatable="yes">Search Preferences</property>
+ </accessibility>
+ <style>
+ <class name="image-button"/>
+ </style>
+ </object>
+ </child>
+ <child type="end">
+ <object class="GtkMenuButton">
+ <property name="icon-name">open-menu-symbolic</property>
+ <property name="menu-model">primary_menu</property>
+ <property name="primary">true</property>
+ <accessibility>
+ <property name="label" translatable="yes">Primary Menu</property>
+ </accessibility>
+ <style>
+ <class name="image-button"/>
+ </style>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkSearchBar" id="sidebar_search_bar">
+ <property name="search-mode-enabled" bind-source="sidebar_search_button"
bind-property="active" bind-flags="sync-create|bidirectional"/>
+ <child>
+ <object class="GtkSearchEntry" id="sidebar_search_entry">
+ <property name="width-chars">25</property>
+ <property name="max-width-chars">25</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow">
+ <property name="vexpand">true</property>
+ <property name="width-request">200</property>
+ <property name="hscrollbar-policy">never</property>
+ <child>
+ <object class="GtkViewport">
+ <property name="scroll-to-focus">true</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="AdwLeafletPage">
+ <property name="navigatable">false</property>
+ <property name="child">
+ <object class="GtkSeparator" id="sidebar_separator">
+ <property name="orientation">vertical</property>
+ <style>
+ <class name="sidebar"/>
+ </style>
+ </object>
+ </property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkBox" id="page_box">
+ <property name="orientation">vertical</property>
+ <property name="hexpand">true</property>
+ <property name="vexpand">true</property>
+ <child>
+ <object class="GtkStack" id="stack">
+ <property name="hexpand">true</property>
+ <property name="vexpand">true</property>
+ <property name="transition-type">crossfade</property>
+ <property name="width-request">360</property>
+ <style>
+ <class name="background"/>
+ </style>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
</template>
+ <object class="GtkSizeGroup" id="header_sizegroup">
+ <property name="mode">vertical</property>
+ <widgets>
+ <widget name="sidebar_search_button"/>
+ <widget name="sidebar_previous_button"/>
+ </widgets>
+ </object>
+ <menu id="primary_menu">
+ <section>
+ <item>
+ <attribute name="label" translatable="yes">Keyboard Shortcuts</attribute>
+ <attribute name="action">win.show-help-overlay</attribute>
+ </item>
+ <item>
+ <attribute name="label" translatable="yes">Help</attribute>
+ <attribute name="action">app.help</attribute>
+ </item>
+ </section>
+ </menu>
</interface>
diff --git a/src/libide/tweaks/tests/test-tweaks.c b/src/libide/tweaks/tests/test-tweaks.c
index 7631f5bc6..41c7f22eb 100644
--- a/src/libide/tweaks/tests/test-tweaks.c
+++ b/src/libide/tweaks/tests/test-tweaks.c
@@ -46,6 +46,7 @@ main (int argc,
};
gtk_init ();
+ adw_init ();
gtk_source_init ();
_ide_tweaks_init ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]