From 18990c5de72cd8d7c11fb2c785b5926c6282ac3a Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Mon, 2 Jun 2025 17:51:22 +0200 Subject: [PATCH] primary tab bar: adaptive layout --- .../quickshell/modules/common/widgets/PrimaryTabBar.qml | 9 +++++++++ .../modules/common/widgets/PrimaryTabButton.qml | 2 ++ .config/quickshell/shell.qml | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.config/quickshell/modules/common/widgets/PrimaryTabBar.qml b/.config/quickshell/modules/common/widgets/PrimaryTabBar.qml index 72ec166f2..a437da1cd 100644 --- a/.config/quickshell/modules/common/widgets/PrimaryTabBar.qml +++ b/.config/quickshell/modules/common/widgets/PrimaryTabBar.qml @@ -14,6 +14,14 @@ ColumnLayout { property color colBorder: Appearance?.m3colors.m3outlineVariant ?? "#C6C6D0" signal currentIndexChanged(int index) + property bool centerTabBar: { + console.log("PARREND WIDHTH", parent.width) + parent.width > 500 + } + Layout.fillWidth: !centerTabBar + Layout.alignment: Qt.AlignHCenter + implicitWidth: Math.max(tabBar.implicitWidth, 600) + TabBar { id: tabBar Layout.fillWidth: true @@ -40,6 +48,7 @@ ColumnLayout { selected: (index == root.externalTrackedTab) buttonText: modelData.name buttonIcon: modelData.icon + minimumWidth: 160 } } } diff --git a/.config/quickshell/modules/common/widgets/PrimaryTabButton.qml b/.config/quickshell/modules/common/widgets/PrimaryTabButton.qml index 73502cbcd..e59c8a962 100644 --- a/.config/quickshell/modules/common/widgets/PrimaryTabButton.qml +++ b/.config/quickshell/modules/common/widgets/PrimaryTabButton.qml @@ -12,10 +12,12 @@ TabButton { id: button property string buttonText property string buttonIcon + property real minimumWidth: 110 property bool selected: false property int tabContentWidth: contentItem.children[0].implicitWidth property int rippleDuration: 1200 height: buttonBackground.height + implicitWidth: Math.max(tabContentWidth, buttonBackground.implicitWidth, minimumWidth) property color colBackground: ColorUtils.transparentize(Appearance?.colors.colLayer1Hover, 1) || "transparent" property color colBackgroundHover: Appearance?.colors.colLayer1Hover ?? "#E5DFED" diff --git a/.config/quickshell/shell.qml b/.config/quickshell/shell.qml index 6c72df6db..ead113501 100644 --- a/.config/quickshell/shell.qml +++ b/.config/quickshell/shell.qml @@ -51,7 +51,7 @@ ShellRoot { Loader { active: enableBar; sourceComponent: Bar {} } Loader { active: enableCheatsheet; sourceComponent: Cheatsheet {} } - Loader { active: enableDock || ConfigOptions?.dock.enable; sourceComponent: Dock {} } + Loader { active: (enableDock || ConfigOptions?.dock.enable); sourceComponent: Dock {} } Loader { active: enableMediaControls; sourceComponent: MediaControls {} } Loader { active: enableNotificationPopup; sourceComponent: NotificationPopup {} } Loader { active: enableOnScreenDisplayBrightness; sourceComponent: OnScreenDisplayBrightness {} }