Skip to content

Commit

Permalink
fix: [titlebar]view mode button issue
Browse files Browse the repository at this point in the history
do not change view mode if the dir has set mode by user when change setting.

Log: fix titlebar issue
Bug: https://pms.uniontech.com/bug-view-238527.html
  • Loading branch information
Lighto-Ku committed Jan 23, 2024
1 parent 3fcd1a1 commit 53b800e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,12 @@ void OptionButtonBoxPrivate::switchMode(ViewMode mode)

void OptionButtonBoxPrivate::onViewModeChanged(int mode)
{
auto viewMode = static_cast<ViewMode>(mode);
switchMode(viewMode);
if (Application::appObtuselySetting()->value("FileViewState", currentUrl).toMap().contains("viewMode")) {
loadViewMode(currentUrl);
} else {
auto viewMode = static_cast<ViewMode>(mode);
switchMode(viewMode);
}
}

DToolButton *OptionButtonBox::detailButton() const
Expand Down Expand Up @@ -131,6 +135,8 @@ void OptionButtonBox::onUrlChanged(const QUrl &url)
d->iconViewButton->setHidden(false);
d->detailButton->setHidden(false);
}

d->currentUrl = url;
}

void OptionButtonBox::initializeUi()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public slots:
QHBoxLayout *hBoxLayout { nullptr };

ViewMode currentMode { ViewMode::kIconMode };
QUrl currentUrl;
};
} // namespace dfmplugin_titlebar

Expand Down

0 comments on commit 53b800e

Please sign in to comment.