S014: centre breadcrumb crumbs vertically, keep crumb widths so they never overlap
Crumbs sat at the top of the 40 px bar (a layout puts a fixed-height child at the top) and a 32 px min-width let later crumbs shrink under their labels. Trailing padding trimmed so the root crumb has more room. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
parent
5e0c355234
commit
5d278be373
1 changed files with 5 additions and 2 deletions
|
|
@ -26,7 +26,6 @@ component CrumbChip inherits StateLayer {
|
||||||
property <color> content: root.last ? Theme.on-secondary-container : Theme.on-surface-variant;
|
property <color> content: root.last ? Theme.on-secondary-container : Theme.on-surface-variant;
|
||||||
|
|
||||||
height: 32px;
|
height: 32px;
|
||||||
min-width: 32px;
|
|
||||||
border-radius: Theme.corner-full(self.height);
|
border-radius: Theme.corner-full(self.height);
|
||||||
// The current folder is a filled pill; the crumbs before it show only on hover.
|
// The current folder is a filled pill; the crumbs before it show only on hover.
|
||||||
background: root.last ? Theme.secondary-container : transparent;
|
background: root.last ? Theme.secondary-container : transparent;
|
||||||
|
|
@ -129,7 +128,7 @@ export component Breadcrumb inherits Rectangle {
|
||||||
x: min(0, root.width - self.width);
|
x: min(0, root.width - self.width);
|
||||||
width: max(root.width, self.min-width);
|
width: max(root.width, self.min-width);
|
||||||
padding-left: Theme.space-1;
|
padding-left: Theme.space-1;
|
||||||
padding-right: Theme.space-4;
|
padding-right: Theme.space-1;
|
||||||
alignment: start;
|
alignment: start;
|
||||||
|
|
||||||
for crumb[i] in root.crumbs: HorizontalLayout {
|
for crumb[i] in root.crumbs: HorizontalLayout {
|
||||||
|
|
@ -142,6 +141,9 @@ export component Breadcrumb inherits Rectangle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Centred in the bar's height: a layout puts a fixed-height child at the top.
|
||||||
|
VerticalLayout {
|
||||||
|
alignment: center;
|
||||||
CrumbChip {
|
CrumbChip {
|
||||||
name: crumb.name;
|
name: crumb.name;
|
||||||
glyph: crumb.glyph;
|
glyph: crumb.glyph;
|
||||||
|
|
@ -157,6 +159,7 @@ export component Breadcrumb inherits Rectangle {
|
||||||
radius: parent.border-radius;
|
radius: parent.border-radius;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue