From 72e0eb59052fd5e3a8f228902ca09bab95680812 Mon Sep 17 00:00:00 2001 From: Rick Palmeira Date: Mon, 3 Aug 2020 04:19:47 -0300 Subject: [PATCH] :sparkles: Miniplayer improvements --- main.js | 6 ++- src/locales/scaffold.json | 1 + src/pages/miniplayer/miniplayer.css | 11 ++++-- src/pages/miniplayer/miniplayer.html | 4 -- src/pages/miniplayer/miniplayer.js | 1 + src/pages/settings/settings.html | 56 ++++++++++++++++++---------- src/pages/settings/settings.js | 1 + src/utils/defaultSettings.js | 4 +- 8 files changed, 55 insertions(+), 29 deletions(-) diff --git a/main.js b/main.js index 4345a90c7..4265764f5 100644 --- a/main.js +++ b/main.js @@ -964,11 +964,13 @@ function createWindow() { ), width: settingsProvider.get('settings-miniplayer-size'), height: settingsProvider.get('settings-miniplayer-size'), - backgroundColor: '#000000', + backgroundColor: '#232323', minWidth: 100, minHeight: 100, autoHideMenuBar: true, - skipTaskbar: false, + skipTaskbar: !settingsProvider.get( + 'settings-miniplayer-show-task' + ), webPreferences: { nodeIntegration: true, }, diff --git a/src/locales/scaffold.json b/src/locales/scaffold.json index 111cbbd65..dee7e82a0 100644 --- a/src/locales/scaffold.json +++ b/src/locales/scaffold.json @@ -52,6 +52,7 @@ "LABEL_SETTINGS_TAB_MINIPLAYER_ALWAYS_SHOW_CONTROLS": "Always show controls", "LABEL_SETTINGS_TAB_MINIPLAYER_PAINT_CONTROLS": "Paint controls with album color", "LABEL_SETTINGS_TAB_MINIPLAYER_RESIZABLE": "Allow resizing", + "LABEL_SETTINGS_TAB_MINIPLAYER_SHOW_TASK": "Show on taskbar", "LABEL_SETTINGS_TAB_RAINMETER_WEB_NOW_PLAYING": "Rainmeter (WebNowPlaying)", "LABEL_SETTINGS_TAB_READ_CLIPBOARD": "Read clipboard for youtube links", "LABEL_SETTINGS_TAB_SHORTCUTS": "Shortcuts", diff --git a/src/pages/miniplayer/miniplayer.css b/src/pages/miniplayer/miniplayer.css index cdf855263..01361d628 100644 --- a/src/pages/miniplayer/miniplayer.css +++ b/src/pages/miniplayer/miniplayer.css @@ -1,3 +1,8 @@ +body { + background-repeat: no-repeat; + background-size: 100vmin; +} + body:hover .player-info, body:hover .cmd-btn, body.showinfo .player-info, @@ -18,12 +23,12 @@ body.showinfo #background { .player-info { filter: opacity(0); - height: 78vmin + height: 78vmin; } .cmd-bar { margin: 4px 4px 0; - height: 10vmin + height: 10vmin; } #btn-drag { @@ -108,7 +113,7 @@ body.showinfo #background { .progress-bar { margin-top: 1.4vmin; height: 0.6vmin; - width: 100vw; + width: 100vmin; } #progress { diff --git a/src/pages/miniplayer/miniplayer.html b/src/pages/miniplayer/miniplayer.html index bbe18deab..501872d4f 100644 --- a/src/pages/miniplayer/miniplayer.html +++ b/src/pages/miniplayer/miniplayer.html @@ -70,10 +70,6 @@
- diff --git a/src/pages/miniplayer/miniplayer.js b/src/pages/miniplayer/miniplayer.js index 869cde931..376638be4 100644 --- a/src/pages/miniplayer/miniplayer.js +++ b/src/pages/miniplayer/miniplayer.js @@ -82,6 +82,7 @@ document.addEventListener('dblclick', (ev) => { function setPlayerInfo(data) { document.title = `${data.track.title} - ${data.track.author}` + body.style.backgroundImage = `url(${data.track.cover})` background.style.backgroundImage = `url(${data.track.cover})` title.innerHTML = data.track.title || 'Title' author.innerHTML = data.track.author || 'Author' diff --git a/src/pages/settings/settings.html b/src/pages/settings/settings.html index bcaf0c8a8..2b7b4b379 100644 --- a/src/pages/settings/settings.html +++ b/src/pages/settings/settings.html @@ -189,6 +189,25 @@ + + + + + +
+ +
+ + + - - - - - -
- -
- - -
+ + + + + +
+ +
+ +
diff --git a/src/pages/settings/settings.js b/src/pages/settings/settings.js index 91ae4accc..2c2126f3b 100644 --- a/src/pages/settings/settings.js +++ b/src/pages/settings/settings.js @@ -122,6 +122,7 @@ document.addEventListener('DOMContentLoaded', function () { initElement('settings-miniplayer-always-top', 'click') initElement('settings-miniplayer-resizable', 'click') + initElement('settings-miniplayer-show-task', 'click') initElement('settings-miniplayer-always-show-controls', 'click') initElement('settings-miniplayer-paint-controls', 'click') initElement('settings-enable-taskbar-progressbar', 'click') diff --git a/src/utils/defaultSettings.js b/src/utils/defaultSettings.js index 97db1782d..10fba5db7 100644 --- a/src/utils/defaultSettings.js +++ b/src/utils/defaultSettings.js @@ -18,7 +18,9 @@ settingsProvider.setInitialValue('settings-app-language', 'en') // English settingsProvider.setInitialValue('settings-miniplayer-size', '200') // Normal size -settingsProvider.setInitialValue('settings-miniplayer-resizable', true) // Normal size +settingsProvider.setInitialValue('settings-miniplayer-resizable', false) // Not resizable + +settingsProvider.setInitialValue('settings-miniplayer-show-task', false) // hide from taskbar settingsProvider.setInitialValue('settings-lyrics-provider', '1') // OVH