Skip to content

Conversation

@helywin
Copy link

@helywin helywin commented Sep 12, 2019

Add maximize button and mouseDoubleClickEvent function to implement maximize as in Windows

@githubuser0xFFFF
Copy link
Owner

Thank you for you pull request. I will review it within the next days.

@githubuser0xFFFF
Copy link
Owner

githubuser0xFFFF commented Sep 12, 2019

I tested the pull request on Kubuntu 18.04 and it does not work properly. Maximizing a dock widget works but resetting the previous geometry from maximized state does not work. The value currentScreen is always nullptr if the window is in maximized state. The following code works better.

QRect widgetRect = this->geometry();
    widgetRect.adjust(1,1,-1, -1);
    QScreen* currentScreen = nullptr;
    for (auto screen : QGuiApplication::screens())
    {
        auto screenRect = screen->geometry();
        if (screenRect.contains(widgetRect, true))
        {
            currentScreen = screen;
        }
    }

Another problem is, that on windows as soon as the maximized window is dragged via titlebar, the maximize button immediatelly changes its state to maximize functionality. This does not happen with your implementation.

Therefore I cannot accept the pull request as is.

@helywin
Copy link
Author

helywin commented Sep 13, 2019

Thanks for your advice, I'll fix it

@helywin helywin closed this Sep 21, 2019
@SleepProgger
Copy link

SleepProgger commented Jul 15, 2020

So, did this PR die ?
It's a feature i, and probably a lot of other people, would love to have.

I would be happy to test and poke the code a bit if required.

@githubuser0xFFFF
Copy link
Owner

You can checkout the code of the pull request and play around with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants