Add a mode where all the bottom part can be hidden
ClosedPublic

Authored by ognarb on Aug 10 2018, 6:06 PM.

Details

Summary

Referencing https://phabricator.kde.org/T7676

In HeaderBar, if playerControl.maximized == true, then we are in 'party
mode' otherwise we are in normal mode.

Diff Detail

Repository
R255 Elisa
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 1903
Build 1921: arc lint + arc unit
ognarb requested review of this revision.Aug 10 2018, 6:06 PM
ognarb created this revision.
januz requested changes to this revision.Aug 10 2018, 10:37 PM
januz added a reviewer: januz.
januz added subscribers: astippich, mgallien, januz.

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

ognarb added a comment.EditedAug 11 2018, 3:13 PM

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?

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

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

@ognarb thanks for your work. I will lack enough time this week end to do a proper review. I have just a small inline comment.

@januz thanks, it is in fact important to persist this. The easiest way is probably to do it like the window size.

src/qml/MediaPlayerControl.qml
38

please use isMaximized, it should be easier to understand its purpose

januz added a comment.Aug 11 2018, 9:51 PM

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?

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.

ognarb updated this revision to Diff 39542.Aug 12 2018, 7:20 PM
  • Resize the windows size, when hiding the botton

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.

januz added a comment.Aug 13 2018, 9:52 PM

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)

ognarb updated this revision to Diff 39727.EditedAug 14 2018, 3:41 PM

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.

mgallien requested changes to this revision.Aug 15 2018, 4:46 PM
This revision now requires changes to proceed.Aug 15 2018, 4:46 PM
ognarb updated this revision to Diff 39840.Aug 16 2018, 9:00 AM
  • add icon path to src/windows/WindowsTheme.qml
ognarb updated this revision to Diff 39843.EditedAug 16 2018, 9:28 AM
ognarb marked an inline comment as done.

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.

ognarb updated this revision to Diff 39854.EditedAug 16 2018, 12:34 PM

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.

ognarb updated this revision to Diff 39856.Aug 16 2018, 1:15 PM

Resizing work in Fullscreen and windowed mode but not in i3 tilled mode

ognarb updated this revision to Diff 39859.Aug 16 2018, 2:09 PM
ognarb marked an inline comment as done.
  • remove now useless property

[...]

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.

ognarb updated this revision to Diff 39920.EditedAug 17 2018, 1:02 PM

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.

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.

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.

303

For this to work, the previous state has to be "headerBarNotMaximized". In the other case, this is not working properly.

304

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.

ognarb updated this revision to Diff 40194.Aug 22 2018, 8:37 AM
ognarb marked 4 inline comments as done.
  • fix the bugs mentioned in the comments inline

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. :)

mgallien accepted this revision.Aug 22 2018, 7:19 PM

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 ?

This revision is now accepted and ready to land.Aug 22 2018, 7:19 PM
ognarb added a comment.EditedAug 23 2018, 8:46 AM

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).

This revision was automatically updated to reflect the committed changes.