mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Fix startup crash on Windows/Linux with HighDPI monitors
The problem is setStyle being applied before button creation...
This bug was introduced in c15d1bc, sorry.
This commit is contained in:
@@ -332,6 +332,16 @@ MainWindow::MainWindow(const QDir &home)
|
||||
styleSelector->setPalette(metal);
|
||||
connect(styleSelector, SIGNAL(segmentSelected(int)), this, SLOT(setStyleFromSegment(int))); //avoid toggle infinitely
|
||||
|
||||
// What's this button
|
||||
whatsthis = new QPushButton(this);
|
||||
whatsthis->setIcon(myHelper->icon());
|
||||
whatsthis->setFixedHeight(24 * dpiYFactor);
|
||||
whatsthis->setIconSize(isize);
|
||||
whatsthis->setStyle(toolStyle);
|
||||
whatsthis->setToolTip(tr("What's This?"));
|
||||
whatsthis->setPalette(metal);
|
||||
connect(whatsthis, SIGNAL(clicked(bool)), this, SLOT(enterWhatsThisMode()));
|
||||
|
||||
#if defined(WIN32) || defined (Q_OS_LINUX)
|
||||
// are we in hidpi mode? if so undo global defaults for toolbar pushbuttons
|
||||
if (dpiXFactor > 1) {
|
||||
@@ -343,16 +353,6 @@ MainWindow::MainWindow(const QDir &home)
|
||||
}
|
||||
#endif
|
||||
|
||||
// What's this button
|
||||
whatsthis = new QPushButton(this);
|
||||
whatsthis->setIcon(myHelper->icon());
|
||||
whatsthis->setFixedHeight(24 * dpiYFactor);
|
||||
whatsthis->setIconSize(isize);
|
||||
whatsthis->setStyle(toolStyle);
|
||||
whatsthis->setToolTip(tr("What's This?"));
|
||||
whatsthis->setPalette(metal);
|
||||
connect(whatsthis, SIGNAL(clicked(bool)), this, SLOT(enterWhatsThisMode()));
|
||||
|
||||
// add a search box on far right, but with a little space too
|
||||
searchBox = new SearchFilterBox(this,context,false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user