mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
activewindow-mediamini: support for colored text
This commit is contained in:
@@ -46,6 +46,8 @@ Item {
|
||||
// Maximum widget width with user settings support
|
||||
readonly property real maxWidth: (widgetSettings.maxWidth !== undefined) ? widgetSettings.maxWidth : Math.max(widgetMetadata.maxWidth || 0, screen ? screen.width * 0.06 : 0)
|
||||
readonly property bool useFixedWidth: (widgetSettings.useFixedWidth !== undefined) ? widgetSettings.useFixedWidth : (widgetMetadata.useFixedWidth || false)
|
||||
readonly property string textColorKey: (widgetSettings.textColor !== undefined) ? widgetSettings.textColor : widgetMetadata.textColor
|
||||
readonly property color textColor: Color.resolveColorKey(textColorKey)
|
||||
|
||||
readonly property string barPosition: Settings.getBarPositionForScreen(screenName)
|
||||
readonly property bool isVerticalBar: barPosition === "left" || barPosition === "right"
|
||||
@@ -274,7 +276,7 @@ Item {
|
||||
pointSize: barFontSize
|
||||
applyUiScale: false
|
||||
font.weight: Style.fontWeightMedium
|
||||
color: Color.mOnSurface
|
||||
color: root.textColor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,6 +53,8 @@ Item {
|
||||
readonly property bool showProgressRing: (widgetSettings.showProgressRing !== undefined) ? widgetSettings.showProgressRing : widgetMetadata.showProgressRing
|
||||
readonly property bool useFixedWidth: (widgetSettings.useFixedWidth !== undefined) ? widgetSettings.useFixedWidth : widgetMetadata.useFixedWidth
|
||||
readonly property real maxWidth: (widgetSettings.maxWidth !== undefined) ? widgetSettings.maxWidth : Math.max(widgetMetadata.maxWidth, screen ? screen.width * 0.06 : 0)
|
||||
readonly property string textColorKey: (widgetSettings.textColor !== undefined) ? widgetSettings.textColor : widgetMetadata.textColor
|
||||
readonly property color textColor: Color.resolveColorKey(textColorKey)
|
||||
|
||||
// Dimensions
|
||||
readonly property int artSize: Style.toOdd(capsuleHeight * 0.75)
|
||||
@@ -336,8 +338,7 @@ Item {
|
||||
maxWidth: root.maxWidth - root.mainContentWidth
|
||||
forcedHover: mainMouseArea.containsMouse
|
||||
NText {
|
||||
// anchors.fill: parent
|
||||
color: hasPlayer ? Color.mOnSurface : Color.mOnSurfaceVariant
|
||||
color: hasPlayer ? root.textColor : Color.mOnSurfaceVariant
|
||||
pointSize: barFontSize
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ ColumnLayout {
|
||||
property int valueMaxWidth: widgetData.maxWidth !== undefined ? widgetData.maxWidth : widgetMetadata.maxWidth
|
||||
property bool valueUseFixedWidth: widgetData.useFixedWidth !== undefined ? widgetData.useFixedWidth : widgetMetadata.useFixedWidth
|
||||
property bool valueColorizeIcons: widgetData.colorizeIcons !== undefined ? widgetData.colorizeIcons : widgetMetadata.colorizeIcons
|
||||
property string valueTextColor: widgetData.textColor !== undefined ? widgetData.textColor : widgetMetadata.textColor
|
||||
|
||||
Component.onCompleted: {
|
||||
if (widgetData && widgetData.hideMode !== undefined) {
|
||||
@@ -36,6 +37,7 @@ ColumnLayout {
|
||||
settings.maxWidth = parseInt(widthInput.text) || widgetMetadata.maxWidth;
|
||||
settings.useFixedWidth = valueUseFixedWidth;
|
||||
settings.colorizeIcons = valueColorizeIcons;
|
||||
settings.textColor = valueTextColor;
|
||||
return settings;
|
||||
}
|
||||
|
||||
@@ -64,6 +66,18 @@ ColumnLayout {
|
||||
}
|
||||
}
|
||||
|
||||
NComboBox {
|
||||
label: I18n.tr("common.select-color")
|
||||
description: I18n.tr("common.select-color-description")
|
||||
model: Color.colorKeyModel
|
||||
currentKey: valueTextColor
|
||||
onSelected: key => {
|
||||
valueTextColor = key;
|
||||
settingsChanged(saveSettings());
|
||||
}
|
||||
minimumWidth: 200
|
||||
}
|
||||
|
||||
NToggle {
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.active-window.show-app-icon-label")
|
||||
@@ -84,6 +98,7 @@ ColumnLayout {
|
||||
root.valueColorizeIcons = checked;
|
||||
settingsChanged(saveSettings());
|
||||
}
|
||||
visible: root.valueShowIcon
|
||||
}
|
||||
|
||||
NTextInput {
|
||||
|
||||
@@ -28,6 +28,7 @@ ColumnLayout {
|
||||
property bool valueUseFixedWidth: (widgetData && widgetData.useFixedWidth !== undefined) ? widgetData.useFixedWidth : (widgetMetadata && widgetMetadata.useFixedWidth !== undefined ? widgetMetadata.useFixedWidth : false)
|
||||
property bool valueShowProgressRing: (widgetData && widgetData.showProgressRing !== undefined) ? widgetData.showProgressRing : (widgetMetadata && widgetMetadata.showProgressRing !== undefined ? widgetMetadata.showProgressRing : true)
|
||||
property bool valueCompactMode: widgetData.compactMode !== undefined ? widgetData.compactMode : widgetMetadata.compactMode
|
||||
property string valueTextColor: (widgetData && widgetData.textColor !== undefined) ? widgetData.textColor : (widgetMetadata && widgetMetadata.textColor !== undefined ? widgetMetadata.textColor : "none")
|
||||
|
||||
Component.onCompleted: {
|
||||
if (widgetData && widgetData.hideMode !== undefined) {
|
||||
@@ -49,6 +50,7 @@ ColumnLayout {
|
||||
settings.useFixedWidth = valueUseFixedWidth;
|
||||
settings.showProgressRing = valueShowProgressRing;
|
||||
settings.compactMode = valueCompactMode;
|
||||
settings.textColor = valueTextColor;
|
||||
return settings;
|
||||
}
|
||||
|
||||
@@ -167,6 +169,18 @@ ColumnLayout {
|
||||
}
|
||||
}
|
||||
|
||||
NComboBox {
|
||||
label: I18n.tr("common.select-color")
|
||||
description: I18n.tr("common.select-color-description")
|
||||
model: Color.colorKeyModel
|
||||
currentKey: valueTextColor
|
||||
onSelected: key => {
|
||||
valueTextColor = key;
|
||||
settingsChanged(saveSettings());
|
||||
}
|
||||
minimumWidth: 200
|
||||
}
|
||||
|
||||
NComboBox {
|
||||
label: I18n.tr("bar.media-mini.scrolling-mode-label")
|
||||
description: I18n.tr("bar.media-mini.scrolling-mode-description")
|
||||
|
||||
@@ -82,7 +82,8 @@ Singleton {
|
||||
"scrollingMode": "hover",
|
||||
"maxWidth": 145,
|
||||
"useFixedWidth": false,
|
||||
"colorizeIcons": false
|
||||
"colorizeIcons": false,
|
||||
"textColor": "none"
|
||||
},
|
||||
"AudioVisualizer": {
|
||||
"width": 200,
|
||||
@@ -190,6 +191,7 @@ Singleton {
|
||||
"showVisualizer": false,
|
||||
"showProgressRing": true,
|
||||
"visualizerType": "linear",
|
||||
"textColor": "none",
|
||||
"compactMode": false,
|
||||
"panelShowAlbumArt": true,
|
||||
"panelShowVisualizer": true,
|
||||
|
||||
Reference in New Issue
Block a user