fix: Avoid duplicate scale in settings dialog (#5069)
This commit is contained in:
@@ -108,6 +108,7 @@
|
|||||||
- Dev: Refactor Args to be less of a singleton. (#5041)
|
- Dev: Refactor Args to be less of a singleton. (#5041)
|
||||||
- Dev: Channels without any animated elements on screen will skip updates from the GIF timer. (#5042, #5043, #5045)
|
- Dev: Channels without any animated elements on screen will skip updates from the GIF timer. (#5042, #5043, #5045)
|
||||||
- Dev: Autogenerate docs/plugin-meta.lua. (#5055)
|
- Dev: Autogenerate docs/plugin-meta.lua. (#5055)
|
||||||
|
- Dev: Removed duplicate scale in settings dialog. (#5069)
|
||||||
- Dev: Fix `NotebookTab` emitting updates for every message. (#5068)
|
- Dev: Fix `NotebookTab` emitting updates for every message. (#5068)
|
||||||
|
|
||||||
## 2.4.6
|
## 2.4.6
|
||||||
|
|||||||
@@ -52,7 +52,6 @@ SettingsDialog::SettingsDialog(QWidget *parent)
|
|||||||
this->initUi();
|
this->initUi();
|
||||||
this->addTabs();
|
this->addTabs();
|
||||||
this->overrideBackgroundColor_ = QColor("#111111");
|
this->overrideBackgroundColor_ = QColor("#111111");
|
||||||
this->scaleChangedEvent(this->scale()); // execute twice to width of item
|
|
||||||
|
|
||||||
this->addShortcuts();
|
this->addShortcuts();
|
||||||
this->signalHolder_.managedConnect(getApp()->hotkeys->onItemsUpdated,
|
this->signalHolder_.managedConnect(getApp()->hotkeys->onItemsUpdated,
|
||||||
@@ -128,6 +127,8 @@ void SettingsDialog::initUi()
|
|||||||
.setLayoutType<QVBoxLayout>()
|
.setLayoutType<QVBoxLayout>()
|
||||||
.withoutMargin()
|
.withoutMargin()
|
||||||
.assign(&this->ui_.tabContainer);
|
.assign(&this->ui_.tabContainer);
|
||||||
|
this->ui_.tabContainerContainer->setFixedWidth(
|
||||||
|
static_cast<int>(150 * this->dpi_));
|
||||||
|
|
||||||
// right side (pages)
|
// right side (pages)
|
||||||
centerBox.emplace<QStackedLayout>()
|
centerBox.emplace<QStackedLayout>()
|
||||||
@@ -257,6 +258,7 @@ void SettingsDialog::addTab(std::function<SettingsPage *()> page,
|
|||||||
SettingsTabId id, Qt::Alignment alignment)
|
SettingsTabId id, Qt::Alignment alignment)
|
||||||
{
|
{
|
||||||
auto tab = new SettingsDialogTab(this, std::move(page), name, iconPath, id);
|
auto tab = new SettingsDialogTab(this, std::move(page), name, iconPath, id);
|
||||||
|
tab->setFixedHeight(static_cast<int>(30 * this->dpi_));
|
||||||
|
|
||||||
this->ui_.tabContainer->addWidget(tab, 0, alignment);
|
this->ui_.tabContainer->addWidget(tab, 0, alignment);
|
||||||
this->tabs_.push_back(tab);
|
this->tabs_.push_back(tab);
|
||||||
@@ -390,7 +392,11 @@ void SettingsDialog::scaleChangedEvent(float newDpi)
|
|||||||
this->setStyleSheet(styleSheet);
|
this->setStyleSheet(styleSheet);
|
||||||
|
|
||||||
if (this->ui_.tabContainerContainer)
|
if (this->ui_.tabContainerContainer)
|
||||||
|
{
|
||||||
this->ui_.tabContainerContainer->setFixedWidth(int(150 * newDpi));
|
this->ui_.tabContainerContainer->setFixedWidth(int(150 * newDpi));
|
||||||
|
}
|
||||||
|
|
||||||
|
this->dpi_ = newDpi;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SettingsDialog::themeChangedEvent()
|
void SettingsDialog::themeChangedEvent()
|
||||||
|
|||||||
@@ -77,6 +77,7 @@ private:
|
|||||||
std::vector<SettingsDialogTab *> tabs_;
|
std::vector<SettingsDialogTab *> tabs_;
|
||||||
SettingsDialogTab *selectedTab_{};
|
SettingsDialogTab *selectedTab_{};
|
||||||
SettingsDialogTab *lastSelectedByUser_{};
|
SettingsDialogTab *lastSelectedByUser_{};
|
||||||
|
float dpi_ = 1.0F;
|
||||||
|
|
||||||
friend class SettingsDialogTab;
|
friend class SettingsDialogTab;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user