fix: MiniPlayer size 400x200, queue state null check, UI adjustments
- Changed dimensions to 400x200 - Reduced shadow area padding from 8px to 4px - Added 6px margin around album art - Fixed TypeError on qState.tracks.length with null checks - Increased font sizes and control button sizes for larger window
This commit is contained in:
1 parent
b186119221
commit
0aeb4fbbcc
3 files changed
+36
-29
No files matched your search
@@ -11,8 +11,8 @@ import { getCurrentWindow } from '@tauri-apps/api/window';
|
|||||||
import { goto } from '$app/navigation';
|
import { goto } from '$app/navigation';
|
||||||
|
|
||||||
// Miniplayer dimensions
|
// Miniplayer dimensions
|
||||||
const MINIPLAYER_WIDTH = 300;
|
const MINIPLAYER_WIDTH = 400;
|
||||||
const MINIPLAYER_HEIGHT = 140;
|
const MINIPLAYER_HEIGHT = 200;
|
||||||
|
|
||||||
// Original app minimum size (from tauri.conf.json)
|
// Original app minimum size (from tauri.conf.json)
|
||||||
const ORIGINAL_MIN_WIDTH = 800;
|
const ORIGINAL_MIN_WIDTH = 800;
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
height: 100vh;
|
height: 100vh;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
padding: 8px;
|
padding: 4px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -73,15 +73,19 @@
|
|||||||
|
|
||||||
unsubscribeQueue = subscribeQueue(() => {
|
unsubscribeQueue = subscribeQueue(() => {
|
||||||
const qState = getQueueState();
|
const qState = getQueueState();
|
||||||
isShuffle = qState.isShuffle;
|
if (qState) {
|
||||||
repeatMode = qState.repeatMode;
|
isShuffle = qState.isShuffle ?? false;
|
||||||
queueCount = qState.tracks.length;
|
repeatMode = qState.repeatMode ?? 'off';
|
||||||
|
queueCount = qState.tracks?.length ?? 0;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const qState = getQueueState();
|
const qState = getQueueState();
|
||||||
isShuffle = qState.isShuffle;
|
if (qState) {
|
||||||
repeatMode = qState.repeatMode;
|
isShuffle = qState.isShuffle ?? false;
|
||||||
queueCount = qState.tracks.length;
|
repeatMode = qState.repeatMode ?? 'off';
|
||||||
|
queueCount = qState.tracks?.length ?? 0;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
onDestroy(() => {
|
onDestroy(() => {
|
||||||
@@ -266,23 +270,23 @@
|
|||||||
onclick={handleToggleShuffle}
|
onclick={handleToggleShuffle}
|
||||||
title="Shuffle"
|
title="Shuffle"
|
||||||
>
|
>
|
||||||
<Shuffle size={12} />
|
<Shuffle size={14} />
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button class="ctrl-btn" onclick={handlePrevious} title="Previous">
|
<button class="ctrl-btn" onclick={handlePrevious} title="Previous">
|
||||||
<SkipBack size={14} />
|
<SkipBack size={16} />
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button class="ctrl-btn play" onclick={handlePlayPause} title={playerState.isPlaying ? 'Pause' : 'Play'}>
|
<button class="ctrl-btn play" onclick={handlePlayPause} title={playerState.isPlaying ? 'Pause' : 'Play'}>
|
||||||
{#if playerState.isPlaying}
|
{#if playerState.isPlaying}
|
||||||
<Pause size={16} />
|
<Pause size={18} />
|
||||||
{:else}
|
{:else}
|
||||||
<Play size={16} />
|
<Play size={18} />
|
||||||
{/if}
|
{/if}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button class="ctrl-btn" onclick={handleNext} title="Next">
|
<button class="ctrl-btn" onclick={handleNext} title="Next">
|
||||||
<SkipForward size={14} />
|
<SkipForward size={16} />
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
@@ -292,9 +296,9 @@
|
|||||||
title="Repeat"
|
title="Repeat"
|
||||||
>
|
>
|
||||||
{#if repeatMode === 'one'}
|
{#if repeatMode === 'one'}
|
||||||
<Repeat1 size={12} />
|
<Repeat1 size={14} />
|
||||||
{:else}
|
{:else}
|
||||||
<Repeat size={12} />
|
<Repeat size={14} />
|
||||||
{/if}
|
{/if}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
@@ -303,7 +307,7 @@
|
|||||||
onclick={handleOpenQueue}
|
onclick={handleOpenQueue}
|
||||||
title="Queue ({queueCount})"
|
title="Queue ({queueCount})"
|
||||||
>
|
>
|
||||||
<ListMusic size={12} />
|
<ListMusic size={14} />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -327,16 +331,18 @@
|
|||||||
|
|
||||||
/* Album Art */
|
/* Album Art */
|
||||||
.artwork-section {
|
.artwork-section {
|
||||||
width: 124px;
|
width: 180px;
|
||||||
height: 124px;
|
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
|
padding: 6px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.artwork {
|
.artwork {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
border-radius: 6px 0 0 6px;
|
border-radius: 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.artwork-placeholder {
|
.artwork-placeholder {
|
||||||
@@ -347,7 +353,7 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
color: rgba(255, 255, 255, 0.2);
|
color: rgba(255, 255, 255, 0.2);
|
||||||
border-radius: 6px 0 0 6px;
|
border-radius: 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Content */
|
/* Content */
|
||||||
@@ -355,7 +361,7 @@
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
padding: 8px 10px;
|
padding: 10px 12px 10px 6px;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
@@ -376,7 +382,7 @@
|
|||||||
|
|
||||||
.title {
|
.title {
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
font-size: 11px;
|
font-size: 13px;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
@@ -385,11 +391,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.artist {
|
.artist {
|
||||||
font-size: 10px;
|
font-size: 11px;
|
||||||
color: rgba(255, 255, 255, 0.5);
|
color: rgba(255, 255, 255, 0.5);
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
margin-top: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.window-controls {
|
.window-controls {
|
||||||
@@ -465,15 +472,15 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
gap: 2px;
|
gap: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ctrl-btn {
|
.ctrl-btn {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
width: 24px;
|
width: 28px;
|
||||||
height: 24px;
|
height: 28px;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
border: none;
|
border: none;
|
||||||
color: rgba(255, 255, 255, 0.7);
|
color: rgba(255, 255, 255, 0.7);
|
||||||
@@ -496,8 +503,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.ctrl-btn.play {
|
.ctrl-btn.play {
|
||||||
width: 28px;
|
width: 34px;
|
||||||
height: 28px;
|
height: 34px;
|
||||||
background: rgba(255, 255, 255, 0.1);
|
background: rgba(255, 255, 255, 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user