fix(ui): improve contrast and theme consistency
- Fix Dropdown selected option contrast in Light and Warm themes - Improve QualityBadge border contrast in Light theme (AlbumCard and NowPlayingBar) - Add custom artist image upload button in LocalLibrary (visible only when settings panel is open) - Position upload button at top-right of artist card, consistent with other edit buttons cp
This commit is contained in:
1 parent
031cc3e081
commit
60180c179b
4 files changed
+85
-1
No files matched your search
@@ -281,6 +281,12 @@
|
||||
padding: 2px 6px;
|
||||
}
|
||||
|
||||
[data-theme="light"] .quality-badge {
|
||||
color: rgba(40, 42, 54, 0.85);
|
||||
background: rgba(40, 42, 54, 0.08);
|
||||
border: 1px solid rgba(40, 42, 54, 0.2);
|
||||
}
|
||||
|
||||
.play-overlay {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
|
||||
@@ -148,7 +148,13 @@
|
||||
}
|
||||
|
||||
.option.selected {
|
||||
background-color: var(--bg-hover);
|
||||
background-color: rgba(66, 133, 244, 0.15);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
[data-theme="light"] .option.selected,
|
||||
[data-theme="warm"] .option.selected {
|
||||
background-color: rgba(var(--accent-primary), 0.15);
|
||||
color: var(--accent-primary);
|
||||
}
|
||||
</style>
|
||||
@@ -113,6 +113,11 @@
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
[data-theme="light"] .quality-badge {
|
||||
background: rgba(40, 42, 54, 0.06);
|
||||
border: 1px solid rgba(40, 42, 54, 0.15);
|
||||
}
|
||||
|
||||
.badge-icon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
|
||||
@@ -1049,6 +1049,39 @@
|
||||
await fetchMissingArtistImages();
|
||||
}
|
||||
|
||||
/**
|
||||
* Upload custom artist image
|
||||
*/
|
||||
async function handleUploadArtistImage(artistName: string, event?: Event) {
|
||||
event?.stopPropagation();
|
||||
try {
|
||||
const selected = await open({
|
||||
multiple: false,
|
||||
filters: [{
|
||||
name: 'Image',
|
||||
extensions: ['jpg', 'jpeg', 'png', 'webp']
|
||||
}]
|
||||
});
|
||||
|
||||
if (!selected) return;
|
||||
|
||||
const imagePath = Array.isArray(selected) ? selected[0] : selected;
|
||||
|
||||
// Save to database
|
||||
await invoke('library_set_custom_artist_image', {
|
||||
artistName,
|
||||
imagePath
|
||||
});
|
||||
|
||||
// Update local state
|
||||
const imageUrl = convertFileSrc(imagePath);
|
||||
artistImages.set(artistName, imageUrl);
|
||||
artistImages = new Map(artistImages);
|
||||
} catch (err) {
|
||||
console.error('Failed to upload custom artist image:', err);
|
||||
}
|
||||
}
|
||||
|
||||
function handleLocalAlbumLink(track: LocalTrack) {
|
||||
if (!track.album_group_key) return;
|
||||
const album = albums.find(item => item.id === track.album_group_key);
|
||||
@@ -1701,6 +1734,15 @@
|
||||
<Mic2 size={32} />
|
||||
{/if}
|
||||
</div>
|
||||
{#if showSettings}
|
||||
<button
|
||||
class="artist-image-btn"
|
||||
onclick={(e) => handleUploadArtistImage(artist.name, e)}
|
||||
title="Upload custom image"
|
||||
>
|
||||
<Upload size={14} />
|
||||
</button>
|
||||
{/if}
|
||||
<div class="artist-name">{artist.name}</div>
|
||||
<div class="artist-stats">
|
||||
{artist.album_count} albums • {artist.track_count} tracks
|
||||
@@ -2771,6 +2813,7 @@
|
||||
}
|
||||
|
||||
.artist-card {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
@@ -2785,6 +2828,30 @@
|
||||
background: var(--bg-tertiary);
|
||||
}
|
||||
|
||||
.artist-image-btn {
|
||||
position: absolute;
|
||||
top: 12px;
|
||||
right: 12px;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
border: 1px solid rgba(255, 255, 255, 0.15);
|
||||
border-radius: 6px;
|
||||
color: var(--text-primary);
|
||||
cursor: pointer;
|
||||
transition: all 150ms ease;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.artist-image-btn:hover {
|
||||
background: rgba(0, 0, 0, 0.8);
|
||||
border-color: var(--accent-primary);
|
||||
color: var(--accent-primary);
|
||||
}
|
||||
|
||||
.artist-icon {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
|
||||
Reference in new issue
Block a user