diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2023-10-05 07:03:38 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2023-10-05 07:03:38 -0500 |
commit | cf0b680298501ba8ea235faa7939c800df3930b8 (patch) | |
tree | d4c74172b6a7a460130c09671f0438e001ada902 | |
parent | 0c2089d40a09db1d9c4f60bf88937288a3733115 (diff) | |
download | horizon-cf0b680298501ba8ea235faa7939c800df3930b8.tar.gz horizon-cf0b680298501ba8ea235faa7939c800df3930b8.tar.bz2 horizon-cf0b680298501ba8ea235faa7939c800df3930b8.tar.xz horizon-cf0b680298501ba8ea235faa7939c800df3930b8.zip |
Qt UI: Don't update date/time inputs while focused
This makes for poor UX. If the user can't type fast, it will keep
updating underneath them, which is very frustrating. Saw in IRL test.
Fixes: #358
-rw-r--r-- | ui/qt5/datetimepage.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ui/qt5/datetimepage.cc b/ui/qt5/datetimepage.cc index 492c264..8b01d30 100644 --- a/ui/qt5/datetimepage.cc +++ b/ui/qt5/datetimepage.cc @@ -174,8 +174,8 @@ DateTimePage::DateTimePage(QWidget *parent) : HorizonWizardPage(parent) { updateTimer = new QTimer(this); updateTimer->setInterval(1000); connect(updateTimer, &QTimer::timeout, [=]{ - dateEdit->setDate(QDate::currentDate()); - timeEdit->setTime(QTime::currentTime()); + if(!dateEdit->hasFocus()) dateEdit->setDate(QDate::currentDate()); + if(!timeEdit->hasFocus()) timeEdit->setTime(QTime::currentTime()); }); QHBoxLayout *dateTimeLayout = new QHBoxLayout; |