From 596ae72942561457c902542e2556578ec7bf668e Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Sat, 2 Aug 2025 20:31:37 +0700 Subject: [PATCH] add config option to keep right sidebar loaded --- .config/quickshell/ii/modules/common/Config.qml | 1 + .../ii/modules/settings/InterfaceConfig.qml | 14 ++++++++++++++ .../ii/modules/sidebarRight/SidebarRight.qml | 11 +++-------- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.config/quickshell/ii/modules/common/Config.qml b/.config/quickshell/ii/modules/common/Config.qml index 476047a64..bcbbd1e33 100644 --- a/.config/quickshell/ii/modules/common/Config.qml +++ b/.config/quickshell/ii/modules/common/Config.qml @@ -235,6 +235,7 @@ Singleton { } property JsonObject sidebar: JsonObject { + property bool keepRightSidebarLoaded: true property JsonObject translator: JsonObject { property int delay: 300 // Delay before sending request. Reduces (potential) rate limits and lag. } diff --git a/.config/quickshell/ii/modules/settings/InterfaceConfig.qml b/.config/quickshell/ii/modules/settings/InterfaceConfig.qml index c27905479..4d86ffff7 100644 --- a/.config/quickshell/ii/modules/settings/InterfaceConfig.qml +++ b/.config/quickshell/ii/modules/settings/InterfaceConfig.qml @@ -335,6 +335,20 @@ ContentPage { } } + ContentSection { + title: Translation.tr("Sidebars") + ConfigSwitch { + text: Translation.tr('Keep right sidebar loaded') + checked: Config.options.sidebar.keepRightSidebarLoaded + onCheckedChanged: { + Config.options.sidebar.keepRightSidebarLoaded = checked; + } + StyledToolTip { + content: Translation.tr("When enabled keeps the content of the right sidebar loaded to reduce the delay when opening,\nat the cost of around 15MB of consistent RAM usage. Delay significance depends on your system's performance.\nUsing a different kernel might help with this delay") + } + } + } + ContentSection { title: Translation.tr("On-screen display") ConfigSpinBox { diff --git a/.config/quickshell/ii/modules/sidebarRight/SidebarRight.qml b/.config/quickshell/ii/modules/sidebarRight/SidebarRight.qml index ce0ff77a5..3d2c406ca 100644 --- a/.config/quickshell/ii/modules/sidebarRight/SidebarRight.qml +++ b/.config/quickshell/ii/modules/sidebarRight/SidebarRight.qml @@ -51,15 +51,10 @@ Scope { Loader { id: sidebarContentLoader - active: GlobalStates.sidebarRightOpen + active: GlobalStates.sidebarRightOpen || Config?.options.sidebar.keepRightSidebarLoaded anchors { - top: parent.top - bottom: parent.bottom - right: parent.right - left: parent.left - topMargin: Appearance.sizes.hyprlandGapsOut - rightMargin: Appearance.sizes.hyprlandGapsOut - bottomMargin: Appearance.sizes.hyprlandGapsOut + fill: parent + margins: Appearance.sizes.hyprlandGapsOut leftMargin: Appearance.sizes.elevationMargin } width: sidebarWidth - Appearance.sizes.hyprlandGapsOut - Appearance.sizes.elevationMargin