Prepare for display orientation part 1 (#2661)

This commit is contained in:
Totoo
2025-05-22 17:24:53 +02:00
committed by GitHub
parent 6f6d863a14
commit a1d7cf2b86
85 changed files with 405 additions and 334 deletions

View File

@@ -55,7 +55,7 @@ SpectrumPainterView::SpectrumPainterView(
&field_pause,
});
Rect view_rect = {0, 3 * 8, 240, 80};
Rect view_rect = {0, 3 * 8, screen_width, 80};
input_image.set_parent_rect(view_rect);
input_text.set_parent_rect(view_rect);

View File

@@ -89,7 +89,7 @@ class SpectrumPainterView : public View {
static constexpr int32_t footer_location = 15 * 16 + 8;
ProgressBar progressbar{
{4, footer_location - 16, 240 - 8, 16}};
{4, footer_location - 16, screen_width - 8, 16}};
Labels labels{
{{10 * 8, footer_location + 1 * 16}, "GAIN A:", Theme::getInstance()->fg_light->foreground},

View File

@@ -244,12 +244,12 @@ std::vector<uint8_t> SpectrumInputImageView::get_line(uint16_t y) {
void SpectrumInputImageView::paint(Painter& painter) {
painter.fill_rectangle(
{{0, 40}, {240, 204}},
{{0, 40}, {screen_width, 204}},
style().background);
if (!painted) {
// This is very slow for big pictures. Do only once.
this->drawBMP_scaled({{0, 40}, {240, 160}}, this->file);
this->drawBMP_scaled({{0, 40}, {screen_width, 160}}, this->file);
painted = true;
}
}

View File

@@ -73,7 +73,7 @@ void SpectrumInputTextView::paint(Painter& painter) {
}
painter.fill_rectangle(
{{0, 40}, {240, 204}},
{{0, 40}, {screen_width, 204}},
style().background);
}