Skip to content
Open
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
2 changes: 2 additions & 0 deletions TaskbarLyrics.App/AppSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ public sealed class AppSettings

public string ForegroundColor { get; set; } = LightForegroundColor;

public bool ShowCover { get; set; } = true;

public bool ShowBackground { get; set; } = false;

public double BackgroundOpacity { get; set; } = 0.55;
Expand Down
3 changes: 2 additions & 1 deletion TaskbarLyrics.App/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,8 @@ private void PushStyleToWebView(AppSettings settings)
: "none",
textShadow = settings.ShowTextShadow
? "0 1px 2px rgba(0, 0, 0, 0.36)"
: "none"
: "none",
showCover = settings.ShowCover
};

var payloadJson = JsonSerializer.Serialize(stylePayload);
Expand Down
6 changes: 6 additions & 0 deletions TaskbarLyrics.App/SettingsWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ private WebSettingsPayload CreateSettingsPayload()
FontWeight = NormalizeFontWeight(_settings.FontWeight),
ForegroundColorMode = _settings.ForegroundColorMode,
ForegroundColor = _settings.ForegroundColor,
ShowCover = _settings.ShowCover,
ShowBackground = _settings.ShowBackground,
BackgroundOpacity = _settings.BackgroundOpacity,
ShowBorder = _settings.ShowBorder,
Expand Down Expand Up @@ -388,6 +389,9 @@ private void ApplyWebSettingUpdate(string? key, JsonElement? value)
case "showSpectrumWhenLyricsNotFound":
_settings.ShowSpectrumWhenLyricsNotFound = ReadBool(element, _settings.ShowSpectrumWhenLyricsNotFound);
break;
case "showCover":
_settings.ShowCover = ReadBool(element, _settings.ShowCover);
break;
case "showBackground":
_settings.ShowBackground = ReadBool(element, _settings.ShowBackground);
break;
Expand Down Expand Up @@ -705,6 +709,7 @@ private static void CopySettings(AppSettings source, AppSettings target)
target.FontWeight = source.FontWeight;
target.ForegroundColorMode = source.ForegroundColorMode;
target.ForegroundColor = source.ForegroundColor;
target.ShowCover = source.ShowCover;
target.ShowBackground = source.ShowBackground;
target.BackgroundOpacity = source.BackgroundOpacity;
target.ShowBorder = source.ShowBorder;
Expand Down Expand Up @@ -904,6 +909,7 @@ private sealed class WebSettingsPayload
public string FontWeight { get; set; } = "";
public ForegroundColorMode ForegroundColorMode { get; set; }
public string ForegroundColor { get; set; } = "";
public bool ShowCover { get; set; }
public bool ShowBackground { get; set; }
public double BackgroundOpacity { get; set; }
public bool ShowBorder { get; set; }
Expand Down
6 changes: 6 additions & 0 deletions TaskbarLyrics.App/Web/Lyrics/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -861,5 +861,11 @@ window.taskbarLyrics = {
if (payload.textShadow && CSS.supports("text-shadow", payload.textShadow)) {
root.style.setProperty("--text-shadow", payload.textShadow);
}

if (payload.showCover === false) {
document.body.classList.add("hide-cover");
} else {
document.body.classList.remove("hide-cover");
}
}
};
9 changes: 9 additions & 0 deletions TaskbarLyrics.App/Web/Lyrics/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,15 @@ html, body {
opacity: 0.58;
}

body.hide-cover .shell {
grid-template-columns: minmax(0, 1fr);
}

body.hide-cover .cover,
body.hide-cover .cover + div {
display: none;
}

.cover-image {
position: absolute;
inset: 0;
Expand Down
1 change: 1 addition & 0 deletions TaskbarLyrics.App/Web/Settings/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ <h2>歌词设置</h2>
<label class="row"><span><strong>显示频谱</strong><small>启用后,可在特定歌词状态下显示实时音频频谱。</small></span><input data-key="enableSpectrum" type="checkbox"></label>
<label class="row child-row spectrum-child"><span><strong>纯音乐时显示频谱</strong><small>歌曲识别为纯音乐时,在歌词区域显示实时频谱。</small></span><input data-key="enablePureMusicSpectrum" type="checkbox"></label>
<label class="row child-row spectrum-child"><span><strong>未检索到歌词时显示频谱</strong><small>歌词源没有返回可用歌词时,用频谱替代“暂未找到歌词”。</small></span><input data-key="showSpectrumWhenLyricsNotFound" type="checkbox"></label>
<label class="row"><span><strong>显示歌曲封面</strong><small>在歌词窗口左侧显示歌曲封面图片。</small></span><input data-key="showCover" type="checkbox"></label>
<label class="row"><span><strong>显示背景</strong><small>为歌词窗口启用半透明背景。</small></span><input data-key="showBackground" type="checkbox"></label>
<label class="row"><span><strong>显示边框</strong><small>为歌词窗口绘制边框,便于深浅背景上分辨。</small></span><input data-key="showBorder" type="checkbox"></label>
</div>
Expand Down