From 81cc35702d5bec5d9cf0ea55e7352bee48b3f432 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Sun, 12 Oct 2025 19:53:42 +0200 Subject: [PATCH] sidebar: add option to disable translator tab --- .config/quickshell/ii/modules/common/Config.qml | 1 + .../quickshell/ii/modules/settings/InterfaceConfig.qml | 9 +++++++++ .../ii/modules/sidebarLeft/SidebarLeftContent.qml | 4 ++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.config/quickshell/ii/modules/common/Config.qml b/.config/quickshell/ii/modules/common/Config.qml index 6b872d79d..c1aea922e 100644 --- a/.config/quickshell/ii/modules/common/Config.qml +++ b/.config/quickshell/ii/modules/common/Config.qml @@ -346,6 +346,7 @@ Singleton { property JsonObject sidebar: JsonObject { property bool keepRightSidebarLoaded: true property JsonObject translator: JsonObject { + property bool enable: false property int delay: 300 // Delay before sending request. Reduces (potential) rate limits and lag. } property JsonObject ai: JsonObject { diff --git a/.config/quickshell/ii/modules/settings/InterfaceConfig.qml b/.config/quickshell/ii/modules/settings/InterfaceConfig.qml index 9e08b1d04..5b0dbb5e8 100644 --- a/.config/quickshell/ii/modules/settings/InterfaceConfig.qml +++ b/.config/quickshell/ii/modules/settings/InterfaceConfig.qml @@ -569,6 +569,15 @@ ContentPage { } } + ConfigSwitch { + buttonIcon: "translate" + text: Translation.tr('Enable translator') + checked: Config.options.sidebar.translator.enable + onCheckedChanged: { + Config.options.sidebar.translator.enable = checked; + } + } + ContentSubsection { title: Translation.tr("Corner open") tooltip: Translation.tr("Allows you to open sidebars by clicking or hovering screen corners regardless of bar position") diff --git a/.config/quickshell/ii/modules/sidebarLeft/SidebarLeftContent.qml b/.config/quickshell/ii/modules/sidebarLeft/SidebarLeftContent.qml index fc60618e0..ee5e1cccb 100644 --- a/.config/quickshell/ii/modules/sidebarLeft/SidebarLeftContent.qml +++ b/.config/quickshell/ii/modules/sidebarLeft/SidebarLeftContent.qml @@ -14,7 +14,7 @@ Item { anchors.fill: parent property var tabButtonList: [ ...(Config.options.policies.ai !== 0 ? [{"icon": "neurology", "name": Translation.tr("Intelligence")}] : []), - {"icon": "translate", "name": Translation.tr("Translator")}, + ...(Config.options.sidebar.translator.enable ? [{"icon": "translate", "name": Translation.tr("Translator")}] : []), ...(Config.options.policies.weeb === 1 ? [{"icon": "bookmark_heart", "name": Translation.tr("Anime")}] : []) ] property int selectedTab: 0 @@ -84,7 +84,7 @@ Item { contentChildren: [ ...(Config.options.policies.ai !== 0 ? [aiChat.createObject()] : []), - translator.createObject(), + ...(Config.options.sidebar.translator.enable ? [translator.createObject()] : []), ...(Config.options.policies.weeb === 0 ? [] : [anime.createObject()]) ] }