Enlarge Indicator native setup screen
This commit is contained in:
1 parent
164a6e8227
commit
4bbdf4b071
6 files changed
+163
-5
No files matched your search
@@ -164,6 +164,32 @@ class IndicatorDisplayProfileTest(unittest.TestCase):
|
||||
self.assertLessEqual(pairing_label_y + 29, pairing_value_y)
|
||||
self.assertLessEqual(pairing_value_y + 29, 160)
|
||||
|
||||
# Native setup mode intentionally uses most of the panel: a size-3
|
||||
# title and size-2 action/value rows replace the legacy size-1 page.
|
||||
for text, requested_size in (
|
||||
("SETUP", 3),
|
||||
("READY", 3),
|
||||
("WIFI", 3),
|
||||
("CONNECTING", 2),
|
||||
("JOIN WIFI", 2),
|
||||
("BROWSE", 2),
|
||||
("192.168.4.1", 2),
|
||||
):
|
||||
width, _height = dimensions(text, requested_size, 3, 1.2)
|
||||
self.assertLessEqual(width, 160)
|
||||
|
||||
title_height = dimensions("SETUP", 3, 3, 1.2)[1]
|
||||
row_height = dimensions("JOIN WIFI", 2, 3, 1.2)[1]
|
||||
self.assertLessEqual(2 + title_height, 34)
|
||||
self.assertLessEqual(34 + row_height, 56)
|
||||
self.assertLessEqual(56 + row_height, 77)
|
||||
self.assertLessEqual(77 + row_height, 101)
|
||||
self.assertLessEqual(101 + row_height, 124)
|
||||
self.assertLessEqual(124 + row_height, 160)
|
||||
|
||||
long_ssid = dimensions("ABCDEFGHIJKLMNOPQRSTUVWXYZ123456", 1, 3, 1.2)
|
||||
self.assertLessEqual(long_ssid[0], 2 * 148)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
@@ -36,6 +36,9 @@ int main() {
|
||||
if (mesh::ui::selectIndicatorTextScale(480, false) != 1.2f) return 5;
|
||||
if (mesh::ui::selectIndicatorTextScale(480, true) != 1.0f) return 6;
|
||||
if (mesh::ui::selectIndicatorTextScale(320, false) != 1.0f) return 7;
|
||||
if (!mesh::ui::usesNativeIndicatorTypography(160, 160, 480, 480)) return 8;
|
||||
if (mesh::ui::usesNativeIndicatorTypography(160, 160, 320, 320)) return 9;
|
||||
if (mesh::ui::usesNativeIndicatorTypography(128, 128, 480, 480)) return 10;
|
||||
return 0;
|
||||
}
|
||||
'''
|
||||
@@ -120,6 +123,27 @@ int main() {
|
||||
self.assertIn("static_cast<uint16_t>(renderWidth()), _compactText", display)
|
||||
self.assertIn("* profile_scale;", display)
|
||||
|
||||
def test_native_setup_page_uses_large_reflow(self):
|
||||
main = MAIN.read_text(encoding="utf-8")
|
||||
start = main.index("static bool hasNativeIndicatorSetupTypography()")
|
||||
end = main.index("static bool saveCompanionWiFi", start)
|
||||
setup = main[start:end]
|
||||
self.assertIn("usesNativeIndicatorTypography", setup)
|
||||
self.assertIn("renderNativeIndicatorSetupDisplay", setup)
|
||||
self.assertIn('setTextSize(3);', setup)
|
||||
self.assertIn('connecting ? "CONNECTING" : "JOIN WIFI"', setup)
|
||||
self.assertIn('drawNativeIndicatorSetupValue(56, wifi_name);', setup)
|
||||
self.assertIn('strncmp(value, "MeshCore-Setup-", 15) == 0', setup)
|
||||
self.assertIn('y, "MeshCore-"', setup)
|
||||
self.assertIn('y + 21, value + 9', setup)
|
||||
self.assertIn('getTextWidth(value) > max_width * 2', setup)
|
||||
self.assertIn('line_height = 11;', setup)
|
||||
self.assertIn('101, "BROWSE"', setup)
|
||||
self.assertIn('drawNativeIndicatorSetupAddress(124, address);', setup)
|
||||
self.assertIn('"SETUP", setup_ssid, setup_ip, false', setup)
|
||||
self.assertIn('"READY", configured_wifi_ssid, ip.c_str(), false', setup)
|
||||
self.assertIn('"WIFI", configured_wifi_ssid, nullptr, true', setup)
|
||||
|
||||
def test_lora_fresh_install_uses_compiled_cascade_defaults(self):
|
||||
profile = PROFILE.read_text(encoding="utf-8")
|
||||
lora = profile[profile.index("[SenseCapIndicator-LoRa]") :]
|
||||
|
||||
Reference in new issue
Block a user