mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-20 16:47:32 +00:00
Cleaned up and tweaked
This commit is contained in:
@@ -409,10 +409,17 @@ void Labels::paint(Painter& painter) {
|
||||
|
||||
void LiveDateTime::on_tick_second() {
|
||||
rtcGetTime(&RTCD1, &datetime);
|
||||
text = "";
|
||||
|
||||
text = to_string_dec_uint(datetime.month(), 2, '0') + "/" + to_string_dec_uint(datetime.day(), 2, '0') + " " +
|
||||
to_string_dec_uint(datetime.hour(), 2, '0') + ":" + to_string_dec_uint(datetime.minute(), 2, '0');
|
||||
if(date_enabled){
|
||||
text = to_string_dec_uint(datetime.month(), 2, '0') + "/" + to_string_dec_uint(datetime.day(), 2, '0') + " ";
|
||||
}
|
||||
|
||||
text = text + to_string_dec_uint(datetime.hour(), 2, '0') + ":" + to_string_dec_uint(datetime.minute(), 2, '0');
|
||||
|
||||
if(seconds_enabled){
|
||||
text = text + ":" + to_string_dec_uint(datetime.second(), 2, '0');
|
||||
}
|
||||
set_dirty();
|
||||
}
|
||||
|
||||
@@ -444,6 +451,14 @@ void LiveDateTime::paint(Painter& painter) {
|
||||
);
|
||||
}
|
||||
|
||||
void LiveDateTime::set_date_enabled(bool new_value){
|
||||
this->date_enabled = new_value;
|
||||
}
|
||||
|
||||
void LiveDateTime::set_seconds_enabled(bool new_value) {
|
||||
this->seconds_enabled = new_value;
|
||||
}
|
||||
|
||||
/* BigFrequency **********************************************************/
|
||||
|
||||
BigFrequency::BigFrequency(
|
||||
@@ -1046,16 +1061,6 @@ bool NewButton::on_touch(const TouchEvent event) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/* DateTimeButton ********************************************************/
|
||||
|
||||
DateTimeButton::DateTimeButton(
|
||||
Rect parent_rect,
|
||||
std::string text
|
||||
) : Button { parent_rect , text_}
|
||||
{
|
||||
set_focusable(true);
|
||||
}
|
||||
|
||||
|
||||
/* Image *****************************************************************/
|
||||
|
||||
|
Reference in New Issue
Block a user