Referencing https://phabricator.kde.org/T7676
In HeaderBar, if playerControl.maximized == true, then we are in 'party
mode' otherwise we are in normal mode.
januz | |
mgallien |
Elisa |
Referencing https://phabricator.kde.org/T7676
In HeaderBar, if playerControl.maximized == true, then we are in 'party
mode' otherwise we are in normal mode.
No Linters Available |
No Unit Test Coverage |
Buildable 1913 | |
Build 1931: arc lint + arc unit |
Hi @ognarb, great work! There's one change I think would make this better. Let the window become smaller when this setting is enabled so it can be the same height as the headerbar in the normal window state. When party mode is disabled though, the window should have the same minimum height as it does now. You can find the properties to do that in ElisaMainWindow.qml
Also, it might be nice to persist this setting. What do you guys think? @mgallien @astippich
For the moment, I've only implemented the button for hiding the bottom part. How can I detect if I'm in the party mode or in the minimal mode?
src/qml/MediaPlayerControl.qml | ||
---|---|---|
38 | please use isMaximized, it should be easier to understand its purpose |
I don't think party mode is implemented yet? To detect if you are in minimal you could use the isMaximized property you added to MediaPlayerControl, the same way you've used it in line 256 of ElisaMainWindow.
WIP
Just updating my progess. Now hidding the bottom part, resize the windows size. There is still a bug, which only appears once in a while and that I need to fix. I also changed maximized to isMaximized and persisted the isMaximized.
Looking good. I noticed the bug seems to show up consistently when the window is maximized (I think that's the one you're talking about)
If found and fixed the bug 😄.
Here was the bug:
if (musicWidget.isMaximized) { musicWidget.maximize() } else { musicWidget.maximize() }
I probably need to work now in resizing the width too.
Hey, great! I can't see the bug anymore. The only thing that's missing now is toggling when the window is maximized, right now the button switches but there's no change in the UI.
BTW, maximizing the UI + window looks awesome. Specially with high-res covers.
This is a great contribution. Thank you.
I have one inline comment related to the code.
I also have a problem when trying to minimize when the window is fullscreen. It seems not to work for me. I can investigate if you need more info from me.
src/qml/Theme.qml | ||
---|---|---|
54–55 | This needs to also be added in src/windows/WindowsTheme.qml . This is because some parts are specific to the Windows platform. |
I'm adding some animation and making it work in fulscreen mode and i3 tilling mode. I have some weird artifact, that I need to fix.
I refactored some of the code (add state)
I tried to add transmision, but it didn't work, because of performance reason, the animation was not smooth.
[...]
BTW, maximizing the UI + window looks awesome. Specially with high-res covers.
I totally agree. I did not really expected this result. I will be happy to have this new feature in the next release.
I still have problems with the feature when maximized. The top part does not get resized when hiding the bottom part. This works perfectly when not maximized.
I still have problems with the feature when maximized. The top part does not get resized when hiding the bottom part. This works perfectly when not maximized.
Ok, I will work on it tomorrow :)
I'm trying to debug the issues in maximizing mode, and it's the same problem, as in tilling mode in i3, I think when qml try to change the windows size and the x windows manager don't allow it (maximized mode in kwin, tilled mode in i3), qml consider the windows smaller and draw the elements according to the theoretical size despite the fact that the windows wasn't resized. I'm trying to search for an answer on google, but if someone know own to fixes this issues, help is welcome.
I'm found a fix, elisa just don't try to resize the windows when hiding the bottom part and elisa know that it can't resize the windows (fullscreen and maximized mode). Using https://doc.qt.io/qt-5/qwindow.html#Visibility-enum. Work for kwin at least.
Sorry for the delay on my side.
I have a few comments inline.
I also have a more general answer to your question. I am not convinced we should really change the size of the window depending on it state. I fear we will always have some corner case where it will not work. Could we instead just modify the minimum size and let the user do whatever he wants ?
src/qml/ElisaMainWindow.qml | ||
---|---|---|
35 | Why did you added that ? It seems like it should not be needed. | |
287 | For this to work, the previous state has to be "headerBarNotMaximized". In the other case, this is not working properly. | |
288 | You could even use 120 instead of 600 * 0.2 . | |
src/qml/HeaderBar.qml | ||
62–63 | What is the rationale for this change ? It looks unrelated to the purpose of this diff. |
Sorry for the delay on my side.
No problems
I also have a more general answer to your question. I am not convinced we should really change the size of the window depending on it state. I fear we will always have some corner case where it will not work. Could we instead just modify the minimum size and let the user do whatever he wants ?
I agree, resizing windows in qml is a horror with a lot of corner case. And it was trivial to implements. :)
Thanks for your work. It is a nice contribution.
Do you have a KDE contributor account or do you need me to land your patch ?
What do you plan to do next ?
Do you have a KDE contributor account or do you need me to land your patch ?
It's my first time contributing to a kde project, so I probably don't have a KDE contributor account. So you can land the patch.
What do you plan to do next ?
I interested in doing some more work in elisa (probably the front end part).