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();
#endif
this->moveIntoDesktopRect(this);
//this->moveIntoDesktopRect(this);
this->calcButtonsSizes();
}

View file

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