0
votes

Im trying to add a Minimized button in my app.

For now I've some problem just in Mac Os. I tested in Linux and Win and I don't have problem.

Any ideia?

Rectangle {
    property bool containsMouse: titleBar.mouseX >= x + row.x && titleBar.mouseX <= x + row.x + width && titleBar.containsMouse
    anchors.top: parent.top
    anchors.bottom: parent.bottom
    width: height
    color: containsMouse ? "#3665B3" : "#000000"

    Image {
        anchors.centerIn: parent
        source: "../images/minimizeIcon.png"
    }

    MouseArea {
        id: minimizeArea
        anchors.fill: parent
        onClicked: {
            // I can see this in Mac Os but don't work
            console.log("its work")
            appWindow.visibility = Window.Minimized
        }
   }
}

appWindow is my ApplicationWindow {} // has all my content There is the link do see the ApplicationWindow: https://github.com/LetheanMovement/lethean-gui/blob/master/main.qml

I tried to use the same code to FullScreen and works well!

appWindow.visibility = Window.FullScreen

The interesting is: If I'm in a FullScreen mode my Windows.Minimized has the same effect as the Windows.Windowed

Im following this Doc: https://doc.qt.io/qt-5/qml-qtquick-window-window.html

1
it would be great idea if you could show the top Window item in your code too. What is appWindow here? - folibis
@folibis I fixed my question: my appWindows is my ApplicationWindows{}. - Laion Camargo
Ok, but I've told about the code, why don't you show the ApplicationWindows in the code example? - folibis
@folibis I added the link to the git, is to long to add here :D - Laion Camargo

1 Answers

0
votes

Try appWindow.visibility = Window.Windowed before:

    onClicked: {
        // I can see this in Mac Os but don't work
        console.log("its work")
        appWindow.visibility = Window.Windowed
        appWindow.visibility = Window.Minimized
    }

Works on ArchLinux.