- text no showing if clipping out of screen
- inner child dimensions setting 0 for height
- navigation to home menus was skipping transfer
This commit is contained in:
Brackyt 2026-01-25 14:32:28 +01:00
parent 374f1a1106
commit d54f3c5143
5 changed files with 224 additions and 63 deletions

View File

@ -232,12 +232,6 @@ public:
drawX = absX + absW - textWidth;
}
// Bounds check
if (drawX + textWidth > renderer.getScreenWidth()) {
markClean();
return;
}
renderer.drawText(fontId, drawX, drawY, finalText.c_str(), black);
markClean();
}

View File

@ -30,23 +30,47 @@ Y = 10
Width = 100%
Height = 24
[BatteryIcon]
[BatteryContainer]
Parent = StatusBar
Type = Container
X = 400
Y = 3
Width = 28
Height = 18
[BatteryIcon]
Parent = BatteryContainer
Type = Icon
Src = battery
X = 400
X = 0
Y = 0
Width = 28
Height = 18
Color = black
; Fill bar inside the battery (positioned inside the battery outline)
[BatteryFill]
Parent = BatteryContainer
Type = ProgressBar
X = 2
Y = 4
Width = 20
Height = 10
Value = {BatteryPercent}
Max = 100
FgColor = black
BgColor = white
ShowBorder = false
[BatteryLabel]
Parent = StatusBar
Type = Label
Font = UI_10
Text = {BatteryPercent}%
X = 432
Y = 3
Width = 48
Height = 20
Height = 18
; --- Recent Books Section ---
[RecentBooksSection]
@ -184,37 +208,94 @@ Width = 150
Height = 40
Color = black
; --- Bottom Hint Bar ---
[HintBar]
; --- Bottom Navigation Bar ---
; Positioned at the very bottom of screen, buttons align with physical buttons
[NavBar]
Parent = Home
Type = HStack
X = 60
Y = 760
Width = 360
Height = 30
Spacing = 80
CenterVertical = true
Type = Container
X = 0
Y = 776
Width = 100%
Height = 24
[HintSelect]
Parent = HintBar
; Left button group (OK and Back) - aligned with left physical buttons
[NavLeftGroup]
Parent = NavBar
Type = HStack
X = 120
Y = 0
Width = 168
Height = 24
Spacing = 8
[NavBtnBack]
Parent = NavLeftGroup
Type = Container
Width = 80
Height = 8
Border = true
BorderRadius = 8
[NavBtnOK]
Parent = NavLeftGroup
Type = Container
Width = 80
Height = 24
Border = true
BorderRadius = 8
[NavBtnOKIcon]
Parent = NavBtnOK
Type = Icon
Src = check
Width = 24
Height = 24
X = 30
Y = 6
Width = 20
Height = 12
[HintUp]
Parent = HintBar
; Right button group (Up and Down) - aligned with right physical buttons
[NavRightGroup]
Parent = NavBar
Type = HStack
X = 292
Y = 0
Width = 168
Height = 24
Spacing = 8
[NavBtnUp]
Parent = NavRightGroup
Type = Container
Width = 80
Height = 24
Border = true
BorderRadius = 8
[NavBtnUpIcon]
Parent = NavBtnUp
Type = Icon
Src = up
Width = 24
Height = 24
X = 30
Y = 6
Width = 20
Height = 12
[HintDown]
Parent = HintBar
[NavBtnDown]
Parent = NavRightGroup
Type = Container
Width = 80
Height = 24
Border = true
BorderRadius = 8
[NavBtnDownIcon]
Parent = NavBtnDown
Type = Icon
Src = down
Width = 24
Height = 24
X = 30
Y = 6
Width = 20
Height = 12
; ============================================
; SETTINGS SCREEN

View File

@ -134,9 +134,10 @@ public:
// Layout self first (bounds)
UIElement::layout(context, parentX, parentY, parentW, parentH);
// Pre-layout the template once with parent dimensions to get its height
// Pre-layout the template once with list's dimensions to get item sizes
// Pass absH so percentage heights in the template work correctly
if (itemTemplate && itemHeight == 0) {
itemTemplate->layout(context, absX, absY, absW, 0);
itemTemplate->layout(context, absX, absY, absW, absH);
}
}

View File

@ -25,7 +25,7 @@ void HomeActivity::taskTrampoline(void *param) {
}
int HomeActivity::getMenuItemCount() const {
int count = 3; // My Library, File transfer, Settings
int count = 4; // My Library, Files, Transfer, Settings
if (hasContinueReading)
count++;
if (hasOpdsUrl)
@ -268,7 +268,8 @@ void HomeActivity::loop() {
const int continueIdx = hasContinueReading ? idx++ : -1;
const int myLibraryIdx = idx++;
const int opdsLibraryIdx = hasOpdsUrl ? idx++ : -1;
const int fileTransferIdx = idx++;
const int filesIdx = idx++;
const int transferIdx = idx++;
const int settingsIdx = idx;
if (selectorIndex == continueIdx) {
@ -277,8 +278,10 @@ void HomeActivity::loop() {
onMyLibraryOpen();
} else if (selectorIndex == opdsLibraryIdx) {
onOpdsBrowserOpen();
} else if (selectorIndex == fileTransferIdx) {
onFileTransferOpen();
} else if (selectorIndex == filesIdx) {
onMyLibraryOpen(); // Files = file browser
} else if (selectorIndex == transferIdx) {
onFileTransferOpen(); // Transfer = web transfer
} else if (selectorIndex == settingsIdx) {
onSettingsOpen();
}
@ -362,7 +365,8 @@ void HomeActivity::render() {
const int continueIdx = hasContinueReading ? idx++ : -1;
const int myLibraryIdx = idx++;
const int opdsLibraryIdx = hasOpdsUrl ? idx++ : -1;
const int fileTransferIdx = idx++;
const int filesIdx = idx++;
const int transferIdx = idx++;
const int settingsIdx = idx;
context.setBool("IsBookSelected", selectorIndex == continueIdx);
@ -384,11 +388,11 @@ void HomeActivity::render() {
menuLabels.push_back("Files");
menuIcons.push_back("folder");
menuSelected.push_back(selectorIndex == fileTransferIdx);
menuSelected.push_back(selectorIndex == filesIdx);
menuLabels.push_back("Transfer");
menuIcons.push_back("transfer");
menuSelected.push_back(false); // Separate from file transfer
menuSelected.push_back(selectorIndex == transferIdx);
menuLabels.push_back("Settings");
menuIcons.push_back("settings");

View File

@ -67,23 +67,47 @@ Y = 10
Width = 100%
Height = 24
[BatteryIcon]
[BatteryContainer]
Parent = StatusBar
Type = Container
X = 400
Y = 3
Width = 28
Height = 18
[BatteryIcon]
Parent = BatteryContainer
Type = Icon
Src = battery
X = 400
X = 0
Y = 0
Width = 28
Height = 18
Color = black
; Fill bar inside the battery (positioned inside the battery outline)
[BatteryFill]
Parent = BatteryContainer
Type = ProgressBar
X = 2
Y = 4
Width = 20
Height = 10
Value = {BatteryPercent}
Max = 100
FgColor = black
BgColor = white
ShowBorder = false
[BatteryLabel]
Parent = StatusBar
Type = Label
Font = UI_10
Text = {BatteryPercent}%
X = 432
Y = 3
Width = 48
Height = 20
Height = 18
; --- Recent Books Section ---
[RecentBooksSection]
@ -221,34 +245,91 @@ Width = 150
Height = 40
Color = black
; --- Bottom Hint Bar ---
[HintBar]
; --- Bottom Navigation Bar ---
; Positioned at the very bottom of screen, buttons align with physical buttons
[NavBar]
Parent = Home
Type = HStack
X = 60
Y = 760
Width = 360
Height = 30
Spacing = 80
CenterVertical = true
Type = Container
X = 0
Y = 776
Width = 100%
Height = 24
[HintSelect]
Parent = HintBar
; Left button group (OK and Back) - aligned with left physical buttons
[NavLeftGroup]
Parent = NavBar
Type = HStack
X = 120
Y = 0
Width = 168
Height = 24
Spacing = 8
[NavBtnBack]
Parent = NavLeftGroup
Type = Container
Width = 80
Height = 8
Border = true
BorderRadius = 8
[NavBtnOK]
Parent = NavLeftGroup
Type = Container
Width = 80
Height = 24
Border = true
BorderRadius = 8
[NavBtnOKIcon]
Parent = NavBtnOK
Type = Icon
Src = check
Width = 24
Height = 24
X = 30
Y = 6
Width = 20
Height = 12
[HintUp]
Parent = HintBar
; Right button group (Up and Down) - aligned with right physical buttons
[NavRightGroup]
Parent = NavBar
Type = HStack
X = 292
Y = 0
Width = 168
Height = 24
Spacing = 8
[NavBtnUp]
Parent = NavRightGroup
Type = Container
Width = 80
Height = 24
Border = true
BorderRadius = 8
[NavBtnUpIcon]
Parent = NavBtnUp
Type = Icon
Src = up
Width = 24
Height = 24
X = 30
Y = 6
Width = 20
Height = 12
[HintDown]
Parent = HintBar
[NavBtnDown]
Parent = NavRightGroup
Type = Container
Width = 80
Height = 24
Border = true
BorderRadius = 8
[NavBtnDownIcon]
Parent = NavBtnDown
Type = Icon
Src = down
Width = 24
Height = 24
X = 30
Y = 6
Width = 20
Height = 12