diff --git a/firmware/application/rds.cpp b/firmware/application/rds.cpp index 2cf4ec2c0..e63893680 100644 --- a/firmware/application/rds.cpp +++ b/firmware/application/rds.cpp @@ -98,7 +98,7 @@ uint16_t gen_PSN(const char * psname, const RDS_flags * rds_flags) { // 4 groups with 2 PSN characters in each for (c = 0; c < 4; c++) - make_0B_group(&group[c][0], rds_flags->PI_code, rds_flags->TP, rds_flags->PTY, rds_flags->TA, rds_flags->MS, rds_flags->DI, c, &psname[c * 2]); + make_0B_group(&group[c][0], rds_flags->PI_code, rds_flags->TP, rds_flags->PTY, rds_flags->TA, rds_flags->MS, rds_flags->DI, c, &psname[c * 2]); // Generate checkbits for each block of each group for (c = 0; c < 4; c++) { diff --git a/firmware/application/ui_adsbtx.hpp b/firmware/application/ui_adsbtx.hpp index 26ebf1417..43763c7d3 100644 --- a/firmware/application/ui_adsbtx.hpp +++ b/firmware/application/ui_adsbtx.hpp @@ -64,13 +64,13 @@ private: const Style style_val { .font = font::fixed_8x16, - .background = Color::green(), - .foreground = Color::black(), + .background = Color::black(), + .foreground = Color::green(), }; const Style style_cancel { .font = font::fixed_8x16, - .background = Color::red(), - .foreground = Color::black(), + .background = Color::black(), + .foreground = Color::red(), }; Text text_format { diff --git a/firmware/application/ui_alphanum.cpp b/firmware/application/ui_alphanum.cpp index 3c3c5cf32..339792414 100644 --- a/firmware/application/ui_alphanum.cpp +++ b/firmware/application/ui_alphanum.cpp @@ -53,14 +53,14 @@ AlphanumView::AlphanumView( static constexpr Style style_alpha { .font = font::fixed_8x16, - .background = Color(191,31,31), - .foreground = Color::black() + .background = Color::black(), + .foreground = Color(191,31,31) }; static constexpr Style style_num { .font = font::fixed_8x16, - .background = Color(191,191,31), - .foreground = Color::black() + .background = Color::black(), + .foreground = Color(191,191,31) }; txtidx = strlen(txt); diff --git a/firmware/application/ui_encoders.hpp b/firmware/application/ui_encoders.hpp index 60c88ff5e..35d8d575f 100644 --- a/firmware/application/ui_encoders.hpp +++ b/firmware/application/ui_encoders.hpp @@ -256,13 +256,13 @@ private: const Style style_val { .font = font::fixed_8x16, - .background = Color::green(), - .foreground = Color::black(), + .background = Color::black(), + .foreground = Color::green(), }; const Style style_cancel { .font = font::fixed_8x16, - .background = Color::red(), - .foreground = Color::black(), + .background = Color::black(), + .foreground = Color::red(), }; const Style style_address { diff --git a/firmware/application/ui_lcr.hpp b/firmware/application/ui_lcr.hpp index a6d69533a..560a74fe6 100644 --- a/firmware/application/ui_lcr.hpp +++ b/firmware/application/ui_lcr.hpp @@ -98,13 +98,13 @@ private: const Style style_val { .font = font::fixed_8x16, - .background = Color::green(), - .foreground = Color::black(), + .background = Color::black(), + .foreground = Color::green(), }; const Style style_cancel { .font = font::fixed_8x16, - .background = Color::red(), - .foreground = Color::black(), + .background = Color::black(), + .foreground = Color::red(), }; std::array buttons; diff --git a/firmware/application/ui_navigation.cpp b/firmware/application/ui_navigation.cpp index 3f5f7a563..a366edd13 100644 --- a/firmware/application/ui_navigation.cpp +++ b/firmware/application/ui_navigation.cpp @@ -105,7 +105,7 @@ SystemStatusView::SystemStatusView() { } void SystemStatusView::set_back_enabled(bool new_value) { - button_back.set_text(new_value ? back_text_enabled : back_text_disabled); + //button_back.set_text(new_value ? back_text_enabled : back_text_disabled); button_back.set_focusable(new_value); } diff --git a/firmware/application/ui_navigation.hpp b/firmware/application/ui_navigation.hpp index 4a06bd403..a3e5b884b 100644 --- a/firmware/application/ui_navigation.hpp +++ b/firmware/application/ui_navigation.hpp @@ -57,12 +57,12 @@ public: private: static constexpr auto default_title = "PortaPack|Havoc"; - static constexpr auto back_text_enabled = " < "; - static constexpr auto back_text_disabled = " * "; + //static constexpr auto back_text_enabled = " < "; + //static constexpr auto back_text_disabled = " * "; Button button_back { - { 0 * 8, 0 * 16, 3 * 8, 16 }, - back_text_disabled, + { 0 * 8, 0 * 16, 20, 16 }, + "", //back_text_disabled, }; Text title { diff --git a/firmware/application/ui_numbers.hpp b/firmware/application/ui_numbers.hpp index f0624d7a0..e8155f379 100644 --- a/firmware/application/ui_numbers.hpp +++ b/firmware/application/ui_numbers.hpp @@ -56,8 +56,8 @@ private: Style style_red { .font = font::fixed_8x16, - .background = Color::red(), - .foreground = Color::black() + .background = Color::black(), + .foreground = Color::red() }; NavigationView& nav_; diff --git a/firmware/application/ui_rds.cpp b/firmware/application/ui_rds.cpp index d623bb723..61dff2a62 100644 --- a/firmware/application/ui_rds.cpp +++ b/firmware/application/ui_rds.cpp @@ -81,6 +81,12 @@ RDSView::RDSView(NavigationView& nav) { strcpy(PSN, "TEST1234"); strcpy(RadioText, "Radiotext test ABCD1234"); + rds_flags.DI = false; + rds_flags.MS = false; + rds_flags.PI_code = 0x1337; + rds_flags.TA = false; + rds_flags.TP = true; + add_children({ { &field_frequency, &options_pty, @@ -110,7 +116,6 @@ RDSView::RDSView(NavigationView& nav) { }; }; - options_pty.set_selected_index(0); // None options_countrycode.set_selected_index(18); // France options_coverage.set_selected_index(0); // Local @@ -118,6 +123,8 @@ RDSView::RDSView(NavigationView& nav) { rds_flags.PTY = v; }; + options_pty.set_selected_index(0); // None + button_editpsn.on_select = [this,&nav](Button&) { textentry(nav, PSN, 8); }; diff --git a/firmware/application/ui_xylos.hpp b/firmware/application/ui_xylos.hpp index 171ce85bb..3ddcb2b11 100644 --- a/firmware/application/ui_xylos.hpp +++ b/firmware/application/ui_xylos.hpp @@ -171,6 +171,7 @@ private: const char ccir_base[21] = "0000000000B0000B0000"; + /* const char xylos_sequence[9][21] = { "0E0E18920EB1E10B0E0E", "0E0E1890E0B0E12B0E0E", @@ -179,9 +180,9 @@ private: "0E0E18920EB1E10B0E0E", "0E0E18920EB1E10B0E0E", "0E0E181AEAB10E0B0E0E", - "0E01E81AEAB10E0B0E0E", // 2016-05-22 05:22:29 0E01E81AEA/10E0/0E0E + "0E01E81AEAB10E0B0E0E", "0E03181AEAB10E0B0E0E" - }; + };*/ unsigned int sequence_idx; @@ -192,13 +193,13 @@ private: const Style style_val { .font = font::fixed_8x16, - .background = Color::green(), - .foreground = Color::black(), + .background = Color::black(), + .foreground = Color::green(), }; const Style style_cancel { .font = font::fixed_8x16, - .background = Color::red(), - .foreground = Color::black(), + .background = Color::black(), + .foreground = Color::red(), }; const Style style_grey { .font = font::fixed_8x16, diff --git a/firmware/common/ui.hpp b/firmware/common/ui.hpp index bee55b86c..1d69f9d81 100644 --- a/firmware/common/ui.hpp +++ b/firmware/common/ui.hpp @@ -92,10 +92,18 @@ struct Color { return { 255, 255, 255 }; } - static constexpr Color grey() { + static constexpr Color light_grey() { return { 127, 127, 127 }; } + static constexpr Color grey() { + return { 91, 91, 91 }; + } + + static constexpr Color dark_grey() { + return { 63, 63, 63 }; + } + static constexpr Color purple() { return { 204, 0, 102 }; } diff --git a/firmware/common/ui_widget.cpp b/firmware/common/ui_widget.cpp index df9ff7733..5525f9f40 100644 --- a/firmware/common/ui_widget.cpp +++ b/firmware/common/ui_widget.cpp @@ -671,14 +671,25 @@ std::string Button::text() const { } void Button::paint(Painter& painter) { + Color bg, fg; const auto r = screen_rect(); - const auto paint_style = (has_focus() || highlighted()) ? style().invert() : style(); - - painter.draw_rectangle(r, paint_style.foreground); + if (has_focus() || highlighted()) { + bg = style().foreground; + fg = Color::black(); + } else { + bg = Color::grey(); + fg = style().foreground; + } + + const Style paint_style = { style().font, bg, fg }; + + painter.draw_rectangle({r.pos, {r.size.w, 1}}, Color::light_grey()); + painter.draw_rectangle({r.pos.x, r.pos.y + r.size.h - 1, r.size.w, 1}, Color::dark_grey()); + painter.draw_rectangle({r.pos.x + r.size.w - 1, r.pos.y, 1, r.size.h}, Color::dark_grey()); painter.fill_rectangle( - { r.pos.x + 1, r.pos.y + 1, r.size.w - 2, r.size.h - 2 }, + { r.pos.x, r.pos.y + 1, r.size.w - 1, r.size.h - 2 }, paint_style.background ); diff --git a/firmware/portapack-h1-havoc.bin b/firmware/portapack-h1-havoc.bin index f1b4b0637..34bb3c86a 100644 Binary files a/firmware/portapack-h1-havoc.bin and b/firmware/portapack-h1-havoc.bin differ