mirror of
https://github.com/monero-project/monero-gui.git
synced 2025-01-11 13:24:33 +00:00
Settings hide/show window after changing decorations type
This commit is contained in:
parent
456bf04db6
commit
2a7f160534
2 changed files with 18 additions and 1 deletions
17
main.qml
17
main.qml
|
@ -628,6 +628,23 @@ ApplicationWindow {
|
||||||
flags: persistentSettings.customDecorations ? (Qt.FramelessWindowHint | Qt.WindowSystemMenuHint | Qt.Window | Qt.WindowMinimizeButtonHint) : (Qt.WindowSystemMenuHint | Qt.Window | Qt.WindowMinimizeButtonHint | Qt.WindowCloseButtonHint | Qt.WindowTitleHint | Qt.WindowMaximizeButtonHint)
|
flags: persistentSettings.customDecorations ? (Qt.FramelessWindowHint | Qt.WindowSystemMenuHint | Qt.Window | Qt.WindowMinimizeButtonHint) : (Qt.WindowSystemMenuHint | Qt.Window | Qt.WindowMinimizeButtonHint | Qt.WindowCloseButtonHint | Qt.WindowTitleHint | Qt.WindowMaximizeButtonHint)
|
||||||
onWidthChanged: x -= 0
|
onWidthChanged: x -= 0
|
||||||
|
|
||||||
|
function setCustomWindowDecorations(custom) {
|
||||||
|
var x = appWindow.x
|
||||||
|
var y = appWindow.y
|
||||||
|
if (x < 0)
|
||||||
|
x = 0
|
||||||
|
if (y < 0)
|
||||||
|
y = 0
|
||||||
|
persistentSettings.customDecorations = custom
|
||||||
|
if (custom)
|
||||||
|
appWindow.flags = Qt.FramelessWindowHint | Qt.WindowSystemMenuHint | Qt.Window | Qt.WindowMinimizeButtonHint
|
||||||
|
else
|
||||||
|
appWindow.flags = Qt.WindowSystemMenuHint | Qt.Window | Qt.WindowMinimizeButtonHint | Qt.WindowCloseButtonHint | Qt.WindowTitleHint | Qt.WindowMaximizeButtonHint
|
||||||
|
appWindow.hide()
|
||||||
|
appWindow.x = x
|
||||||
|
appWindow.y = y
|
||||||
|
appWindow.show()
|
||||||
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
x = (Screen.width - width) / 2
|
x = (Screen.width - width) / 2
|
||||||
|
|
|
@ -338,7 +338,7 @@ Rectangle {
|
||||||
CheckBox {
|
CheckBox {
|
||||||
id: customDecorationsCheckBox
|
id: customDecorationsCheckBox
|
||||||
checked: persistentSettings.customDecorations
|
checked: persistentSettings.customDecorations
|
||||||
onClicked: persistentSettings.customDecorations = checked
|
onClicked: appWindow.setCustomWindowDecorations(checked)
|
||||||
text: qsTr("Custom decorations") + translationManager.emptyString
|
text: qsTr("Custom decorations") + translationManager.emptyString
|
||||||
checkedIcon: "../images/checkedVioletIcon.png"
|
checkedIcon: "../images/checkedVioletIcon.png"
|
||||||
uncheckedIcon: "../images/uncheckedIcon.png"
|
uncheckedIcon: "../images/uncheckedIcon.png"
|
||||||
|
|
Loading…
Reference in a new issue