mirror of
https://github.com/Serial-Studio/Serial-Studio.git
synced 2025-01-15 05:22:53 +08:00
Fix Windows-specific glitches
This commit is contained in:
parent
b08c6954e3
commit
fae3c56c27
@ -103,6 +103,35 @@ Window {
|
||||
property alias minimizeEnabled: _title.minimizeEnabled
|
||||
property alias maximizeEnabled: _title.maximizeEnabled
|
||||
|
||||
//
|
||||
// Ensure that window size & position is valid upon showing
|
||||
//
|
||||
Component.onCompleted: {
|
||||
// Reset window size for whatever reason
|
||||
if (root.width <= 0 || root.height <= 0) {
|
||||
root.width = root.minimumWidth
|
||||
root.height = root.minimumHeight
|
||||
}
|
||||
|
||||
// Startup verifications to ensure that app is displayed inside the screen
|
||||
if (root.x < 0 || root.x >= Screen.desktopAvailableWidth)
|
||||
root.x = 100
|
||||
if (root.y < 0 || root.y >= Screen.desktopAvailableHeight)
|
||||
root.y = 100
|
||||
|
||||
// Startup verifications to ensure that app fits in current screen
|
||||
if (root.width > Screen.desktopAvailableWidth) {
|
||||
root.x = 100
|
||||
root.width = Screen.desktopAvailableWidth - root.x
|
||||
}
|
||||
|
||||
// Startup verifications to ensure that app fits in current screen
|
||||
if (root.height > Screen.desktopAvailableHeight) {
|
||||
root.y = 100
|
||||
root.height = Screen.desktopAvailableHeight - root.y
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Shadow implementation
|
||||
//
|
||||
|
@ -82,30 +82,6 @@ FramelessWindow.CustomWindow {
|
||||
// Displays the main window & checks for updates
|
||||
//
|
||||
function showMainWindow() {
|
||||
// Reset window size for whatever reason
|
||||
if (root.width <= 0 || root.height <= 0) {
|
||||
root.width = root.minimumWidth
|
||||
root.height = root.minimumHeight
|
||||
}
|
||||
|
||||
// Startup verifications to ensure that app is displayed inside the screen
|
||||
if (root.x < 0 || root.x >= Screen.desktopAvailableWidth)
|
||||
root.x = 100
|
||||
if (root.y < 0 || root.y >= Screen.desktopAvailableHeight)
|
||||
root.y = 100
|
||||
|
||||
// Startup verifications to ensure that app fits in current screen
|
||||
if (root.width > Screen.desktopAvailableWidth) {
|
||||
root.x = 100
|
||||
root.width = Screen.desktopAvailableWidth - root.x
|
||||
}
|
||||
|
||||
// Startup verifications to ensure that app fits in current screen
|
||||
if (root.height > Screen.desktopAvailableHeight) {
|
||||
root.y = 100
|
||||
root.height = Screen.desktopAvailableHeight - root.y
|
||||
}
|
||||
|
||||
// Increment app launch count & hide splash screen
|
||||
++appLaunchCount
|
||||
Cpp_ModuleManager.hideSplashscreen()
|
||||
|
@ -99,7 +99,7 @@ Item {
|
||||
// Donations dialog
|
||||
//
|
||||
Loader {
|
||||
asynchronous: true
|
||||
asynchronous: false
|
||||
sourceComponent: Windows.Donate {
|
||||
Component.onCompleted: app.donations = this
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user