fixed user popup size issues

This commit is contained in:
fourtf 2019-09-08 20:05:40 +02:00
parent 343cd3970a
commit 3158ed4085
2 changed files with 17 additions and 11 deletions

View file

@ -521,7 +521,7 @@ void BaseWindow::resizeEvent(QResizeEvent *)
getApp()->windows->queueSave(); getApp()->windows->queueSave();
#endif #endif
this->moveIntoDesktopRect(this); //this->moveIntoDesktopRect(this);
this->calcButtonsSizes(); this->calcButtonsSizes();
} }

View file

@ -55,8 +55,8 @@ UserInfoPopup::UserInfoPopup()
auto app = getApp(); auto app = getApp();
auto layout = auto layout = LayoutCreator<QWidget>(this->getLayoutContainer())
LayoutCreator<UserInfoPopup>(this).setLayoutType<QVBoxLayout>(); .setLayoutType<QVBoxLayout>();
// first line // first line
auto head = layout.emplace<QHBoxLayout>().withoutMargin(); auto head = layout.emplace<QHBoxLayout>().withoutMargin();
@ -223,26 +223,32 @@ UserInfoPopup::UserInfoPopup()
}); });
} }
// this->setStyleSheet("font-size: 11pt;");
this->installEvents(); this->installEvents();
this->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Policy::Ignored);
} }
void UserInfoPopup::themeChangedEvent() void UserInfoPopup::themeChangedEvent()
{ {
BaseWindow::themeChangedEvent(); BaseWindow::themeChangedEvent();
this->setStyleSheet( for (auto &&child : this->findChildren<QCheckBox *>())
"background: #333; font-size: " + {
QString::number(getFonts() child->setFont(getFonts()->getFont(FontStyle::UiMedium, this->scale()));
->getFont(FontStyle::UiMediumBold, this->scale()) }
.pixelSize()) +
"px;");
} }
void UserInfoPopup::scaleChangedEvent(float /*scale*/) void UserInfoPopup::scaleChangedEvent(float /*scale*/)
{ {
themeChangedEvent(); themeChangedEvent();
QTimer::singleShot(20, this, [this] {
auto geo = this->geometry();
geo.setWidth(10);
geo.setHeight(10);
this->setGeometry(geo);
});
} }
void UserInfoPopup::installEvents() void UserInfoPopup::installEvents()