Open every bar module cog inline
The cog on Clock, Workspaces, Tray, Volume and the metrics modules used to jump to another settings page while the rest opened in the card. Now every cog opens its options in the card, editing the same shared settings as the pages. Modules with more on a page (Volume → OSD, metrics → Metrics) end with an "All … settings →" link. System has no options of its own, so it has no cog. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f756d37f6d
commit
629287f7f3
2 files changed
+69
-23
No files matched your search
@@ -107,7 +107,7 @@ Item {
|
||||
id:card
|
||||
required property var modelData
|
||||
readonly property var schema:root.fieldsFor(modelData.id)
|
||||
readonly property var link:ModuleRegistry.settingsLinks[modelData.id] || null
|
||||
readonly property var link:ModuleRegistry.moreSettings[modelData.id] || null
|
||||
readonly property bool expanded:root.expandedId===modelData.id && schema.length>0
|
||||
Layout.fillWidth:true
|
||||
implicitHeight:52+(expanded ? optionsColumn.implicitHeight+4 : 0)
|
||||
@@ -153,10 +153,10 @@ Item {
|
||||
}
|
||||
}
|
||||
Text {text:ModuleRegistry.title(card.modelData.id);color:Theme.text;Layout.fillWidth:true;elide:Text.ElideRight;font.pixelSize:12}
|
||||
// Cog: module options inline, or the page that holds them.
|
||||
// Cog: the module's options, always inline.
|
||||
Rectangle {
|
||||
objectName:"bar-options-"+card.modelData.id
|
||||
visible:card.schema.length>0 || !!card.link
|
||||
visible:card.schema.length>0
|
||||
implicitWidth:26;implicitHeight:26;radius:13
|
||||
color:card.expanded ? Qt.alpha(Theme.accent,0.3) : cogArea.containsMouse ? Theme.hover : Qt.alpha(Theme.text,0.06)
|
||||
Accessible.name:"Options for "+card.modelData.id
|
||||
@@ -167,10 +167,7 @@ Item {
|
||||
anchors.fill:parent
|
||||
hoverEnabled:true
|
||||
cursorShape:Qt.PointingHandCursor
|
||||
onClicked:{
|
||||
if(card.schema.length>0)root.expandedId=card.expanded ? "" : card.modelData.id;
|
||||
else if(card.link)ShellState.revealSetting(card.link.page,card.link.setting);
|
||||
}
|
||||
onClicked:root.expandedId=card.expanded ? "" : card.modelData.id
|
||||
}
|
||||
}
|
||||
GlassToggle {objectName:"bar-enable-"+card.modelData.id;checked:card.modelData.enabled;onToggled:root.save(Logic.editModule(root.modules,card.modelData.id,"enabled",checked))}
|
||||
@@ -218,7 +215,7 @@ Item {
|
||||
visible:optionRow.modelData.type==="choice"
|
||||
Layout.preferredWidth:110
|
||||
implicitHeight:30
|
||||
model:optionRow.modelData.choices.map(c=>({text:String(c).charAt(0).toUpperCase()+String(c).slice(1),value:c}))
|
||||
model:optionRow.modelData.choices.map((c,i)=>({text:optionRow.modelData.choiceLabels ? optionRow.modelData.choiceLabels[i] : String(c).charAt(0).toUpperCase()+String(c).slice(1),value:c}))
|
||||
textRole:"text"
|
||||
valueRole:"value"
|
||||
currentIndex:optionRow.modelData.choices.indexOf(optionRow.value)
|
||||
@@ -254,6 +251,23 @@ Item {
|
||||
}
|
||||
}
|
||||
}
|
||||
// The rest of the module's settings, on their page.
|
||||
Text {
|
||||
objectName:"bar-more-"+card.modelData.id
|
||||
visible:!!card.link
|
||||
text:card.link ? "All "+card.link.title+" settings →" : ""
|
||||
color:moreArea.containsMouse ? Theme.text : Theme.accent
|
||||
font.pixelSize:11
|
||||
Layout.topMargin:2
|
||||
Layout.bottomMargin:4
|
||||
MouseArea {
|
||||
id:moreArea
|
||||
anchors.fill:parent
|
||||
hoverEnabled:true
|
||||
cursorShape:Qt.PointingHandCursor
|
||||
onClicked:ShellState.revealSetting(card.link.page,"")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user