2020-07-21 06:05 AM
Is the colon between the hours and minutes in the digital clock accessible? Is there a way to make it blink at the "seconds" ?
2020-07-22 01:23 AM
Hello,
Yes adding a colon is doable.
Just copy the digitalClock.cpp and .hpp in your gui folder (respectively in src/common and include/gui/common).
Then modify the updateClock() function in digitalClock.cpp as follows:
void DigitalClock::updateClock()
{
// ....
else if (displayMode == DISPLAY_24_HOUR)
{
const char* format = useLeadingZeroForHourIndicator ? "%02d;%02d;%02d" : "%d;%02d;%02d";
Unicode::snprintf(buffer, BUFFER_SIZE, format, currentHour, currentMinute, currentSecond);
}
text.invalidate();
}
}
What do you mean by "blink at the seconds" ?
/Alexandre
2020-07-22 06:30 AM
2020-07-22 07:06 AM
Hello,
This blinking effect is difficult with the current digital clock widget. The widget has to be changed quite a lot (it might even be better to create your own widget based on the analog clock).
The reason is that right now the widget has only one single text area. But to make something blink, you need to create a dedicated text area that you make disappear and reappear every second.
As a first idea, I would create 3 text areas in a container, one for hours, one for the colon, one for the minutes.
I would modify the hours and minutes accordingly in the handleTickEvent and also make the colon appear and disappear (setVisible(true or false)) in this function as well.
If I have time I will make something.
/Alexandre
2020-07-23 01:46 AM
2020-08-05 07:24 AM
Thanks. That seems more simplifying the issue, just using textAreas instead of the digital clock widget, great thinking!