Fix NWidgetCard
This commit is contained in:
parent
017813ab57
commit
2a6ad0819f
7 changed files with 34 additions and 37 deletions
|
|
@ -11,8 +11,8 @@ Row {
|
|||
id: root
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: Style.marginS * scaling
|
||||
visible: MediaService.currentPlayer !== null
|
||||
width: MediaService.currentPlayer !== null ? implicitWidth : 0
|
||||
visible: MediaService.currentPlayer !== null && MediaService.canPlay
|
||||
width: MediaService.currentPlayer !== null && MediaService.canPlay ? implicitWidth : 0
|
||||
|
||||
function getTitle() {
|
||||
return MediaService.trackTitle + (MediaService.trackArtist !== "" ? ` - ${MediaService.trackArtist}` : "")
|
||||
|
|
|
|||
|
|
@ -38,7 +38,8 @@ NIconButton {
|
|||
}
|
||||
|
||||
function changeProfile() {
|
||||
if (!hasPP) return;
|
||||
if (!hasPP)
|
||||
return
|
||||
if (powerProfiles.profile === PowerProfile.Performance)
|
||||
powerProfiles.profile = PowerProfile.PowerSaver
|
||||
else if (powerProfiles.profile === PowerProfile.Balanced)
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@ ColumnLayout {
|
|||
spacing: Style.marginL * scaling
|
||||
Layout.fillWidth: true
|
||||
|
||||
|
||||
ColumnLayout {
|
||||
spacing: Style.marginXXS * scaling
|
||||
Layout.fillWidth: true
|
||||
|
|
@ -111,7 +110,6 @@ ColumnLayout {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
NToggle {
|
||||
label: "Show Active Window's Icon"
|
||||
description: "Display the app icon next to the title of the currently focused window."
|
||||
|
|
@ -130,7 +128,6 @@ ColumnLayout {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
NDivider {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: Style.marginL * scaling
|
||||
|
|
|
|||
|
|
@ -160,8 +160,6 @@ NBox {
|
|||
height: 90 * scaling
|
||||
radius: width * 0.5
|
||||
color: trackArt.visible ? Color.mPrimary : Color.transparent
|
||||
border.color: trackArt.visible ? Color.mOutline : Color.transparent
|
||||
border.width: Math.max(1, Style.borderS * scaling)
|
||||
clip: true
|
||||
|
||||
NImageCircled {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ ColumnLayout {
|
|||
property ListModel model: {
|
||||
|
||||
}
|
||||
property string currentKey: ''
|
||||
property string currentKey: ""
|
||||
property string placeholder: ""
|
||||
|
||||
signal selected(string key)
|
||||
|
|
|
|||
|
|
@ -58,23 +58,24 @@ NCard {
|
|||
description: ""
|
||||
placeholder: "Add widget to " + sectionName.toLowerCase() + " section"
|
||||
onSelected: key => {
|
||||
comboBox.selectedKey = key
|
||||
comboBox.currentKey = key
|
||||
}
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
|
||||
NIconButton {
|
||||
icon: "add"
|
||||
size: 24 * scaling
|
||||
|
||||
colorBg: Color.mPrimary
|
||||
colorFg: Color.mOnPrimary
|
||||
colorBgHover: Color.mPrimaryContainer
|
||||
colorFgHover: Color.mOnPrimaryContainer
|
||||
colorBgHover: Color.mSecondary
|
||||
colorFgHover: Color.mOnSecondary
|
||||
enabled: comboBox.selectedKey !== ""
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
onClicked: {
|
||||
if (comboBox.selectedKey !== "") {
|
||||
addWidget(comboBox.selectedKey, sectionName.toLowerCase())
|
||||
comboBox.reset()
|
||||
if (comboBox.currentKey !== "") {
|
||||
addWidget(comboBox.currentKey, sectionName.toLowerCase())
|
||||
comboBox.currentKey = ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue