Ensure that titlebar & window controls are visible when using the WM decorates the dialogs

This commit is contained in:
Alex Spataru 2021-12-22 19:56:45 -05:00
parent ca47886e95
commit 7efadca2cd
9 changed files with 26 additions and 32 deletions

View File

@ -72,11 +72,11 @@ Item {
minimumWidth: 640 + shadowMargin
minimumHeight: 480 + shadowMargin
title: externalWidget.widgetTitle
extraFlags: Qt.WindowStaysOnTopHint
titlebarText: Cpp_ThemeManager.text
titlebarColor: Cpp_ThemeManager.widgetWindowBackground
backgroundColor: Cpp_ThemeManager.widgetWindowBackground
borderColor: isMaximized ? backgroundColor : Cpp_ThemeManager.highlight
extraFlags: Qt.WindowStaysOnTopHint | Qt.Dialog | Qt.WindowCloseButtonHint | Qt.WindowTitleHint
Timer {
id: timer

View File

@ -49,6 +49,10 @@ QtWindow.Window {
root.flags = root.customFlags | root.extraFlags
else
root.flags = Qt.Window | root.extraFlags
var prevVisible = root.visible
root.visible = false
root.visible = prevVisible
}
}

View File

@ -65,14 +65,6 @@ Item {
}
}
//
// Remove selection
//
Shortcut {
sequence: "escape"
onActivated: textEdit.clearSelection()
}
//
// Window shadow (must go before window declaration
// to avoid blurry artifacts & glitches).

View File

@ -41,11 +41,11 @@ FramelessWindow.CustomWindow {
title: qsTr("About")
width: minimumWidth
height: minimumHeight
extraFlags: Qt.WindowStaysOnTopHint
x: (Screen.desktopAvailableWidth - width) / 2
y: (Screen.desktopAvailableHeight - height) / 2
minimumWidth: column.implicitWidth + 4 * app.spacing + 2 * root.shadowMargin
maximumWidth: column.implicitWidth + 4 * app.spacing + 2 * root.shadowMargin
extraFlags: Qt.WindowStaysOnTopHint | Qt.Dialog | Qt.WindowCloseButtonHint | Qt.WindowTitleHint
minimumHeight: column.implicitHeight + 4 * app.spacing + titlebar.height + 2 * root.shadowMargin
maximumHeight: column.implicitHeight + 4 * app.spacing + titlebar.height + 2 * root.shadowMargin

View File

@ -38,7 +38,6 @@ FramelessWindow.CustomWindow {
minimizeEnabled: false
maximizeEnabled: false
title: qsTr("Acknowledgements")
extraFlags: Qt.WindowStaysOnTopHint
titlebarText: Cpp_ThemeManager.text
x: (Screen.desktopAvailableWidth - width) / 2
y: (Screen.desktopAvailableHeight - height) / 2
@ -46,6 +45,7 @@ FramelessWindow.CustomWindow {
backgroundColor: Cpp_ThemeManager.dialogBackground
minimumWidth: column.implicitWidth + 4 * app.spacing + 2 * root.shadowMargin
maximumWidth: column.implicitWidth + 4 * app.spacing + 2 * root.shadowMargin
extraFlags: Qt.WindowStaysOnTopHint | Qt.Dialog | Qt.WindowCloseButtonHint | Qt.WindowTitleHint
minimumHeight: column.implicitHeight + 4 * app.spacing + titlebar.height + 2 * root.shadowMargin
maximumHeight: column.implicitHeight + 4 * app.spacing + titlebar.height + 2 * root.shadowMargin

View File

@ -38,7 +38,6 @@ FramelessWindow.CustomWindow {
minimizeEnabled: false
maximizeEnabled: false
title: qsTr("CSV Player")
extraFlags: Qt.WindowStaysOnTopHint
titlebarText: Cpp_ThemeManager.text
x: (Screen.desktopAvailableWidth - width) / 2
y: (Screen.desktopAvailableHeight - height) / 2
@ -46,6 +45,7 @@ FramelessWindow.CustomWindow {
backgroundColor: Cpp_ThemeManager.dialogBackground
minimumWidth: column.implicitWidth + 4 * app.spacing + 2 * root.shadowMargin
maximumWidth: column.implicitWidth + 4 * app.spacing + 2 * root.shadowMargin
extraFlags: Qt.WindowStaysOnTopHint | Qt.Dialog | Qt.WindowCloseButtonHint | Qt.WindowTitleHint
minimumHeight: column.implicitHeight + 4 * app.spacing + titlebar.height + 2 * root.shadowMargin
maximumHeight: column.implicitHeight + 4 * app.spacing + titlebar.height + 2 * root.shadowMargin

View File

@ -39,7 +39,6 @@ FramelessWindow.CustomWindow {
height: minimumHeight
minimizeEnabled: false
maximizeEnabled: false
extraFlags: Qt.WindowStaysOnTopHint
titlebarText: Cpp_ThemeManager.text
x: (Screen.desktopAvailableWidth - width) / 2
y: (Screen.desktopAvailableHeight - height) / 2
@ -47,6 +46,7 @@ FramelessWindow.CustomWindow {
backgroundColor: Cpp_ThemeManager.dialogBackground
minimumWidth: column.implicitWidth + 4 * app.spacing + 2 * root.shadowMargin
maximumWidth: column.implicitWidth + 4 * app.spacing + 2 * root.shadowMargin
extraFlags: Qt.WindowStaysOnTopHint | Qt.Dialog | Qt.WindowCloseButtonHint | Qt.WindowTitleHint
minimumHeight: column.implicitHeight + 4 * app.spacing + titlebar.height + 2 * root.shadowMargin
maximumHeight: column.implicitHeight + 4 * app.spacing + titlebar.height + 2 * root.shadowMargin

View File

@ -43,11 +43,11 @@ FramelessWindow.CustomWindow {
width: minimumWidth
height: minimumHeight
title: qsTr("MQTT Configuration")
extraFlags: Qt.WindowStaysOnTopHint
x: (Screen.desktopAvailableWidth - width) / 2
y: (Screen.desktopAvailableHeight - height) / 2
minimumWidth: column.implicitWidth + 4 * app.spacing + 2 * root.shadowMargin
maximumWidth: column.implicitWidth + 4 * app.spacing + 2 * root.shadowMargin
extraFlags: Qt.WindowStaysOnTopHint | Qt.Dialog | Qt.WindowCloseButtonHint | Qt.WindowTitleHint
minimumHeight: column.implicitHeight + 4 * app.spacing + titlebar.height + 2 * root.shadowMargin
maximumHeight: column.implicitHeight + 4 * app.spacing + titlebar.height + 2 * root.shadowMargin

View File

@ -1,5 +1,5 @@
{
"name":"Mainframe",
"name":"Midnight",
"author":"Alex Spataru",
"titlebarSeparator":false,
"colors":{
@ -41,26 +41,24 @@
"connectButtonChecked":"#fc5142",
"connectButtonUnchecked":"#2eed5c",
"mqttButton":"#eda870",
"widgetTextPrimary":"#24476a",
"widgetTextSecondary":"#666666",
"widgetTextPrimary":"#f1bd92",
"widgetTextSecondary":"#517497",
"widgetWindowBackground":"#484f62",
"widgetWindowBorder":"#b7878d",
"widgetForegroundPrimary":"#f94144",
"widgetForegroundSecondary":"#666666",
"widgetIndicator":"#444444",
"widgetControlBackground":"#666666",
"widgetForegroundPrimary":"#f1bd92",
"widgetForegroundSecondary":"#517497",
"widgetIndicator":"#ffffff",
"widgetColors":[
"#1f76b4",
"#ff7f0f",
"#2aa02b",
"#d62628",
"#9467bd",
"#8c564c",
"#e377c1",
"#7f7f7f",
"#bcbd21",
"#19bdcf",
"#1955fe"
"#fa8174",
"#bfbbd9",
"#80b1d2",
"#fdffb4",
"#fdb462",
"#8dd3c7",
"#b3dd69",
"#feed6f",
"#bc81bc",
"#cceac4"
]
}
}