mirror of
https://github.com/end-4/dots-hyprland.git
synced 2026-06-06 07:19:27 -05:00
primary tab bar: adaptive layout
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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 {} }
|
||||
|
||||
Reference in New Issue
Block a user