mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2026-09-14 18:43:01 +00:00
Refactor gfxEQView UI layout for consistency (#2848)
* Refactor gfxEQView UI layout for consistency Updated control and graph positioning in gfxEQView to use a standard layout approach, aligning with other applications. Screen dimensions are now used for dynamic placement, and hardcoded values have been replaced for improved maintainability and consistency. Basically, centered for smaller and larger screens with other visual improvements. * Fixed screen to Macros - looks good now Better methods for dynamic screen size
This commit is contained in:
@@ -41,7 +41,6 @@ gfxEQView::gfxEQView(NavigationView& nav)
|
|||||||
audio::set_rate(audio::Rate::Hz_48000);
|
audio::set_rate(audio::Rate::Hz_48000);
|
||||||
audio::output::start();
|
audio::output::start();
|
||||||
receiver_model.set_headphone_volume(receiver_model.headphone_volume()); // WM8731 hack
|
receiver_model.set_headphone_volume(receiver_model.headphone_volume()); // WM8731 hack
|
||||||
//
|
|
||||||
receiver_model.enable();
|
receiver_model.enable();
|
||||||
|
|
||||||
receiver_model.set_target_frequency(frequency_value); // Retune to actual freq
|
receiver_model.set_target_frequency(frequency_value); // Retune to actual freq
|
||||||
|
|||||||
+9
-7
@@ -46,6 +46,7 @@ class gfxEQView : public View {
|
|||||||
NavigationView& nav_;
|
NavigationView& nav_;
|
||||||
|
|
||||||
uint32_t current_theme{0};
|
uint32_t current_theme{0};
|
||||||
|
|
||||||
const std::array<ColorTheme, 20> themes{
|
const std::array<ColorTheme, 20> themes{
|
||||||
ColorTheme{Color(255, 0, 255), Color(255, 255, 255)},
|
ColorTheme{Color(255, 0, 255), Color(255, 255, 255)},
|
||||||
ColorTheme{Color(0, 255, 0), Color(255, 0, 0)},
|
ColorTheme{Color(0, 255, 0), Color(255, 0, 0)},
|
||||||
@@ -68,13 +69,14 @@ class gfxEQView : public View {
|
|||||||
ColorTheme{Color(64, 64, 64), Color(255, 0, 0)},
|
ColorTheme{Color(64, 64, 64), Color(255, 0, 0)},
|
||||||
ColorTheme{Color(255, 192, 0), Color(0, 64, 128)}};
|
ColorTheme{Color(255, 192, 0), Color(0, 64, 128)}};
|
||||||
|
|
||||||
ButtonWithEncoder button_frequency{{UI_POS_X(0), UI_POS_Y(0) + 4, 11 * 8, 1 * 8}, ""};
|
// Widgets with positions using UI_POS macros
|
||||||
RFAmpField field_rf_amp{{13 * 8, UI_POS_Y(0)}};
|
ButtonWithEncoder button_frequency{{UI_POS_X(0), UI_POS_Y(0) + 4, UI_POS_WIDTH(11), UI_POS_HEIGHT(1)}, ""};
|
||||||
LNAGainField field_lna{{15 * 8, UI_POS_Y(0)}};
|
RFAmpField field_rf_amp{{UI_POS_X(12), UI_POS_Y(0) + 4}};
|
||||||
VGAGainField field_vga{{18 * 8, UI_POS_Y(0)}};
|
LNAGainField field_lna{{UI_POS_X(14), UI_POS_Y(0) + 4}};
|
||||||
Button button_mood{{21 * 8, 0, 6 * 8, 16}, "MOOD"};
|
VGAGainField field_vga{{UI_POS_X(17), UI_POS_Y(0) + 4}};
|
||||||
AudioVolumeField field_volume{{screen_width - 2 * 8, UI_POS_Y(0)}};
|
Button button_mood{{UI_POS_X(21), UI_POS_Y(0) + 4, UI_POS_WIDTH(4), UI_POS_HEIGHT(1)}, "MOOD"};
|
||||||
GraphEq gr{{2, UI_POS_DEFAULT_HEIGHT, UI_POS_MAXWIDTH - 4, UI_POS_HEIGHT_REMAINING(2)}, false};
|
AudioVolumeField field_volume{{UI_POS_X_RIGHT(2), UI_POS_Y(0) + 4}};
|
||||||
|
GraphEq gr{{2, UI_POS_Y(1) + 8, UI_POS_MAXWIDTH, UI_POS_Y_BOTTOM(1) - 28}, false};
|
||||||
|
|
||||||
rf::Frequency frequency_value{93100000};
|
rf::Frequency frequency_value{93100000};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user