feat: add a Controls page and keep only contextual hints in the bar
Settings lists every button and key, grouped by where it works and drawn for the controller in use or the keyboard. The controls bar drops what works the same everywhere, such as Back, Play / Pause and Sections, so the hints that depend on the selection are no longer pushed aside. The login screen keeps all its hints, since Settings is out of reach there. Bumps the version to 0.10.3.
This commit is contained in:
@@ -31,6 +31,8 @@ export struct Item {
|
||||
// A setting with a range: draws `level` (0 to 1) as a slider before `detail`.
|
||||
slider: bool,
|
||||
level: float,
|
||||
// Button or key icons after `detail`, on the Controls page.
|
||||
icons: [image],
|
||||
}
|
||||
|
||||
export struct Header {
|
||||
@@ -280,6 +282,19 @@ component Row inherits Rectangle {
|
||||
horizontal-alignment: right;
|
||||
vertical-alignment: center;
|
||||
}
|
||||
|
||||
if root.item.icons.length > 0: HorizontalLayout {
|
||||
spacing: 4px * Theme.s;
|
||||
for icon in root.item.icons: VerticalLayout {
|
||||
alignment: center;
|
||||
Image {
|
||||
source: icon;
|
||||
height: 34px * Theme.s;
|
||||
// Keys such as Space are wider than a button.
|
||||
width: self.height * icon.width / max(1, icon.height);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TouchArea {
|
||||
|
||||
Reference in New Issue
Block a user