Skip to content

Commit

Permalink
Timeline: ui restore bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rodlie committed Dec 15, 2024
1 parent e423168 commit a591281
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/app/GUI/timelinewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,8 @@ TimelineWidget::TimelineWidget(Document &document,
chww->raise();
connect(chww, &ChangeWidthWidget::widthSet,
this, &TimelineWidget::setBoxesListWidth);
setBoxesListWidth(chww->getCurrentWidth());

readSettings();
readSettings(chww);
}

TimelineWidget::~TimelineWidget()
Expand Down Expand Up @@ -513,11 +512,12 @@ void TimelineWidget::writeStateXEV(QDomElement& ele, QDomDocument& doc,
ele.setAttribute("search", mSearchLine->text());
}

void TimelineWidget::readSettings()
void TimelineWidget::readSettings(ChangeWidthWidget *chww)
{
const auto tWidth = AppSupport::getSettings("ui",
"TimeLineMenuWidth");
if (tWidth.isValid()) { setBoxesListWidth(tWidth.toInt()); }
setBoxesListWidth(tWidth.isValid() ? tWidth.toInt() : chww->getCurrentWidth());
if (tWidth.isValid()) { chww->setWidth(tWidth.toInt()); }
}

void TimelineWidget::writeSettings()
Expand Down
2 changes: 1 addition & 1 deletion src/app/GUI/timelinewidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class TimelineWidget : public QWidget {
RuntimeIdToWriteId& objListIdConv);
void writeStateXEV(QDomElement& ele, QDomDocument& doc,
RuntimeIdToWriteId& objListIdConv) const;
void readSettings();
void readSettings(ChangeWidthWidget *chww);
void writeSettings();

private:
Expand Down
6 changes: 6 additions & 0 deletions src/ui/widgets/changewidthwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,9 @@ void ChangeWidthWidget::leaveEvent(QEvent *) {
mHover = false;
update();
}

void ChangeWidthWidget::setWidth(int w)
{
mCurrentWidth = w;
updatePos();
}
2 changes: 2 additions & 0 deletions src/ui/widgets/changewidthwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ class UI_EXPORT ChangeWidthWidget : public QWidget
return mCurrentWidth;
}

void setWidth(int w);

signals:
void widthSet(int);

Expand Down

0 comments on commit a591281

Please sign in to comment.