mirror of
https://github.com/morgan9e/warehouse
synced 2026-04-14 00:04:08 +09:00
Fix bug causing activated navigation sidebar row to not match visible page on startup
This commit is contained in:
@@ -7,10 +7,10 @@ template $WarehouseWindow: Adw.ApplicationWindow {
|
||||
default-width: 921;
|
||||
default-height: 450;
|
||||
Adw.Breakpoint main_breakpoint {
|
||||
condition ("min-width: 865")
|
||||
condition ("max-width: 865")
|
||||
setters {
|
||||
main_split.collapsed: false;
|
||||
main_split.max-sidebar-width: 999999999;
|
||||
main_split.collapsed: true;
|
||||
main_split.min-sidebar-width: 0.2;
|
||||
}
|
||||
}
|
||||
content:
|
||||
@@ -28,9 +28,9 @@ template $WarehouseWindow: Adw.ApplicationWindow {
|
||||
}
|
||||
}
|
||||
Adw.OverlaySplitView main_split {
|
||||
collapsed: true;
|
||||
collapsed: false;
|
||||
show-sidebar: true;
|
||||
sidebar-width-fraction: 0.2;
|
||||
sidebar-width-fraction: 999999999;
|
||||
min-sidebar-width: 250;
|
||||
sidebar:
|
||||
Adw.NavigationPage {
|
||||
|
||||
@@ -89,12 +89,13 @@ class WarehouseWindow(Adw.ApplicationWindow):
|
||||
self.refresh_button.set_sensitive(True)
|
||||
|
||||
def navigation_handler(self, _, row):
|
||||
if self.main_split.get_collapsed():
|
||||
self.main_split.set_show_sidebar(False)
|
||||
|
||||
row = row.get_child()
|
||||
page = self.pages[row]
|
||||
self.stack.set_visible_child(page)
|
||||
self.settings.set_string("page-shown", page.page_name)
|
||||
if self.main_split.get_collapsed():
|
||||
self.main_split.set_show_sidebar(False)
|
||||
|
||||
def activate_row(self, nav_row):
|
||||
idx = 0
|
||||
@@ -102,7 +103,6 @@ class WarehouseWindow(Adw.ApplicationWindow):
|
||||
idx += 1
|
||||
if row.get_child() is nav_row:
|
||||
row.activate()
|
||||
nav_row.grab_focus()
|
||||
break
|
||||
|
||||
def show_saved_page(self):
|
||||
|
||||
Reference in New Issue
Block a user