polish(slint): immersive panels contrast, alignment and legibility pass
Content sat directly over the variable album atmosphere and washed out. Add a semi-opaque dark backing behind the split-right panel (and a lighter plate behind the split-left metadata) so any panel reads on any cover. Track Info: replace the dark-gray modal labels with bright local variants (labels #ffffffb3, values near-white). Queue: fix the misaligned clear button (content-sized, 34px baseline, flush trailing edge), de-pill the sub-tabs (underline active), brighten rows. Suggestions: hairline rims and badge backing discs, brighter text. Header: unify the glass capsule idiom across the mode trigger, search placeholder and controls; polish the two-level dropdown (caps group headers, spacing). Split gutters/gaps tuned. cc
This commit is contained in:
4 files changed
+488
-233
No files matched your search
@@ -29,10 +29,10 @@ component ImmExplicitBadge inherits Rectangle {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
border-radius: 3px;
|
||||
background: #ffffff1f;
|
||||
background: #ffffff29;
|
||||
Text {
|
||||
text: "E";
|
||||
color: #ffffffa6;
|
||||
color: #ffffffd9;
|
||||
font-size: 9px;
|
||||
font-weight: 600;
|
||||
horizontal-alignment: center;
|
||||
@@ -43,47 +43,69 @@ component ImmExplicitBadge inherits Rectangle {
|
||||
}
|
||||
}
|
||||
|
||||
// One Queue / History sub-tab — plain text, NO pill (ADR-008). Mirrors the
|
||||
// QueueSidebar QueueTab brightness idiom, recolored white-on-glass for the
|
||||
// immersive backdrop.
|
||||
// One Queue / History sub-tab — plain TEXT only, NO pill background (ADR-008).
|
||||
// Mirrors the QueueSidebar QueueTab brightness idiom (active = brightest,
|
||||
// inactive dims and brightens on hover), recolored white-on-glass for the
|
||||
// immersive backdrop. An active tab is marked by a 2px underline accent rather
|
||||
// than a filled rectangle, keeping it pill-free while still reading as "active".
|
||||
component SubTab inherits Rectangle {
|
||||
in property <string> label;
|
||||
in property <int> count: 0;
|
||||
in property <bool> active: false;
|
||||
callback clicked();
|
||||
|
||||
height: 32px;
|
||||
border-radius: 8px;
|
||||
background: root.active ? #ffffff26 : (ta.has-hover ? #ffffff14 : transparent);
|
||||
animate background { duration: 150ms; }
|
||||
// Content-sized: hugs the label so tabs sit close together, no pill chrome.
|
||||
width: tab-row.preferred-width;
|
||||
height: 34px;
|
||||
background: transparent;
|
||||
|
||||
HorizontalLayout {
|
||||
padding-left: 12px;
|
||||
padding-right: 12px;
|
||||
spacing: 6px;
|
||||
tab-row := HorizontalLayout {
|
||||
spacing: 5px;
|
||||
alignment: center;
|
||||
Text {
|
||||
text: root.label;
|
||||
color: root.active ? #ffffff : (ta.has-hover ? #ffffffd9 : #ffffff99);
|
||||
font-size: 17px;
|
||||
font-weight: root.active ? 600 : 500;
|
||||
color: root.active ? #ffffff : (ta.has-hover ? #ffffffe6 : #ffffff99);
|
||||
font-size: 18px;
|
||||
font-weight: root.active ? 700 : 500;
|
||||
vertical-alignment: center;
|
||||
animate color { duration: 150ms; }
|
||||
}
|
||||
if root.count > 0: Text {
|
||||
text: "(" + root.count + ")";
|
||||
color: #ffffff66;
|
||||
color: root.active ? #ffffffb3 : #ffffff66;
|
||||
font-size: 15px;
|
||||
font-weight: 500;
|
||||
vertical-alignment: center;
|
||||
animate color { duration: 150ms; }
|
||||
}
|
||||
}
|
||||
|
||||
// Active underline — 2px accent flush to the bottom of the label row.
|
||||
Rectangle {
|
||||
x: 0;
|
||||
y: parent.height - self.height;
|
||||
width: parent.width;
|
||||
height: 2px;
|
||||
border-radius: 1px;
|
||||
background: root.active ? #ffffff : (ta.has-hover ? #ffffff33 : transparent);
|
||||
animate background { duration: 150ms; }
|
||||
}
|
||||
|
||||
ta := TouchArea {
|
||||
mouse-cursor: pointer;
|
||||
clicked => { root.clicked(); }
|
||||
}
|
||||
}
|
||||
|
||||
// Section header — small, uppercase, tracked-out label (NOW PLAYING / UP NEXT).
|
||||
// Hoisted to a component so both sections share identical typography + color.
|
||||
component SectionLabel inherits Text {
|
||||
color: #ffffffb3;
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 1.2px;
|
||||
}
|
||||
|
||||
// One UP NEXT / History row. 40x40 cover, title/artist, duration, and a
|
||||
// hover-revealed circular play button. Fires `play()` on click OR play-button —
|
||||
// the parent maps it to the right QueueState callback. Reuses QueueRow's visual
|
||||
@@ -94,14 +116,15 @@ component ImmQueueRow inherits Rectangle {
|
||||
callback play();
|
||||
|
||||
height: 56px;
|
||||
border-radius: 8px;
|
||||
// `.track-item.current` (data-panels §4): --alpha-10 bg + 1px --alpha-15
|
||||
// border. Plain rows: transparent, hover --alpha-10.
|
||||
border-radius: 10px;
|
||||
// `.track-item.current` (data-panels §4): the now-playing row gets a brighter
|
||||
// fill + 1px hairline so it reads as the anchor over ANY album atmosphere.
|
||||
// Plain rows are transparent and lift to a soft --alpha-10 on hover.
|
||||
background: root.current
|
||||
? #ffffff1a
|
||||
? #ffffff24
|
||||
: (ta.has-hover ? #ffffff1a : transparent);
|
||||
border-width: root.current ? 1px : 0px;
|
||||
border-color: #ffffff26;
|
||||
border-color: #ffffff3d;
|
||||
animate background { duration: 150ms; }
|
||||
|
||||
ta := TouchArea {
|
||||
@@ -110,18 +133,21 @@ component ImmQueueRow inherits Rectangle {
|
||||
}
|
||||
|
||||
HorizontalLayout {
|
||||
padding-left: 8px;
|
||||
padding-left: 10px;
|
||||
padding-right: 8px;
|
||||
spacing: 10px;
|
||||
spacing: 12px;
|
||||
|
||||
// 40x40 cover.
|
||||
// 40x40 cover. A 1px inset hairline keeps the artwork edge crisp against
|
||||
// both bright and dark atmospheres.
|
||||
VerticalLayout {
|
||||
alignment: center;
|
||||
Rectangle {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: 4px;
|
||||
border-radius: 5px;
|
||||
background: #ffffff14;
|
||||
border-width: 1px;
|
||||
border-color: #ffffff1f;
|
||||
clip: true;
|
||||
if root.item.artwork.width > 0: Image {
|
||||
source: root.item.artwork;
|
||||
@@ -136,14 +162,16 @@ component ImmQueueRow inherits Rectangle {
|
||||
VerticalLayout {
|
||||
horizontal-stretch: 1;
|
||||
alignment: center;
|
||||
spacing: 2px;
|
||||
spacing: 3px;
|
||||
HorizontalLayout {
|
||||
spacing: 5px;
|
||||
spacing: 6px;
|
||||
Text {
|
||||
text: root.item.title;
|
||||
// Now-playing title at full white + heavier weight; queue rows
|
||||
// a hair softer so the current row clearly leads.
|
||||
color: #ffffff;
|
||||
font-size: 17px;
|
||||
font-weight: 500;
|
||||
font-weight: root.current ? 600 : 500;
|
||||
overflow: elide;
|
||||
}
|
||||
if root.item.explicit: VerticalLayout {
|
||||
@@ -153,34 +181,45 @@ component ImmQueueRow inherits Rectangle {
|
||||
}
|
||||
Text {
|
||||
text: root.item.artist;
|
||||
color: #ffffff99;
|
||||
font-size: 16px;
|
||||
// Lifted from a faint gray to a legible light secondary so the
|
||||
// artist stays readable over a bright cover atmosphere.
|
||||
color: #ffffffb3;
|
||||
font-size: 15px;
|
||||
overflow: elide;
|
||||
}
|
||||
}
|
||||
|
||||
// Duration.
|
||||
VerticalLayout {
|
||||
alignment: center;
|
||||
// Duration + play affordance share one trailing slot. A plain Rectangle
|
||||
// (NOT a layout) so the absolutely-positioned children honor their x/y —
|
||||
// a VerticalLayout would re-flow them and drop the overlap. The duration
|
||||
// fades on hover and the circular play button fades in over the same
|
||||
// slot, so revealing it never shifts the row.
|
||||
trailing-slot := Rectangle {
|
||||
width: 36px;
|
||||
Text {
|
||||
x: 0;
|
||||
width: parent.width;
|
||||
y: Math.round((parent.height - self.height) / 2 / 1px) * 1px;
|
||||
text: root.item.duration;
|
||||
color: #ffffff80;
|
||||
font-size: 16px;
|
||||
color: #ffffff99;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
horizontal-alignment: right;
|
||||
opacity: (!root.current && ta.has-hover) ? 0.0 : 1.0;
|
||||
animate opacity { duration: 150ms; }
|
||||
}
|
||||
}
|
||||
|
||||
// Hover-revealed circular play button (28px). Hidden for the current
|
||||
// (now-playing) row, which is not re-playable.
|
||||
VerticalLayout {
|
||||
alignment: center;
|
||||
width: 32px;
|
||||
// Hover-revealed circular play button (30px). Hidden for the current
|
||||
// (now-playing) row, which is not re-playable.
|
||||
if !root.current: play-btn := Rectangle {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
border-radius: 14px;
|
||||
background: pta.has-hover ? #ffffff40 : #ffffff26;
|
||||
x: parent.width - self.width;
|
||||
y: Math.round((parent.height - self.height) / 2 / 1px) * 1px;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 15px;
|
||||
background: pta.has-hover ? #ffffff59 : #ffffff33;
|
||||
opacity: ta.has-hover || pta.has-hover ? 1.0 : 0.0;
|
||||
animate opacity { duration: 150ms; }
|
||||
animate background { duration: 120ms; }
|
||||
QbzIcon {
|
||||
source: @image-url("../assets/icons/play-fill.svg");
|
||||
width: 13px;
|
||||
@@ -231,46 +270,69 @@ export component ImmersiveQueuePanel inherits Rectangle {
|
||||
spacing: 16px;
|
||||
|
||||
// --- Sub-tab header (Queue / History) ---------------------------
|
||||
// Tabs LEFT, clear-queue action flush at the TRAILING edge (alignment
|
||||
// standard: actions always right, content-sized, on one baseline).
|
||||
// A fixed 34px row height puts the tab labels and the Clear button on
|
||||
// a single horizontal line — the previous version let the unsized
|
||||
// button balloon to fill the spacer and sat off the tab baseline.
|
||||
HorizontalLayout {
|
||||
spacing: 8px;
|
||||
height: 34px;
|
||||
spacing: 18px;
|
||||
alignment: start;
|
||||
SubTab {
|
||||
label: @tr("Queue");
|
||||
count: root.upcoming-count;
|
||||
active: QueueState.tab == 0;
|
||||
clicked => { QueueState.set-tab(0); }
|
||||
VerticalLayout {
|
||||
alignment: center;
|
||||
SubTab {
|
||||
label: @tr("Queue");
|
||||
count: root.upcoming-count;
|
||||
active: QueueState.tab == 0;
|
||||
clicked => { QueueState.set-tab(0); }
|
||||
}
|
||||
}
|
||||
SubTab {
|
||||
label: @tr("History");
|
||||
count: QueueState.history.length;
|
||||
active: QueueState.tab == 1;
|
||||
clicked => { QueueState.set-tab(1); }
|
||||
VerticalLayout {
|
||||
alignment: center;
|
||||
SubTab {
|
||||
label: @tr("History");
|
||||
count: QueueState.history.length;
|
||||
active: QueueState.tab == 1;
|
||||
clicked => { QueueState.set-tab(1); }
|
||||
}
|
||||
}
|
||||
Rectangle { horizontal-stretch: 1; }
|
||||
// Clear-queue button — Queue tab only, when there is something
|
||||
// upcoming (data-panels §4 `.clear-btn`).
|
||||
// upcoming (data-panels §4 `.clear-btn`). Content-sized (hugs its
|
||||
// icon + label via the inner layout's preferred-width) and
|
||||
// vertically centered on the tab baseline, pinned right by the
|
||||
// stretch spacer above. NO pill — a soft bordered rectangle
|
||||
// (ADR-008).
|
||||
if QueueState.tab == 0 && root.upcoming-count > 0: VerticalLayout {
|
||||
alignment: center;
|
||||
clear-btn := Rectangle {
|
||||
height: 30px;
|
||||
width: clear-row.preferred-width;
|
||||
height: 32px;
|
||||
border-radius: 8px;
|
||||
background: cta.has-hover ? #ffffff26 : #ffffff14;
|
||||
animate background { duration: 150ms; }
|
||||
HorizontalLayout {
|
||||
background: cta.has-hover ? #ffffff29 : #ffffff14;
|
||||
border-width: 1px;
|
||||
border-color: cta.has-hover ? #ffffff40 : #ffffff26;
|
||||
animate background, border-color { duration: 150ms; }
|
||||
clear-row := HorizontalLayout {
|
||||
padding-left: 12px;
|
||||
padding-right: 12px;
|
||||
spacing: 6px;
|
||||
spacing: 7px;
|
||||
alignment: center;
|
||||
QbzIcon {
|
||||
source: @image-url("../assets/icons/trash-2.svg");
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
tint: #ffffffcc;
|
||||
VerticalLayout {
|
||||
alignment: center;
|
||||
QbzIcon {
|
||||
source: @image-url("../assets/icons/trash-2.svg");
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
tint: cta.has-hover ? #ffffff : #ffffffcc;
|
||||
}
|
||||
}
|
||||
Text {
|
||||
text: @tr("Clear");
|
||||
color: #ffffffcc;
|
||||
font-size: 16px;
|
||||
color: cta.has-hover ? #ffffff : #ffffffcc;
|
||||
font-size: 15px;
|
||||
font-weight: 500;
|
||||
vertical-alignment: center;
|
||||
}
|
||||
}
|
||||
@@ -284,7 +346,7 @@ export component ImmersiveQueuePanel inherits Rectangle {
|
||||
// Header underline (data-panels §4 `.panel-header` border-bottom).
|
||||
Rectangle {
|
||||
height: 1px;
|
||||
background: #ffffff1a;
|
||||
background: #ffffff21;
|
||||
}
|
||||
|
||||
// --- Body -------------------------------------------------------
|
||||
@@ -295,17 +357,13 @@ export component ImmersiveQueuePanel inherits Rectangle {
|
||||
if QueueState.tab == 0: Rectangle {
|
||||
// NOW PLAYING card + UP NEXT list, OR empty state.
|
||||
if QueueState.has-current || root.upcoming-count > 0: VerticalLayout {
|
||||
spacing: 12px;
|
||||
spacing: 16px;
|
||||
|
||||
// NOW PLAYING section.
|
||||
if QueueState.has-current: VerticalLayout {
|
||||
spacing: 8px;
|
||||
Text {
|
||||
spacing: 10px;
|
||||
SectionLabel {
|
||||
text: @tr("NOW PLAYING");
|
||||
color: #ffffff80;
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
ImmQueueRow {
|
||||
item: QueueState.now-playing;
|
||||
@@ -316,13 +374,21 @@ export component ImmersiveQueuePanel inherits Rectangle {
|
||||
// UP NEXT section.
|
||||
if root.upcoming-count > 0: VerticalLayout {
|
||||
vertical-stretch: 1;
|
||||
spacing: 8px;
|
||||
Text {
|
||||
text: @tr("UP NEXT");
|
||||
color: #ffffff80;
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.5px;
|
||||
spacing: 10px;
|
||||
HorizontalLayout {
|
||||
spacing: 8px;
|
||||
SectionLabel {
|
||||
text: @tr("UP NEXT");
|
||||
vertical-alignment: center;
|
||||
}
|
||||
SectionLabel {
|
||||
text: "· " + root.upcoming-count;
|
||||
color: #ffffff80;
|
||||
font-weight: 500;
|
||||
letter-spacing: 0.4px;
|
||||
vertical-alignment: center;
|
||||
}
|
||||
Rectangle { horizontal-stretch: 1; }
|
||||
}
|
||||
Rectangle {
|
||||
vertical-stretch: 1;
|
||||
@@ -333,6 +399,9 @@ export component ImmersiveQueuePanel inherits Rectangle {
|
||||
viewport-height: up-list.preferred-height;
|
||||
up-list := VerticalLayout {
|
||||
width: parent.width;
|
||||
// Trailing gutter so rows never tuck under
|
||||
// the overlaid scrollbar (14px gutter).
|
||||
padding-right: 16px;
|
||||
// spacing 0 — the inter-row gap is baked
|
||||
// into each VISIBLE wrapper's height (60 =
|
||||
// 56 row + 4 gap), with the row anchored to
|
||||
@@ -380,55 +449,94 @@ export component ImmersiveQueuePanel inherits Rectangle {
|
||||
// Empty state — nothing playing and nothing upcoming.
|
||||
if !QueueState.has-current && root.upcoming-count == 0: VerticalLayout {
|
||||
alignment: center;
|
||||
spacing: 8px;
|
||||
Text {
|
||||
text: @tr("Your queue is empty");
|
||||
color: #ffffff66;
|
||||
font-size: 18px;
|
||||
font-italic: true;
|
||||
color: #ffffffcc;
|
||||
font-size: 19px;
|
||||
font-weight: 600;
|
||||
horizontal-alignment: center;
|
||||
}
|
||||
Text {
|
||||
text: @tr("Play an album or track to get started");
|
||||
color: #ffffff80;
|
||||
font-size: 15px;
|
||||
horizontal-alignment: center;
|
||||
wrap: word-wrap;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ===== HISTORY tab =====
|
||||
if QueueState.tab == 1: Rectangle {
|
||||
if QueueState.history.length > 0: Rectangle {
|
||||
hist-flick := Flickable {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
viewport-width: self.width;
|
||||
viewport-height: hist-list.preferred-height;
|
||||
hist-list := VerticalLayout {
|
||||
width: parent.width;
|
||||
spacing: 4px;
|
||||
// QueueState.history is already most-recent-first
|
||||
// (matches QueueSidebar), and play-history(idx)
|
||||
// indexes it directly — no coverflow math here.
|
||||
for item[idx] in QueueState.history: ImmQueueRow {
|
||||
item: item;
|
||||
play => { QueueState.play-history(idx); }
|
||||
if QueueState.history.length > 0: VerticalLayout {
|
||||
spacing: 10px;
|
||||
// Section header — parity with QueueSidebar "RECENTLY
|
||||
// PLAYED".
|
||||
HorizontalLayout {
|
||||
spacing: 8px;
|
||||
SectionLabel {
|
||||
text: @tr("RECENTLY PLAYED");
|
||||
vertical-alignment: center;
|
||||
}
|
||||
SectionLabel {
|
||||
text: "· " + QueueState.history.length;
|
||||
color: #ffffff80;
|
||||
font-weight: 500;
|
||||
letter-spacing: 0.4px;
|
||||
vertical-alignment: center;
|
||||
}
|
||||
Rectangle { horizontal-stretch: 1; }
|
||||
}
|
||||
Rectangle {
|
||||
vertical-stretch: 1;
|
||||
hist-flick := Flickable {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
viewport-width: self.width;
|
||||
viewport-height: hist-list.preferred-height;
|
||||
hist-list := VerticalLayout {
|
||||
width: parent.width;
|
||||
spacing: 4px;
|
||||
// Trailing gutter so rows clear the scrollbar.
|
||||
padding-right: 16px;
|
||||
// QueueState.history is already most-recent-first
|
||||
// (matches QueueSidebar), and play-history(idx)
|
||||
// indexes it directly — no coverflow math here.
|
||||
for item[idx] in QueueState.history: ImmQueueRow {
|
||||
item: item;
|
||||
play => { QueueState.play-history(idx); }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ListScrollbar {
|
||||
x: parent.width - self.width;
|
||||
y: 0;
|
||||
height: parent.height;
|
||||
viewport-height: hist-flick.viewport-height;
|
||||
visible-height: hist-flick.height;
|
||||
viewport-y <=> hist-flick.viewport-y;
|
||||
auto-hide: true;
|
||||
ListScrollbar {
|
||||
x: parent.width - self.width;
|
||||
y: 0;
|
||||
height: parent.height;
|
||||
viewport-height: hist-flick.viewport-height;
|
||||
visible-height: hist-flick.height;
|
||||
viewport-y <=> hist-flick.viewport-y;
|
||||
auto-hide: true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if QueueState.history.length == 0: VerticalLayout {
|
||||
alignment: center;
|
||||
spacing: 8px;
|
||||
Text {
|
||||
text: @tr("Nothing played yet");
|
||||
color: #ffffff66;
|
||||
font-size: 18px;
|
||||
font-italic: true;
|
||||
color: #ffffffcc;
|
||||
font-size: 19px;
|
||||
font-weight: 600;
|
||||
horizontal-alignment: center;
|
||||
}
|
||||
Text {
|
||||
text: @tr("Tracks you play will appear here");
|
||||
color: #ffffff80;
|
||||
font-size: 15px;
|
||||
horizontal-alignment: center;
|
||||
wrap: word-wrap;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user