mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 20:15:35 +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()
|
||||
{
|
||||
const QByteArray v = qgetenv("QT_AUTO_SCREEN_SCALE_FACTOR");
|
||||
return !v.isEmpty();
|
||||
return CGuiUtility::isUsingHighDpiScreenSupport();
|
||||
}
|
||||
|
||||
bool CGuiApplication::saveWindowGeometryAndState(const QMainWindow *window) const
|
||||
@@ -280,21 +279,15 @@ namespace BlackGui
|
||||
void CGuiApplication::onStartUpCompleted()
|
||||
{
|
||||
CApplication::onStartUpCompleted();
|
||||
this->setCurrentFont();
|
||||
if (m_splashScreen)
|
||||
{
|
||||
m_splashScreen->close();
|
||||
m_splashScreen.reset();
|
||||
}
|
||||
this->setCurrentFontValues();
|
||||
|
||||
const QString metricInfo = CGuiUtility::metricsInfo();
|
||||
CLogMessage(this).info(metricInfo);
|
||||
|
||||
// window size
|
||||
if (m_saveMainWidgetState)
|
||||
if (m_minWidthChars > 0 || m_minHeightChars > 0)
|
||||
{
|
||||
this->restoreWindowGeometryAndState();
|
||||
}
|
||||
else if (m_minWidthChars > 0 || m_minHeightChars > 0)
|
||||
{
|
||||
const QSize s = CGuiUtility::fontMetricsEstimateSize(m_minWidthChars, m_minHeightChars);
|
||||
const QSizeF s = CGuiUtility::fontMetricsEstimateSize(m_minWidthChars, m_minHeightChars);
|
||||
QWidget *mw = CGuiUtility::mainApplicationWidget();
|
||||
if (mw)
|
||||
{
|
||||
|
||||
@@ -29,8 +29,7 @@ int main(int argc, char *argv[])
|
||||
CSwiftGuiStdApplication a; // application with contexts
|
||||
a.setSignalStartupAutomatically(false); // application will signal startup on its own
|
||||
a.splashScreen(CIcons::swift256());
|
||||
a.setSaveMainWidgetState(true);
|
||||
// a.setMinimumSizeInCharacters(80, 60); // experimental
|
||||
a.setMinimumSizeInCharacters(60, 42); // experimental
|
||||
if (!a.parseAndSynchronizeSetup()) { return EXIT_FAILURE; }
|
||||
if (!a.hasSetupReader() || !a.start())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user