Skip to content

Commit ecf65d9

Browse files
authored
book: Move to libadwaita 1.4 (#1536)
* book: Move to libadwaita 1.4 * book: Rename content title * book: UI fixes * book: Import NavigationSplitView into namespace * Update video and images * Update UI * Update dialog section
1 parent 6b6e492 commit ecf65d9

File tree

13 files changed

+305
-323
lines changed

13 files changed

+305
-323
lines changed

book/listings/Cargo.lock

Lines changed: 27 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

book/listings/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ edition = "2021"
66

77
[dependencies]
88
gtk = { version = "*", package = "gtk4", features = ["v4_8"] }
9-
adw = { version = ">= 0.3.1", package = "libadwaita", features = ["v1_3"] }
9+
adw = { version = ">= 0.3.1", package = "libadwaita", features = ["v1_4"] }
1010
once_cell = "1.0"
1111
serde = { version = "1.0", features = ["derive"] }
1212
serde_json = "1.0"
1313
anyhow = "1.0"
1414
xshell = "0.2"
1515
dirs = "5.0"
1616
walkdir = "2.3"
17-
async-channel = "1.9.0"
17+
async-channel = "2.0"
1818
ashpd = { version = "0.6.2", features = ["gtk4"] }
1919
tokio = { version = "1.33.0", features = ["rt-multi-thread"] }
2020
reqwest = { version = "0.11", default-features = false, features = ["rustls-tls"] }

book/listings/todo/7/resources/window.ui

Lines changed: 79 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -30,115 +30,103 @@
3030
</menu>
3131
<template class="TodoWindow" parent="AdwApplicationWindow">
3232
<property name="title" translatable="yes">To-Do</property>
33-
<property name="default_width">650</property>
34-
<property name="default_height">550</property>
33+
<property name="width-request">360</property>
34+
<property name="height-request">200</property>
35+
<child>
36+
<object class="AdwBreakpoint">
37+
<condition>max-width: 500sp</condition>
38+
<setter object="split_view" property="collapsed">True</setter>
39+
</object>
40+
</child>
3541
<property name="content">
36-
<object class="AdwLeaflet" id="leaflet">
37-
<property name="can-navigate-back">True</property>
38-
<child>
39-
<object class="GtkBox">
40-
<property name="orientation">vertical</property>
41-
<property name="width-request">200</property>
42-
<child>
43-
<object class="AdwHeaderBar">
44-
<binding name="show-end-title-buttons">
45-
<lookup name="folded">leaflet</lookup>
46-
</binding>
47-
<child type="start">
48-
<object class="GtkToggleButton">
49-
<property name="icon-name">list-add-symbolic</property>
50-
<property name="tooltip-text" translatable="yes">New Collection</property>
51-
<property name="action-name">win.new-collection</property>
42+
<object class="AdwNavigationSplitView" id="split_view">
43+
<property name="min-sidebar-width">200</property>
44+
<property name="sidebar">
45+
<object class="AdwNavigationPage">
46+
<property name="title" bind-source="TodoWindow"
47+
bind-property="title" bind-flags="sync-create" />
48+
<property name="child">
49+
<object class="AdwToolbarView">
50+
<child type="top">
51+
<object class="AdwHeaderBar">
52+
<child type="start">
53+
<object class="GtkToggleButton">
54+
<property name="icon-name">list-add-symbolic</property>
55+
<property name="tooltip-text" translatable="yes">New Collection</property>
56+
<property name="action-name">win.new-collection</property>
57+
</object>
58+
</child>
5259
</object>
5360
</child>
54-
</object>
55-
</child>
56-
<child>
57-
<object class="GtkScrolledWindow">
58-
<property name="vexpand">True</property>
59-
<property name="child">
60-
<object class="GtkListBox" id="collections_list">
61-
<style>
62-
<class name="navigation-sidebar" />
63-
</style>
61+
<property name="content">
62+
<object class="GtkScrolledWindow">
63+
<property name="child">
64+
<object class="GtkListBox" id="collections_list">
65+
<style>
66+
<class name="navigation-sidebar" />
67+
</style>
68+
</object>
69+
</property>
6470
</object>
6571
</property>
6672
</object>
67-
</child>
68-
</object>
69-
</child>
70-
<child>
71-
<object class="AdwLeafletPage">
72-
<property name="navigatable">False</property>
73-
<property name="child">
74-
<object class="GtkSeparator" />
7573
</property>
7674
</object>
77-
</child>
78-
<child>
79-
<object class="GtkBox">
80-
<property name="orientation">vertical</property>
81-
<property name="hexpand">True</property>
82-
<property name="width-request">250</property>
83-
<child>
84-
<object class="AdwHeaderBar">
85-
<property name="title-widget">
86-
<object class="AdwWindowTitle" />
87-
</property>
88-
<child type="start">
89-
<object class="GtkButton" id="back_button">
90-
<binding name="visible">
91-
<lookup name="folded">leaflet</lookup>
92-
</binding>
93-
<property name="icon-name">go-previous-symbolic</property>
94-
<property name="tooltip-text" translatable="yes">Back</property>
95-
</object>
96-
</child>
97-
<child type="end">
98-
<object class="GtkMenuButton">
99-
<property name="icon-name">open-menu-symbolic</property>
100-
<property name="menu-model">main-menu</property>
101-
<property name="tooltip-text" translatable="yes">Main Menu</property>
75+
</property>
76+
<property name="content">
77+
<object class="AdwNavigationPage">
78+
<property name="title" translatable="yes">Tasks</property>
79+
<property name="child">
80+
<object class="AdwToolbarView">
81+
<child type="top">
82+
<object class="AdwHeaderBar">
83+
<property name="show-title">False</property>
84+
<child type="end">
85+
<object class="GtkMenuButton">
86+
<property name="icon-name">open-menu-symbolic</property>
87+
<property name="menu-model">main-menu</property>
88+
<property name="tooltip-text" translatable="yes">Main Menu</property>
89+
</object>
90+
</child>
10291
</object>
10392
</child>
104-
</object>
105-
</child>
106-
<child>
107-
<object class="GtkScrolledWindow">
108-
<property name="vexpand">True</property>
109-
<property name="child">
110-
<object class="AdwClamp">
93+
<property name="content">
94+
<object class="GtkScrolledWindow">
11195
<property name="child">
112-
<object class="GtkBox">
113-
<property name="orientation">vertical</property>
114-
<property name="margin-top">12</property>
115-
<property name="margin-bottom">12</property>
116-
<property name="margin-start">12</property>
117-
<property name="margin-end">12</property>
118-
<property name="spacing">12</property>
119-
<child>
120-
<object class="GtkEntry" id="entry">
121-
<property name="placeholder-text" translatable="yes">Enter a Task…</property>
122-
<property name="secondary-icon-name">list-add-symbolic</property>
96+
<object class="AdwClamp">
97+
<property name="maximum-size">400</property>
98+
<property name="tightening-threshold">300</property>
99+
<property name="child">
100+
<object class="GtkBox">
101+
<property name="orientation">vertical</property>
102+
<property name="margin-start">12</property>
103+
<property name="margin-end">12</property>
104+
<property name="spacing">12</property>
105+
<child>
106+
<object class="GtkEntry" id="entry">
107+
<property name="placeholder-text" translatable="yes">Enter a Task…</property>
108+
<property name="secondary-icon-name">list-add-symbolic</property>
109+
</object>
110+
</child>
111+
<child>
112+
<object class="GtkListBox" id="tasks_list">
113+
<property name="visible">False</property>
114+
<property name="selection-mode">none</property>
115+
<style>
116+
<class name="boxed-list" />
117+
</style>
118+
</object>
119+
</child>
123120
</object>
124-
</child>
125-
<child>
126-
<object class="GtkListBox" id="tasks_list">
127-
<property name="visible">False</property>
128-
<property name="selection-mode">none</property>
129-
<style>
130-
<class name="boxed-list" />
131-
</style>
132-
</object>
133-
</child>
121+
</property>
134122
</object>
135123
</property>
136124
</object>
137125
</property>
138126
</object>
139-
</child>
127+
</property>
140128
</object>
141-
</child>
129+
</property>
142130
</object>
143131
</property>
144132
</template>

0 commit comments

Comments
 (0)