add config option to keep right sidebar loaded

This commit is contained in:
end-4
2025-08-02 20:31:37 +07:00
parent 88cc91b85a
commit 596ae72942
3 changed files with 18 additions and 8 deletions
@@ -235,6 +235,7 @@ Singleton {
} }
property JsonObject sidebar: JsonObject { property JsonObject sidebar: JsonObject {
property bool keepRightSidebarLoaded: true
property JsonObject translator: JsonObject { property JsonObject translator: JsonObject {
property int delay: 300 // Delay before sending request. Reduces (potential) rate limits and lag. property int delay: 300 // Delay before sending request. Reduces (potential) rate limits and lag.
} }
@@ -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 { ContentSection {
title: Translation.tr("On-screen display") title: Translation.tr("On-screen display")
ConfigSpinBox { ConfigSpinBox {
@@ -51,15 +51,10 @@ Scope {
Loader { Loader {
id: sidebarContentLoader id: sidebarContentLoader
active: GlobalStates.sidebarRightOpen active: GlobalStates.sidebarRightOpen || Config?.options.sidebar.keepRightSidebarLoaded
anchors { anchors {
top: parent.top fill: parent
bottom: parent.bottom margins: Appearance.sizes.hyprlandGapsOut
right: parent.right
left: parent.left
topMargin: Appearance.sizes.hyprlandGapsOut
rightMargin: Appearance.sizes.hyprlandGapsOut
bottomMargin: Appearance.sizes.hyprlandGapsOut
leftMargin: Appearance.sizes.elevationMargin leftMargin: Appearance.sizes.elevationMargin
} }
width: sidebarWidth - Appearance.sizes.hyprlandGapsOut - Appearance.sizes.elevationMargin width: sidebarWidth - Appearance.sizes.hyprlandGapsOut - Appearance.sizes.elevationMargin