Bar Volume: OnClick open SettingsPanel with audio tab focused
This commit is contained in:
parent
07b29ee873
commit
2fe3ad48a7
3 changed files with 8 additions and 24 deletions
|
|
@ -15,8 +15,6 @@ Variants {
|
|||
required property ShellScreen modelData
|
||||
readonly property real scaling: Scaling.scale(screen)
|
||||
|
||||
property var settingsPanel: null
|
||||
|
||||
screen: modelData
|
||||
implicitHeight: Style.barHeight * scaling
|
||||
color: "transparent"
|
||||
|
|
|
|||
|
|
@ -10,9 +10,6 @@ Item {
|
|||
width: pill.width
|
||||
height: pill.height
|
||||
|
||||
// Reference to settings panel
|
||||
property var settingsPanel: null
|
||||
|
||||
Component.onCompleted: {
|
||||
console.log("[Volume] settingsPanel received:", !!settingsPanel)
|
||||
}
|
||||
|
|
@ -87,15 +84,8 @@ Item {
|
|||
}
|
||||
}
|
||||
onClicked: {
|
||||
// Open settings panel and navigate to Audio tab
|
||||
console.log("[Volume] Attempting to open settings panel...")
|
||||
try {
|
||||
settingsPanel.isLoaded = true
|
||||
settingsPanel.content.currentTabIndex = 5 // Audio tab index
|
||||
console.log("[Volume] Settings panel opened successfully")
|
||||
} catch (error) {
|
||||
console.log("[Volume] Error opening settings panel:", error)
|
||||
}
|
||||
settingsPanel.currentTabIndex = 5 // Audio tab index
|
||||
settingsPanel.isLoaded = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ import qs.Widgets
|
|||
NLoader {
|
||||
id: root
|
||||
|
||||
property int currentTabIndex: 0
|
||||
|
||||
content: Component {
|
||||
NPanel {
|
||||
id: panel
|
||||
|
|
@ -18,7 +20,6 @@ NLoader {
|
|||
|
||||
WlrLayershell.keyboardFocus: WlrKeyboardFocus.OnDemand
|
||||
|
||||
property int currentTabIndex: 0
|
||||
property var tabsModel: [{
|
||||
"label": "General",
|
||||
"icon": "tune",
|
||||
|
|
@ -65,11 +66,6 @@ NLoader {
|
|||
"source": "Tabs/About.qml"
|
||||
}]
|
||||
|
||||
onVisibleChanged: {
|
||||
if (visible)
|
||||
currentTabIndex = 0
|
||||
}
|
||||
|
||||
Component.onCompleted: show()
|
||||
|
||||
Rectangle {
|
||||
|
|
@ -113,7 +109,7 @@ NLoader {
|
|||
|
||||
delegate: Rectangle {
|
||||
id: tabItem
|
||||
readonly property bool selected: index === panel.currentTabIndex
|
||||
readonly property bool selected: index === currentTabIndex
|
||||
width: parent.width
|
||||
height: 32 * scaling // Back to original height
|
||||
radius: Style.radiusSmall * scaling
|
||||
|
|
@ -154,7 +150,7 @@ NLoader {
|
|||
onEntered: tabItem.hovering = true
|
||||
onExited: tabItem.hovering = false
|
||||
onCanceled: tabItem.hovering = false
|
||||
onClicked: panel.currentTabIndex = index
|
||||
onClicked: currentTabIndex = index
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -185,7 +181,7 @@ NLoader {
|
|||
|
||||
// Tab label on the main right
|
||||
NText {
|
||||
text: panel.tabsModel[panel.currentTabIndex].label
|
||||
text: panel.tabsModel[currentTabIndex].label
|
||||
font.pointSize: Style.fontSizeLarge * scaling
|
||||
font.weight: Style.fontWeightBold
|
||||
color: Colors.accentPrimary
|
||||
|
|
@ -209,7 +205,7 @@ NLoader {
|
|||
id: stack
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
currentIndex: panel.currentTabIndex
|
||||
currentIndex: currentTabIndex
|
||||
|
||||
Tabs.General {}
|
||||
Tabs.Bar {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue