@@ -119,45 +119,9 @@ template $Content: Adw.BreakpointBin {
119119 ]
120120 }
121121
122- content: ScrolledWindow {
123- hscrollbar-policy: never;
124-
125- child: ListBox sidebar {
126- row-selected => $_on_row_selected();
127-
128- $NavigationRow {
129- page: bind inbox_page;
130- }
131-
132- $NavigationRow {
133- page: bind outbox_page;
134- }
135-
136- $NavigationRow {
137- page: bind sent_page;
138- }
139-
140- $NavigationRow {
141- page: bind drafts_page;
142- }
143-
144- $NavigationRow {
145- page: bind trash_page;
146- }
147-
148- $NavigationRow {
149- page: bind broadcasts_page;
150- separator: true;
151- }
152-
153- $NavigationRow {
154- page: bind contacts_page;
155- }
156-
157- styles [
158- "navigation-sidebar",
159- ]
160- };
122+ content: Adw.ViewSwitcherSidebar {
123+ stack: stack;
124+ activated => $_close_sidebar();
161125 };
162126 };
163127 };
@@ -168,51 +132,57 @@ template $Content: Adw.BreakpointBin {
168132 child: Adw.ViewStack stack {
169133 enable-transitions: true;
170134
171- Adw.ViewStackPage inbox_page {
135+ Adw.ViewStackPage {
172136 icon-name: "inbox-symbolic";
173137 title: bind inbox.title;
138+ badge-number: bind inbox.counter;
174139
175140 child: $Inbox inbox {};
176141 }
177142
178- Adw.ViewStackPage outbox_page {
143+ Adw.ViewStackPage {
179144 icon-name: "outbox-symbolic";
180145 title: bind outbox.title;
181146
182147 child: $Outbox outbox {};
183148 }
184149
185- Adw.ViewStackPage sent_page {
150+ Adw.ViewStackPage {
186151 icon-name: "sent-symbolic";
187152 title: bind sent.title;
188153
189154 child: $Sent sent {};
190155 }
191156
192- Adw.ViewStackPage drafts_page {
157+ Adw.ViewStackPage {
193158 icon-name: "drafts-symbolic";
194159 title: bind drafts.title;
160+ badge-number: bind drafts.counter;
195161
196162 child: $Drafts drafts {};
197163 }
198164
199- Adw.ViewStackPage trash_page {
165+ Adw.ViewStackPage {
200166 icon-name: "trash-symbolic";
201167 title: bind trash.title;
168+ badge-number: bind trash.counter;
202169
203170 child: $Trash trash {};
204171 }
205172
206- Adw.ViewStackPage broadcasts_page {
173+ Adw.ViewStackPage {
174+ starts-section: true;
207175 icon-name: "broadcasts-symbolic";
208176 title: bind broadcasts.title;
177+ badge-number: bind broadcasts.counter;
209178
210179 child: $Broadcasts broadcasts {};
211180 }
212181
213- Adw.ViewStackPage contacts_page {
182+ Adw.ViewStackPage {
214183 icon-name: "contacts-symbolic";
215184 title: bind contacts.title;
185+ badge-number: bind contacts.counter;
216186
217187 child: $Contacts contacts {};
218188 }
0 commit comments