- change logic of setting mCurDate: if it's outside the conference range, set it to mStartDate
(and not to mEndDate when it's "greater") -- when going to an earlier
conference, starting on the last day doesn't really make sense
- update() the widget after changing dates.
this might be a bit expensive but it ensure that the displayed date is
what we want, and since there are many day navigator widgets there's
probably no single other place
Hopefully closes #36.
mStartDate = aStartDate;
mEndDate = aEndDate;
if (!mCurDate.isValid()) mCurDate = mStartDate;
- else if (mCurDate < mStartDate) mCurDate = mStartDate;
- else if (mCurDate > mEndDate) mCurDate = mEndDate;
+ // if mCurDate is out of range, set it to mstartDate
+ else if (mCurDate < mStartDate || mCurDate > mEndDate) mCurDate = mStartDate;
prevDayButton->setDisabled(mCurDate == mStartDate);
nextDayButton->setDisabled(mCurDate == mEndDate);
emit(dateChanged(mCurDate));
+ this->update();
}
void DayNavigatorWidget::configureNavigation()