From cf0b680298501ba8ea235faa7939c800df3930b8 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Thu, 5 Oct 2023 07:03:38 -0500 Subject: 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 --- ui/qt5/datetimepage.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ui/qt5') 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; -- cgit v1.2.3-70-g09d2