mirror of
https://github.com/monero-project/monero-gui.git
synced 2024-12-23 03:59:38 +00:00
main: omit QML Screen type, use QGuiApplication::primaryScreen() instead
This commit is contained in:
parent
8444a9563e
commit
ba62f9c686
2 changed files with 15 additions and 11 deletions
19
main.qml
19
main.qml
|
@ -73,7 +73,7 @@ ApplicationWindow {
|
||||||
property int restoreHeight:0
|
property int restoreHeight:0
|
||||||
property bool daemonSynced: false
|
property bool daemonSynced: false
|
||||||
property bool walletSynced: false
|
property bool walletSynced: false
|
||||||
property int maxWindowHeight: (isAndroid || isIOS)? screenHeight : (screenHeight < 900)? 720 : 800;
|
property int maxWindowHeight: (isAndroid || isIOS)? screenAvailableHeight : (screenAvailableHeight < 900)? 720 : 800;
|
||||||
property bool daemonRunning: !persistentSettings.useRemoteNode && !disconnected
|
property bool daemonRunning: !persistentSettings.useRemoteNode && !disconnected
|
||||||
property int daemonStartStopInProgress: 0
|
property int daemonStartStopInProgress: 0
|
||||||
property alias toolTip: toolTip
|
property alias toolTip: toolTip
|
||||||
|
@ -1118,15 +1118,14 @@ ApplicationWindow {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
objectName: "appWindow"
|
objectName: "appWindow"
|
||||||
visible: true
|
visible: true
|
||||||
width: Screen.desktopAvailableWidth > 980
|
width: screenAvailableWidth > 980
|
||||||
? 980
|
? 980
|
||||||
: Math.min(Screen.desktopAvailableWidth, 800)
|
: Math.min(screenAvailableWidth, 800)
|
||||||
height: Screen.desktopAvailableHeight > maxWindowHeight
|
height: screenAvailableHeight > maxWindowHeight
|
||||||
? maxWindowHeight
|
? maxWindowHeight
|
||||||
: Math.min(Screen.desktopAvailableHeight, 700)
|
: Math.min(screenAvailableHeight, 700)
|
||||||
color: MoneroComponents.Style.appWindowBackgroundColor
|
color: MoneroComponents.Style.appWindowBackgroundColor
|
||||||
flags: persistentSettings.customDecorations ? Windows.flagsCustomDecorations : Windows.flags
|
flags: persistentSettings.customDecorations ? Windows.flagsCustomDecorations : Windows.flags
|
||||||
|
|
||||||
|
@ -1285,8 +1284,12 @@ ApplicationWindow {
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
x = (Screen.desktopAvailableWidth - width) / 2;
|
if (screenAvailableWidth > width) {
|
||||||
y = (Screen.desktopAvailableHeight - height) / 2;
|
x = (screenAvailableWidth - width) / 2;
|
||||||
|
}
|
||||||
|
if (screenAvailableHeight > height) {
|
||||||
|
y = (screenAvailableHeight - height) / 2;
|
||||||
|
}
|
||||||
|
|
||||||
translationManager.setLanguage(persistentSettings.locale.split("_")[0]);
|
translationManager.setLanguage(persistentSettings.locale.split("_")[0]);
|
||||||
|
|
||||||
|
|
|
@ -331,7 +331,7 @@ Verify update binary using 'shasum'-compatible (SHA256 algo) output signed by tw
|
||||||
// screen settings
|
// screen settings
|
||||||
// Mobile is designed on 128dpi
|
// Mobile is designed on 128dpi
|
||||||
qreal ref_dpi = 128;
|
qreal ref_dpi = 128;
|
||||||
QRect geo = QGuiApplication::primaryScreen()->availableGeometry();
|
QSize screenAvailableSize = QGuiApplication::primaryScreen()->availableVirtualSize();
|
||||||
QRect rect = QGuiApplication::primaryScreen()->geometry();
|
QRect rect = QGuiApplication::primaryScreen()->geometry();
|
||||||
qreal dpi = QGuiApplication::primaryScreen()->logicalDotsPerInch();
|
qreal dpi = QGuiApplication::primaryScreen()->logicalDotsPerInch();
|
||||||
qreal physicalDpi = QGuiApplication::primaryScreen()->physicalDotsPerInch();
|
qreal physicalDpi = QGuiApplication::primaryScreen()->physicalDotsPerInch();
|
||||||
|
@ -354,6 +354,7 @@ Verify update binary using 'shasum'-compatible (SHA256 algo) output signed by tw
|
||||||
|
|
||||||
qWarning().nospace().noquote() << "Qt:" << QT_VERSION_STR << " GUI:" << GUI_VERSION
|
qWarning().nospace().noquote() << "Qt:" << QT_VERSION_STR << " GUI:" << GUI_VERSION
|
||||||
<< " | screen: " << rect.width() << "x" << rect.height()
|
<< " | screen: " << rect.width() << "x" << rect.height()
|
||||||
|
<< " - available: " << screenAvailableSize
|
||||||
<< " - dpi: " << dpi << " - ratio:" << calculated_ratio;
|
<< " - dpi: " << dpi << " - ratio:" << calculated_ratio;
|
||||||
|
|
||||||
// registering types for QML
|
// registering types for QML
|
||||||
|
@ -464,8 +465,8 @@ Verify update binary using 'shasum'-compatible (SHA256 algo) output signed by tw
|
||||||
engine.rootContext()->setContextProperty("isOpenGL", isOpenGL);
|
engine.rootContext()->setContextProperty("isOpenGL", isOpenGL);
|
||||||
engine.rootContext()->setContextProperty("isTails", isTails);
|
engine.rootContext()->setContextProperty("isTails", isTails);
|
||||||
|
|
||||||
engine.rootContext()->setContextProperty("screenWidth", geo.width());
|
engine.rootContext()->setContextProperty("screenAvailableWidth", screenAvailableSize.width());
|
||||||
engine.rootContext()->setContextProperty("screenHeight", geo.height());
|
engine.rootContext()->setContextProperty("screenAvailableHeight", screenAvailableSize.height());
|
||||||
|
|
||||||
#ifndef Q_OS_IOS
|
#ifndef Q_OS_IOS
|
||||||
const QString desktopFolder = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);
|
const QString desktopFolder = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);
|
||||||
|
|
Loading…
Reference in a new issue