Skip to content

Commit

Permalink
feat: remove default album placeholder
Browse files Browse the repository at this point in the history
The image license of placeholder (from unsplash.com) is not compatible with the GPLv3 license (reference: https://wptavern.com/unsplash-updates-its-license-raises-gpl-compatibility-concerns).

The photo has been removed but the placeholder image still remains
configurable form the settings.
  • Loading branch information
ccatterina committed Aug 31, 2024
1 parent 84a2ac6 commit 2cd18f3
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 28 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,3 @@ To install the widget use one of these methods:
<p align="center">
<img src="./screenshots/screenshot_dark.png" /><img src="./screenshots/screenshot_light.png" />
</p>

## Credits

Album cover placeholder [photo](https://unsplash.com/photos/black-vinyl-record-on-white-background-aZVuQWEtX5Y) by [Brett Jordan](https://unsplash.com/@brett_jordan) on [Unsplash](https://unsplash.com/)
5 changes: 1 addition & 4 deletions src/contents/config/main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,7 @@
<entry name="desktopWidgetBg" type="Int">
<default>1</default>
</entry>
<entry name="useCustomAlbumPlaceholder" type="Bool">
<default>false</default>
</entry>
<entry name="customAlbumPlaceholder" type="String">
<entry name="albumPlaceholder" type="String">
<default></default>
</entry>
</group>
Expand Down
Binary file removed src/contents/images/vinyl-disk.jpg
Binary file not shown.
18 changes: 6 additions & 12 deletions src/contents/ui/ConfigGeneral.qml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ KCM.SimpleKCM {
property alias cfg_customFont: fontDialog.fontChosen
property alias cfg_volumeStep: volumeStepSpinbox.value
property alias cfg_desktopWidgetBg: desktopWidgetBackgroundRadio.value
property alias cfg_useCustomAlbumPlaceholder: customAlbumPlaceholderCheckbox.checked
property alias cfg_customAlbumPlaceholder: customAlbumPlaceholderDialog.value
property alias cfg_albumPlaceholder: albumPlaceholderDialog.value


Kirigami.FormLayout {
Expand Down Expand Up @@ -214,30 +213,25 @@ KCM.SimpleKCM {
}

RowLayout {
Kirigami.FormData.label: i18n("Custom album placeholder:")

CheckBox {
id: customAlbumPlaceholderCheckbox
}
Kirigami.FormData.label: i18n("Album placeholder:")

Button {
text: i18n("Choose…")
icon.name: "settings-configure"
enabled: customAlbumPlaceholderCheckbox.checked
onClicked: {
customAlbumPlaceholderDialog.open()
albumPlaceholderDialog.open()
}
}
}

ColumnLayout {
anchors.horizontalCenter: parent.horizontalCenter
visible: customAlbumPlaceholderCheckbox.checked && customAlbumPlaceholderDialog.value
visible: albumPlaceholderDialog.value
Image {
Layout.preferredWidth: 200
Layout.preferredHeight: 200
Layout.alignment: Qt.AlignHCenter
source: customAlbumPlaceholderDialog.value
source: albumPlaceholderDialog.value
}
}

Expand Down Expand Up @@ -311,7 +305,7 @@ KCM.SimpleKCM {
}

QtDialogs.FileDialog {
id: customAlbumPlaceholderDialog
id: albumPlaceholderDialog
property var value: null
onAccepted: value = selectedFile
}
Expand Down
9 changes: 1 addition & 8 deletions src/contents/ui/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -214,15 +214,8 @@ PlasmoidItem {
height: width

Image {
readonly property string albumPlaceholder: {
if (plasmoid.configuration.useCustomAlbumPlaceholder) {
return plasmoid.configuration.customAlbumPlaceholder
}
return '../images/vinyl-disk.jpg'
}

anchors.fill: parent
source: player.artUrl || albumPlaceholder
source: player.artUrl || plasmoid.configuration.albumPlaceholder
fillMode: Image.PreserveAspectFit
MouseArea {
id: coverMouseArea
Expand Down

0 comments on commit 2cd18f3

Please sign in to comment.