Visually clean up date condition

- add "and" separator if "between" check is chosen
- split dateTimeEdit into a dateEdit and a timeEdit to make editing
  easier
- move ignore* checkboxes in front of respective edit widgets to make
  their intention more clear and add tooltips to further clarify their
  use
This commit is contained in:
WarmUpTill
2022-02-08 20:46:36 +01:00
committed by WarmUpTill
parent f8e3a3e275
commit bfa8f4d9d5
3 changed files with 104 additions and 30 deletions

View File

@@ -26,8 +26,8 @@ public:
return std::make_shared<MacroConditionDate>(m);
}
QDateTime _dateTime;
QDateTime _dateTime2;
QDateTime _dateTime = QDateTime::currentDateTime();
QDateTime _dateTime2 = QDateTime::currentDateTime();
bool _ignoreDate = false;
bool _ignoreTime = false;
bool _repeat = false;
@@ -57,8 +57,10 @@ public:
private slots:
void ConditionChanged(int cond);
void DateTimeChanged(const QDateTime &datetime);
void DateTime2Changed(const QDateTime &datetime);
void DateChanged(const QDate &date);
void TimeChanged(const QTime &time);
void Date2Changed(const QDate &date);
void Time2Changed(const QTime &time);
void IgnoreDateChanged(int state);
void IgnoreTimeChanged(int state);
void RepeatChanged(int state);
@@ -69,8 +71,11 @@ signals:
protected:
QComboBox *_condition;
QDateTimeEdit *_dateTime;
QDateTimeEdit *_dateTime2;
QDateEdit *_date;
QTimeEdit *_time;
QLabel *_separator;
QDateEdit *_date2;
QTimeEdit *_time2;
QCheckBox *_ignoreDate;
QCheckBox *_ignoreTime;
QCheckBox *_repeat;
@@ -78,6 +83,7 @@ protected:
std::shared_ptr<MacroConditionDate> _entryData;
private:
void SetWidgetStatus();
void ShowSecondDateSelection(bool visible);
bool _loading = true;
};