mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
fix: Avoid duplicate scale in settings dialog (#5069)
This commit is contained in:
parent
1192393039
commit
e48d868e8c
|
@ -108,6 +108,7 @@
|
|||
- 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: Autogenerate docs/plugin-meta.lua. (#5055)
|
||||
- Dev: Removed duplicate scale in settings dialog. (#5069)
|
||||
- Dev: Fix `NotebookTab` emitting updates for every message. (#5068)
|
||||
|
||||
## 2.4.6
|
||||
|
|
|
@ -52,7 +52,6 @@ SettingsDialog::SettingsDialog(QWidget *parent)
|
|||
this->initUi();
|
||||
this->addTabs();
|
||||
this->overrideBackgroundColor_ = QColor("#111111");
|
||||
this->scaleChangedEvent(this->scale()); // execute twice to width of item
|
||||
|
||||
this->addShortcuts();
|
||||
this->signalHolder_.managedConnect(getApp()->hotkeys->onItemsUpdated,
|
||||
|
@ -128,6 +127,8 @@ void SettingsDialog::initUi()
|
|||
.setLayoutType<QVBoxLayout>()
|
||||
.withoutMargin()
|
||||
.assign(&this->ui_.tabContainer);
|
||||
this->ui_.tabContainerContainer->setFixedWidth(
|
||||
static_cast<int>(150 * this->dpi_));
|
||||
|
||||
// right side (pages)
|
||||
centerBox.emplace<QStackedLayout>()
|
||||
|
@ -257,6 +258,7 @@ void SettingsDialog::addTab(std::function<SettingsPage *()> page,
|
|||
SettingsTabId id, Qt::Alignment alignment)
|
||||
{
|
||||
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->tabs_.push_back(tab);
|
||||
|
@ -390,9 +392,13 @@ void SettingsDialog::scaleChangedEvent(float newDpi)
|
|||
this->setStyleSheet(styleSheet);
|
||||
|
||||
if (this->ui_.tabContainerContainer)
|
||||
{
|
||||
this->ui_.tabContainerContainer->setFixedWidth(int(150 * newDpi));
|
||||
}
|
||||
|
||||
this->dpi_ = newDpi;
|
||||
}
|
||||
|
||||
void SettingsDialog::themeChangedEvent()
|
||||
{
|
||||
BaseWindow::themeChangedEvent();
|
||||
|
|
|
@ -77,6 +77,7 @@ private:
|
|||
std::vector<SettingsDialogTab *> tabs_;
|
||||
SettingsDialogTab *selectedTab_{};
|
||||
SettingsDialogTab *lastSelectedByUser_{};
|
||||
float dpi_ = 1.0F;
|
||||
|
||||
friend class SettingsDialogTab;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue