mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-23 13:55:36 +08:00
Ref T220, use improved version of screen geometry detection
* use cmd.line argument to skip restoring if needed * close splash screen as last * log metrics info
This commit is contained in:
@@ -253,8 +253,7 @@ namespace BlackGui
|
|||||||
|
|
||||||
bool CGuiApplication::isUsingHighDpiScreenSupport()
|
bool CGuiApplication::isUsingHighDpiScreenSupport()
|
||||||
{
|
{
|
||||||
const QByteArray v = qgetenv("QT_AUTO_SCREEN_SCALE_FACTOR");
|
return CGuiUtility::isUsingHighDpiScreenSupport();
|
||||||
return !v.isEmpty();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CGuiApplication::saveWindowGeometryAndState(const QMainWindow *window) const
|
bool CGuiApplication::saveWindowGeometryAndState(const QMainWindow *window) const
|
||||||
@@ -280,21 +279,15 @@ namespace BlackGui
|
|||||||
void CGuiApplication::onStartUpCompleted()
|
void CGuiApplication::onStartUpCompleted()
|
||||||
{
|
{
|
||||||
CApplication::onStartUpCompleted();
|
CApplication::onStartUpCompleted();
|
||||||
this->setCurrentFont();
|
this->setCurrentFontValues();
|
||||||
if (m_splashScreen)
|
|
||||||
{
|
const QString metricInfo = CGuiUtility::metricsInfo();
|
||||||
m_splashScreen->close();
|
CLogMessage(this).info(metricInfo);
|
||||||
m_splashScreen.reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
// window size
|
// window size
|
||||||
if (m_saveMainWidgetState)
|
if (m_minWidthChars > 0 || m_minHeightChars > 0)
|
||||||
{
|
{
|
||||||
this->restoreWindowGeometryAndState();
|
const QSizeF s = CGuiUtility::fontMetricsEstimateSize(m_minWidthChars, m_minHeightChars);
|
||||||
}
|
|
||||||
else if (m_minWidthChars > 0 || m_minHeightChars > 0)
|
|
||||||
{
|
|
||||||
const QSize s = CGuiUtility::fontMetricsEstimateSize(m_minWidthChars, m_minHeightChars);
|
|
||||||
QWidget *mw = CGuiUtility::mainApplicationWidget();
|
QWidget *mw = CGuiUtility::mainApplicationWidget();
|
||||||
if (mw)
|
if (mw)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -29,8 +29,7 @@ int main(int argc, char *argv[])
|
|||||||
CSwiftGuiStdApplication a; // application with contexts
|
CSwiftGuiStdApplication a; // application with contexts
|
||||||
a.setSignalStartupAutomatically(false); // application will signal startup on its own
|
a.setSignalStartupAutomatically(false); // application will signal startup on its own
|
||||||
a.splashScreen(CIcons::swift256());
|
a.splashScreen(CIcons::swift256());
|
||||||
a.setSaveMainWidgetState(true);
|
a.setMinimumSizeInCharacters(60, 42); // experimental
|
||||||
// a.setMinimumSizeInCharacters(80, 60); // experimental
|
|
||||||
if (!a.parseAndSynchronizeSetup()) { return EXIT_FAILURE; }
|
if (!a.parseAndSynchronizeSetup()) { return EXIT_FAILURE; }
|
||||||
if (!a.hasSetupReader() || !a.start())
|
if (!a.hasSetupReader() || !a.start())
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user