mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2026-09-11 17:19:29 +00:00
Multi screen support, with dyn alignment (#2801)
This commit is contained in:
@@ -183,20 +183,23 @@ void SpectrumPainterView::focus() {
|
||||
void SpectrumPainterView::paint(Painter& painter) {
|
||||
View::paint(painter);
|
||||
|
||||
size_t c;
|
||||
Point pos = {0, screen_pos().y() + 8 + footer_location};
|
||||
|
||||
for (c = 0; c < 20; c++) {
|
||||
uint16_t c;
|
||||
Point pos = {0, UI_POS_Y_BOTTOM(1)};
|
||||
Point pos2 = {0, UI_POS_Y_BOTTOM(4)};
|
||||
// 24*8 pxstripes
|
||||
for (c = 0; c < screen_width / 24 + 1; c++) {
|
||||
painter.draw_bitmap(
|
||||
pos,
|
||||
bitmap_stripes,
|
||||
Theme::getInstance()->fg_yellow->foreground,
|
||||
Theme::getInstance()->fg_yellow->background);
|
||||
if (c != 9)
|
||||
pos += {24, 0};
|
||||
else
|
||||
pos = {0, screen_pos().y() + 8 + footer_location + 32 + 8};
|
||||
painter.draw_bitmap(
|
||||
pos2,
|
||||
bitmap_stripes,
|
||||
Theme::getInstance()->fg_yellow->foreground,
|
||||
Theme::getInstance()->fg_yellow->background);
|
||||
pos += {24, 0};
|
||||
pos2 += {24, 0};
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace ui::external_app::spainter
|
||||
|
||||
+11
-11
@@ -89,57 +89,57 @@ class SpectrumPainterView : public View {
|
||||
|
||||
static constexpr int32_t footer_location = 15 * 16 + 8;
|
||||
ProgressBar progressbar{
|
||||
{4, footer_location - 16, screen_width - 8, 16}};
|
||||
{4, UI_POS_Y_BOTTOM(6) - 3, screen_width - 8, 16}};
|
||||
|
||||
Labels labels{
|
||||
{{10 * 8, footer_location + 1 * 16}, "GAIN A:", Theme::getInstance()->fg_light->foreground},
|
||||
{{1 * 8, footer_location + 2 * 16}, "BW: Du: P:", Theme::getInstance()->fg_light->foreground},
|
||||
{{10 * 8, UI_POS_Y_BOTTOM(4)}, "GAIN A:", Theme::getInstance()->fg_light->foreground},
|
||||
{{1 * 8, UI_POS_Y_BOTTOM(3)}, "BW: Du: P:", Theme::getInstance()->fg_light->foreground},
|
||||
};
|
||||
|
||||
TxFrequencyField field_frequency{
|
||||
{0 * 8, footer_location + 1 * 16},
|
||||
{UI_POS_X(0), UI_POS_Y_BOTTOM(4)},
|
||||
nav_};
|
||||
|
||||
NumberField field_rfgain{
|
||||
{14 * 8, footer_location + 1 * 16},
|
||||
{14 * 8, UI_POS_Y_BOTTOM(4)},
|
||||
2,
|
||||
{0, 47},
|
||||
1,
|
||||
' '};
|
||||
|
||||
NumberField field_rfamp{
|
||||
{19 * 8, footer_location + 1 * 16},
|
||||
{19 * 8, UI_POS_Y_BOTTOM(4)},
|
||||
2,
|
||||
{0, 14},
|
||||
14,
|
||||
' '};
|
||||
|
||||
Checkbox check_loop{
|
||||
{21 * 8, footer_location + 1 * 16},
|
||||
{21 * 8, UI_POS_Y_BOTTOM(4)},
|
||||
4,
|
||||
LanguageHelper::currentMessages[LANG_LOOP],
|
||||
true};
|
||||
|
||||
ImageButton button_play{
|
||||
{screen_width - 2 * 8, footer_location + 1 * 16, 2 * 8, 1 * 16},
|
||||
{screen_width - 2 * 8, UI_POS_Y_BOTTOM(4), 2 * 8, 1 * 16},
|
||||
&bitmap_play,
|
||||
Theme::getInstance()->fg_green->foreground,
|
||||
Theme::getInstance()->fg_green->background};
|
||||
|
||||
OptionsField option_bandwidth{
|
||||
{4 * 8, footer_location + 2 * 16},
|
||||
{4 * 8, UI_POS_Y_BOTTOM(3)},
|
||||
5,
|
||||
{}};
|
||||
|
||||
NumberField field_duration{
|
||||
{13 * 8, footer_location + 2 * 16},
|
||||
{13 * 8, UI_POS_Y_BOTTOM(3)},
|
||||
3,
|
||||
{1, 999},
|
||||
1,
|
||||
' '};
|
||||
|
||||
NumberField field_pause{
|
||||
{19 * 8, footer_location + 2 * 16},
|
||||
{19 * 8, UI_POS_Y_BOTTOM(3)},
|
||||
2,
|
||||
{0, 99},
|
||||
1,
|
||||
|
||||
@@ -58,7 +58,7 @@ class SpectrumInputImageView : public View {
|
||||
uint32_t data_start{0};
|
||||
|
||||
Button button_load_image{
|
||||
{0 * 8, 11 * 16 - 4, screen_width, 28},
|
||||
{UI_POS_X(0), UI_POS_Y_BOTTOM(10), screen_width, 28},
|
||||
"Load Image ..."};
|
||||
|
||||
bool drawBMP_scaled(const ui::Rect r, const std::string file);
|
||||
|
||||
@@ -53,43 +53,43 @@ class SpectrumInputTextView : public View {
|
||||
void on_set_text(NavigationView& nav);
|
||||
|
||||
Text text_message_0{
|
||||
{0 * 8, 0 * 16, screen_width, 16},
|
||||
{UI_POS_X(0), UI_POS_Y(0), screen_width, 16},
|
||||
""};
|
||||
|
||||
Text text_message_1{
|
||||
{0 * 8, 1 * 16, screen_width, 16},
|
||||
{UI_POS_X(0), 1 * 16, screen_width, 16},
|
||||
""};
|
||||
|
||||
Text text_message_2{
|
||||
{0 * 8, 2 * 16, screen_width, 16},
|
||||
{UI_POS_X(0), 2 * 16, screen_width, 16},
|
||||
""};
|
||||
|
||||
Text text_message_3{
|
||||
{0 * 8, 3 * 16, screen_width, 16},
|
||||
{UI_POS_X(0), 3 * 16, screen_width, 16},
|
||||
""};
|
||||
|
||||
Text text_message_4{
|
||||
{0 * 8, 4 * 16, screen_width, 16},
|
||||
{UI_POS_X(0), 4 * 16, screen_width, 16},
|
||||
""};
|
||||
|
||||
Text text_message_5{
|
||||
{0 * 8, 5 * 16, screen_width, 16},
|
||||
{UI_POS_X(0), 5 * 16, screen_width, 16},
|
||||
""};
|
||||
|
||||
Text text_message_6{
|
||||
{0 * 8, 6 * 16, screen_width, 16},
|
||||
{UI_POS_X(0), 6 * 16, screen_width, 16},
|
||||
""};
|
||||
|
||||
Text text_message_7{
|
||||
{0 * 8, 7 * 16, screen_width, 16},
|
||||
{UI_POS_X(0), 7 * 16, screen_width, 16},
|
||||
""};
|
||||
|
||||
Text text_message_8{
|
||||
{0 * 8, 8 * 16, screen_width, 16},
|
||||
{UI_POS_X(0), 8 * 16, screen_width, 16},
|
||||
""};
|
||||
|
||||
Text text_message_9{
|
||||
{0 * 8, 9 * 16, screen_width, 16},
|
||||
{UI_POS_X(0), 9 * 16, screen_width, 16},
|
||||
""};
|
||||
|
||||
std::array<Text*, 10> text_message{{
|
||||
@@ -106,7 +106,7 @@ class SpectrumInputTextView : public View {
|
||||
}};
|
||||
|
||||
Button button_message{
|
||||
{0 * 8, 11 * 16 - 4, screen_width, 28},
|
||||
{UI_POS_X(0), UI_POS_Y_BOTTOM(10), screen_width, 28},
|
||||
"Set message"};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user