Skip to content

Commit 9290f99

Browse files
committed
Close the split view if it's collapsed and the user has clicked on an element
1 parent 4c942e3 commit 9290f99

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/ui/window.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,17 @@ impl MainWindow {
330330
.sync_create()
331331
.bidirectional()
332332
.build();
333+
334+
// close the split view if we're in "mobile layout" and the user has clicked on an element
335+
imp.content_stack.connect_visible_child_notify(clone!(
336+
#[weak]
337+
imp,
338+
move |_| {
339+
if imp.split_view.is_collapsed() {
340+
imp.split_view.set_show_sidebar(false);
341+
}
342+
}
343+
));
333344
}
334345

335346
fn get_selected_page(&self) -> Option<Widget> {

0 commit comments

Comments
 (0)