mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-01-13 05:53:39 +00:00
Shameful hack to hide RecordView when sampling_rate == 0.
Switch visibility of child widgets -- UI fields/controls vs. a black rectangle. TODO: Fix painting and state management, which right now is just terrible.
This commit is contained in:
parent
ff57b3c8cb
commit
6a294e7d0e
@ -169,12 +169,15 @@ RecordView::RecordView(
|
|||||||
buffer_count { buffer_count }
|
buffer_count { buffer_count }
|
||||||
{
|
{
|
||||||
add_children({ {
|
add_children({ {
|
||||||
|
&rect_background,
|
||||||
&button_record,
|
&button_record,
|
||||||
&text_record_filename,
|
&text_record_filename,
|
||||||
&text_record_dropped,
|
&text_record_dropped,
|
||||||
&text_time_available,
|
&text_time_available,
|
||||||
} });
|
} });
|
||||||
|
|
||||||
|
rect_background.set_parent_rect({ { 0, 0 }, size() });
|
||||||
|
|
||||||
button_record.on_select = [this](ImageButton&) {
|
button_record.on_select = [this](ImageButton&) {
|
||||||
this->toggle();
|
this->toggle();
|
||||||
};
|
};
|
||||||
|
@ -59,6 +59,12 @@ public:
|
|||||||
if( new_sampling_rate != sampling_rate ) {
|
if( new_sampling_rate != sampling_rate ) {
|
||||||
stop();
|
stop();
|
||||||
sampling_rate = new_sampling_rate;
|
sampling_rate = new_sampling_rate;
|
||||||
|
|
||||||
|
button_record.hidden(sampling_rate == 0);
|
||||||
|
text_record_filename.hidden(sampling_rate == 0);
|
||||||
|
text_record_dropped.hidden(sampling_rate == 0);
|
||||||
|
text_time_available.hidden(sampling_rate == 0);
|
||||||
|
rect_background.hidden(sampling_rate != 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,6 +88,10 @@ private:
|
|||||||
size_t sampling_rate { 0 };
|
size_t sampling_rate { 0 };
|
||||||
SignalToken signal_token_tick_second;
|
SignalToken signal_token_tick_second;
|
||||||
|
|
||||||
|
Rectangle rect_background {
|
||||||
|
Color::black()
|
||||||
|
};
|
||||||
|
|
||||||
ImageButton button_record {
|
ImageButton button_record {
|
||||||
{ 0 * 8, 0 * 16, 2 * 8, 1 * 16 },
|
{ 0 * 8, 0 * 16, 2 * 8, 1 * 16 },
|
||||||
&bitmap_record,
|
&bitmap_record,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user