mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-27 11:05:44 +08:00
Center wizard page and use "classic style"
This commit is contained in:
committed by
Mat Sutcliffe
parent
1dd10ffe29
commit
5c870a8404
@@ -25,6 +25,9 @@
|
|||||||
<property name="modal">
|
<property name="modal">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="wizardStyle">
|
||||||
|
<enum>QWizard::ClassicStyle</enum>
|
||||||
|
</property>
|
||||||
<property name="options">
|
<property name="options">
|
||||||
<set>QWizard::HaveCustomButton1</set>
|
<set>QWizard::HaveCustomButton1</set>
|
||||||
</property>
|
</property>
|
||||||
@@ -140,8 +143,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>98</width>
|
<width>90</width>
|
||||||
<height>28</height>
|
<height>20</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="vl_CopySettingsAndCacheWidget">
|
<layout class="QVBoxLayout" name="vl_CopySettingsAndCacheWidget">
|
||||||
@@ -243,7 +246,7 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>98</width>
|
<width>89</width>
|
||||||
<height>64</height>
|
<height>64</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@@ -268,7 +271,7 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>98</width>
|
<width>75</width>
|
||||||
<height>64</height>
|
<height>64</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
|||||||
@@ -572,6 +572,29 @@ namespace BlackGui
|
|||||||
return QSizeF(w, h);
|
return QSizeF(w, h);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CGuiUtility::centerWidget(QWidget *widget)
|
||||||
|
{
|
||||||
|
const QRect screenGeometry = QApplication::desktop()->screenGeometry();
|
||||||
|
const int x = (screenGeometry.width() - widget->width()) / 2;
|
||||||
|
const int y = (screenGeometry.height() - widget->height()) / 2;
|
||||||
|
widget->move(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CGuiUtility::centerWidget(QWidget *widget, QWidget *host)
|
||||||
|
{
|
||||||
|
if (!host) { host = widget->parentWidget(); }
|
||||||
|
|
||||||
|
if (host)
|
||||||
|
{
|
||||||
|
const QRect hostRect = host->geometry();
|
||||||
|
widget->move(hostRect.center() - widget->rect().center());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CGuiUtility::centerWidget(widget);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
QString CGuiUtility::metricsInfo()
|
QString CGuiUtility::metricsInfo()
|
||||||
{
|
{
|
||||||
static const QString s("%1 %2 %3 | 80 chars: w%4 h%5 | 43 chars: w%6 h%7");
|
static const QString s("%1 %2 %3 | 80 chars: w%4 h%5 | 43 chars: w%6 h%7");
|
||||||
|
|||||||
@@ -218,6 +218,12 @@ namespace BlackGui
|
|||||||
//! Estimate size based on current font
|
//! Estimate size based on current font
|
||||||
static QSizeF fontMetricsEstimateSize(int xCharacters, int yCharacters, bool withRatio = false);
|
static QSizeF fontMetricsEstimateSize(int xCharacters, int yCharacters, bool withRatio = false);
|
||||||
|
|
||||||
|
//! Center widget to host or screen
|
||||||
|
static void centerWidget(QWidget *widget);
|
||||||
|
|
||||||
|
//! Center widget to screen
|
||||||
|
static void centerWidget(QWidget *widget, QWidget *host);
|
||||||
|
|
||||||
//! Some info about font metrics
|
//! Some info about font metrics
|
||||||
static QString metricsInfo();
|
static QString metricsInfo();
|
||||||
|
|
||||||
|
|||||||
@@ -506,6 +506,7 @@ void CSwiftLauncher::startWizard()
|
|||||||
m_wizard.reset(new CConfigurationWizard(this));
|
m_wizard.reset(new CConfigurationWizard(this));
|
||||||
}
|
}
|
||||||
m_wizard->show();
|
m_wizard->show();
|
||||||
|
CGuiUtility::centerWidget(m_wizard.data(), this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSwiftLauncher::onStyleSheetsChanged()
|
void CSwiftLauncher::onStyleSheetsChanged()
|
||||||
|
|||||||
Reference in New Issue
Block a user