1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 21:42:51 -05:00

control center container width calculations

This commit is contained in:
bbedward
2025-08-28 10:46:42 -04:00
parent 77f40a7201
commit 29ee15e477
6 changed files with 33 additions and 5 deletions

View File

@@ -47,10 +47,13 @@ Column {
} }
StyledText { StyledText {
width: parent.parent.width - parent.anchors.leftMargin - Theme.spacingS - Theme.iconSize
text: "Current: " + (root.currentSinkDisplayName || "None") text: "Current: " + (root.currentSinkDisplayName || "None")
font.pixelSize: Theme.fontSizeMedium font.pixelSize: Theme.fontSizeMedium
color: Theme.primary color: Theme.primary
font.weight: Font.Medium font.weight: Font.Medium
elide: Text.ElideRight
wrapMode: Text.NoWrap
} }
} }
} }
@@ -73,6 +76,8 @@ Column {
Row { Row {
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: Theme.spacingM anchors.leftMargin: Theme.spacingM
anchors.right: parent.right
anchors.rightMargin: Theme.spacingM
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
spacing: Theme.spacingM spacing: Theme.spacingM
@@ -93,17 +98,22 @@ Column {
} }
Column { Column {
width: parent.width - parent.spacing - Theme.iconSize
spacing: 2 spacing: 2
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
StyledText { StyledText {
width: parent.width
text: AudioService.displayName(modelData) text: AudioService.displayName(modelData)
font.pixelSize: Theme.fontSizeMedium font.pixelSize: Theme.fontSizeMedium
color: modelData === AudioService.sink ? Theme.primary : Theme.surfaceText color: modelData === AudioService.sink ? Theme.primary : Theme.surfaceText
font.weight: modelData === AudioService.sink ? Font.Medium : Font.Normal font.weight: modelData === AudioService.sink ? Font.Medium : Font.Normal
elide: Text.ElideRight
wrapMode: Text.NoWrap
} }
StyledText { StyledText {
width: parent.width
text: { text: {
if (AudioService.subtitle(modelData.name) if (AudioService.subtitle(modelData.name)
&& AudioService.subtitle( && AudioService.subtitle(
@@ -118,6 +128,8 @@ Column {
Theme.surfaceText.g, Theme.surfaceText.g,
Theme.surfaceText.b, 0.7) Theme.surfaceText.b, 0.7)
visible: text !== "" visible: text !== ""
elide: Text.ElideRight
wrapMode: Text.NoWrap
} }
} }
} }

View File

@@ -47,10 +47,13 @@ Column {
} }
StyledText { StyledText {
width: parent.parent.width - parent.anchors.leftMargin - Theme.spacingS - Theme.iconSize
text: "Current: " + (root.currentSourceDisplayName || "None") text: "Current: " + (root.currentSourceDisplayName || "None")
font.pixelSize: Theme.fontSizeMedium font.pixelSize: Theme.fontSizeMedium
color: Theme.primary color: Theme.primary
font.weight: Font.Medium font.weight: Font.Medium
elide: Text.ElideRight
wrapMode: Text.NoWrap
} }
} }
} }
@@ -73,6 +76,8 @@ Column {
Row { Row {
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: Theme.spacingM anchors.leftMargin: Theme.spacingM
anchors.right: parent.right
anchors.rightMargin: Theme.spacingM
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
spacing: Theme.spacingM spacing: Theme.spacingM
@@ -91,17 +96,22 @@ Column {
} }
Column { Column {
width: parent.width - parent.spacing - Theme.iconSize
spacing: 2 spacing: 2
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
StyledText { StyledText {
width: parent.width
text: AudioService.displayName(modelData) text: AudioService.displayName(modelData)
font.pixelSize: Theme.fontSizeMedium font.pixelSize: Theme.fontSizeMedium
color: modelData === AudioService.source ? Theme.primary : Theme.surfaceText color: modelData === AudioService.source ? Theme.primary : Theme.surfaceText
font.weight: modelData === AudioService.source ? Font.Medium : Font.Normal font.weight: modelData === AudioService.source ? Font.Medium : Font.Normal
elide: Text.ElideRight
wrapMode: Text.NoWrap
} }
StyledText { StyledText {
width: parent.width
text: { text: {
if (AudioService.subtitle(modelData.name) if (AudioService.subtitle(modelData.name)
&& AudioService.subtitle( && AudioService.subtitle(
@@ -116,6 +126,8 @@ Column {
Theme.surfaceText.g, Theme.surfaceText.g,
Theme.surfaceText.b, 0.7) Theme.surfaceText.b, 0.7)
visible: text !== "" visible: text !== ""
elide: Text.ElideRight
wrapMode: Text.NoWrap
} }
} }
} }

View File

@@ -20,6 +20,7 @@ Column {
spacing: Theme.spacingM spacing: Theme.spacingM
StyledText { StyledText {
id: availableDevicesText
text: "Available Devices" text: "Available Devices"
font.pixelSize: Theme.fontSizeLarge font.pixelSize: Theme.fontSizeLarge
color: Theme.surfaceText color: Theme.surfaceText
@@ -28,15 +29,14 @@ Column {
} }
Item { Item {
width: parent.width - scanButton.width - parent.spacing width: parent.width - availableDevicesText.width - scanButton.width - parent.spacing * 2
- 150 // Spacer to push button right
height: 1 height: 1
} }
Rectangle { Rectangle {
id: scanButton id: scanButton
width: Math.max(100, scanText.contentWidth + Theme.spacingL * 2) width: Math.min(Math.max(100, scanText.contentWidth + Theme.spacingL * 2), parent.width * 0.3)
height: 32 height: 32
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: scanArea.containsMouse ? Qt.rgba(Theme.primary.r, color: scanArea.containsMouse ? Qt.rgba(Theme.primary.r,

View File

@@ -13,6 +13,7 @@ Item {
id: bluetoothTab id: bluetoothTab
property alias bluetoothContextMenuWindow: bluetoothContextMenuWindow property alias bluetoothContextMenuWindow: bluetoothContextMenuWindow
property alias contentHeight: mainColumn.height
DankFlickable { DankFlickable {
anchors.fill: parent anchors.fill: parent

View File

@@ -712,6 +712,7 @@ DankPopout {
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.05) Theme.outline.b, 0.05)
border.width: 1 border.width: 1
clip: true
Loader { Loader {
id: tabContentLoader id: tabContentLoader
@@ -751,7 +752,7 @@ DankPopout {
Component { Component {
id: bluetoothTabComponent id: bluetoothTabComponent
BluetoothTab { BluetoothTab {
implicitHeight: 400 implicitHeight: Math.max(300, contentHeight + Theme.spacingL)
} }
} }

View File

@@ -37,6 +37,7 @@ Column {
spacing: Theme.spacingS spacing: Theme.spacingS
StyledText { StyledText {
id: availableNetworksText
text: "Available Networks" text: "Available Networks"
font.pixelSize: Theme.fontSizeMedium font.pixelSize: Theme.fontSizeMedium
color: Theme.surfaceText color: Theme.surfaceText
@@ -45,11 +46,12 @@ Column {
} }
Item { Item {
width: parent.width - 170 width: parent.width - availableNetworksText.width - refreshButtonContainer.width - parent.spacing * 2
height: 1 height: 1
} }
Rectangle { Rectangle {
id: refreshButtonContainer
width: 28 width: 28
height: 28 height: 28
radius: 14 radius: 14