Changeset d878ecb


Ignore:
Timestamp:
09/12/11 20:43:29 (11 years ago)
Author:
gregor herrmann <gregoa@…>
Branches:
master, qt5
Children:
b0cf263
Parents:
1bbcb8f
Message:

Day navigator widget: setDates()

  • 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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gui/daynavigatorwidget.cpp

    r1bbcb8f rd878ecb  
    4747    mEndDate = aEndDate;
    4848    if (!mCurDate.isValid()) mCurDate = mStartDate;
    49     else if (mCurDate < mStartDate) mCurDate = mStartDate;
    50     else if (mCurDate > mEndDate) mCurDate = mEndDate;
     49    // if mCurDate is out of range, set it to mstartDate
     50    else if (mCurDate < mStartDate || mCurDate > mEndDate) mCurDate = mStartDate;
    5151
    5252    prevDayButton->setDisabled(mCurDate == mStartDate);
    5353    nextDayButton->setDisabled(mCurDate == mEndDate);
    5454    emit(dateChanged(mCurDate));
     55    this->update();
    5556}
    5657
Note: See TracChangeset for help on using the changeset viewer.