Let the page buttons make way: a Page buttons setting that gives their room to the tiles, chevrons and dots instead of words, and a warning in the editor for pages nothing leads to (0.2.82)
GitHub issue #9 asked to drop the Previous/Next bar when Go to page tiles do the navigation and to give the tiles the whole screen. Page buttons is a setting the screen owns (on by default): a row in the Screen group of the settings page, switch.<screen>_page_buttons in Home Assistant, and a row in the editor's Screen settings. Without the bar, and on a screen with one page, place_page moves and sizes the three rows so they reach the bottom margin (Guition 108 -> 122 px, CYD 52 -> 61 px); a card keeps its circle, name and state in its middle and the single analog clock keeps its dial. With page buttons and swiping both off, the editor says where the Go to page tiles lead and which pages that leaves out of reach. The bar itself: each half of the band under the tiles is one key with an MDI chevron and lights up under a finger, and a dot per page sits between them; the screen's settings page uses the same pager. App 0.2.82, firmware 0.2.69. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -73,6 +73,17 @@ int main() {
|
||||
assert(dark_mode == 0 && value_text(dark) == "Off");
|
||||
|
||||
const Page &screen = pages[3];
|
||||
// Page buttons (firmware 0.2.69+) follows Swipe between pages: on by default, off takes the bar away.
|
||||
{
|
||||
const Row &buttons = row_named(screen, "Page buttons");
|
||||
assert(buttons.kind == Kind::toggle && &buttons == &row_named(screen, "Swipe between pages") + 1);
|
||||
assert(page_buttons == 1 && value_text(buttons) == "On");
|
||||
buttons.write(0);
|
||||
assert(page_buttons == 0 && value_text(buttons) == "Off");
|
||||
assert(set("page_buttons", 0) == SetResult::same);
|
||||
buttons.write(1);
|
||||
assert(page_buttons == 1);
|
||||
}
|
||||
const Row &clock = row_named(screen, "Clock");
|
||||
assert(clock.option_count == 2 && value_text(clock) == "24 hour");
|
||||
clock.write(0);
|
||||
@@ -151,7 +162,7 @@ int main() {
|
||||
{"night_start", -5, 0}, {"night_end", 2000, 1439}, {"night_brightness", 7, 7}, {"clock_24h", 0, 0},
|
||||
{"home_on_standby", 1, 1}, {"swipe_pages", 2, 1}, {"rotation", 100, 90}, {"rotation", 400, 270},
|
||||
{"auto_home", 0, 0}, {"auto_home_seconds", 5, 30}, {"auto_home_seconds", 99999, 3600},
|
||||
{"dark_mode", 7, 1},
|
||||
{"dark_mode", 7, 1}, {"page_buttons", 0, 0},
|
||||
};
|
||||
for (const auto &c : cases) {
|
||||
result = set(c.key, c.value);
|
||||
@@ -160,7 +171,7 @@ int main() {
|
||||
}
|
||||
assert(screen_settings::current.standby_seconds == 86400 && screen_settings::current.brightness == 100);
|
||||
assert(screen_settings::current.night_start == 0 && screen_settings::current.night_end == 1439);
|
||||
assert(swipe_pages == 1 && rotation == 270 && auto_home == 0 && auto_home_seconds == 3600 && dark_mode == 1);
|
||||
assert(swipe_pages == 1 && rotation == 270 && auto_home == 0 && auto_home_seconds == 3600 && dark_mode == 1 && page_buttons == 0);
|
||||
assert(screen_settings::current.valid());
|
||||
// Dark mode again is the same look: nothing stored, applied or reported; off is a change.
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user