Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions quickshell/Common/SettingsData.qml
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ Singleton {
property bool scrollTitleEnabled: true
property bool mediaAdaptiveWidthEnabled: true
property bool audioVisualizerEnabled: true
property bool mediaUseAlbumArtAccent: false
property string audioScrollMode: "volume"
property int audioWheelScrollAmount: 5
property bool audioDeviceScrollVolumeEnabled: false
Expand Down
1 change: 1 addition & 0 deletions quickshell/Common/settings/SettingsSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ var SPEC = {
scrollTitleEnabled: { def: true },
mediaAdaptiveWidthEnabled: { def: true },
audioVisualizerEnabled: { def: true },
mediaUseAlbumArtAccent: { def: false },
audioScrollMode: { def: "volume" },
audioWheelScrollAmount: { def: 5 },
audioDeviceScrollVolumeEnabled: { def: false },
Expand Down
7 changes: 7 additions & 0 deletions quickshell/Modules/Settings/MediaPlayerTab.qml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ Item {
onToggled: checked => SettingsData.set("mediaAdaptiveWidthEnabled", checked)
}

SettingsToggleRow {
text: I18n.tr("Use album art accent")
description: I18n.tr("Use colors extracted from album art instead of system theme colors")
checked: SettingsData.mediaUseAlbumArtAccent
onToggled: checked => SettingsData.set("mediaUseAlbumArtAccent", checked)
}

SettingsDropdownRow {
property var scrollOptsInternal: ["volume", "song", "nothing"]
property var scrollOptsDisplay: [I18n.tr("Change Volume", "media scroll wheel option"), I18n.tr("Change Song", "media scroll wheel option"), I18n.tr("Nothing", "media scroll wheel option")]
Expand Down
11 changes: 5 additions & 6 deletions quickshell/Services/MediaAccentService.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ import qs.Services
Singleton {
id: root

readonly property bool hasAccent: _accent !== null
readonly property color accent: _accent !== null ? _accent : Theme.primary
readonly property bool hasAccent: SettingsData.mediaUseAlbumArtAccent ? _accent !== null : true
readonly property color accent: SettingsData.mediaUseAlbumArtAccent && _accent !== null ? _accent : Theme.primary

readonly property color onAccent: {
const c = accent;
const lum = 0.2126 * c.r + 0.7152 * c.g + 0.0722 * c.b;
readonly property color onAccent: SettingsData.mediaUseAlbumArtAccent && _accent !== null ? (() => {
const lum = 0.2126 * _accent.r + 0.7152 * _accent.g + 0.0722 * _accent.b;
return lum > 0.6 ? Qt.rgba(0, 0, 0, 1) : Qt.rgba(1, 1, 1, 1);
}
})() : Theme.onPrimary

readonly property color accentHover: Theme.withAlpha(accent, 0.12)
readonly property color accentPressed: Theme.withAlpha(accent, Theme.transparentBlurLayers ? 0.24 : 0.16)
Expand Down
Loading