Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MU4 Issue] Mixer - Auto-resizing issues when docked with tabs #11335

Open
lengthwave opened this issue Apr 25, 2022 · 22 comments · May be fixed by #22050
Open

[MU4 Issue] Mixer - Auto-resizing issues when docked with tabs #11335

lengthwave opened this issue Apr 25, 2022 · 22 comments · May be fixed by #22050
Assignees
Labels
mixer Issues relating to the Mixer needs design Design is needed P2 Priority: Medium UI Visual issues affecting the UI (not notation)

Comments

@lengthwave
Copy link
Contributor

Describe the bug
Mixer window does not automatically resize height properly when tabbed due to other features also docked (ex: timeline)

To Reproduce
Steps to reproduce the behavior:

  1. Open Mixer and dock
  2. Open Timeline and dock
  3. From three dot menu in Mixer tab select "View > Volume"
  4. From three dot menu in Mixer tab desect select "View > Volume"
  5. See error in window height auto-resize

Expected behavior
Mixer window should automatically resize when tabbed in the same way as when mixer is the only feature docked.

Screenshots
Screen Shot 2022-04-25 at 1 36 57 PM

Platform information
OS: macOS 12.2, Arch.: x86_64
MuseScore version (64-bit): 4.0.0-2214419458
revision: github-musescore-musescore-df96a36

@lengthwave lengthwave changed the title [MU4 Issue] Mixer - Resizing Issues when docked with tabs [MU4 Issue] Mixer - Auto-resizing issues when docked with tabs Apr 25, 2022
@lengthwave
Copy link
Contributor Author

@Tantacrul - FYI

@cbjeukendrup
Copy link
Contributor

I'd like to add that I've seen several reports of people getting really confused by this: they thought they couldn't choose Muse Sounds anymore, but the reason was that they were looking in the FX dropdown instead of in the Sound dropdown, because the Sounds dropdown was completely hidden behind the title bar.

@Tantacrul
Copy link
Contributor

I'm adding this to our design tasks because there are a few fixes that need doing with the bottom docking bar, including fixing this highly annoying issue.

@daijingz
Copy link
Contributor

daijingz commented Mar 15, 2024

@cbjeukendrup I want to do this issue, but I am not sure whether it is too difficult for me.

From this issue, some improvements are placed:

  1. Post all gathered information here. -> When others need to collaborate, it saves extra time.
  2. While detecting no changes, use rebuild and revert to factory settings
  3. After discovering some tricky problems, find helps as soon as possible.

@cbjeukendrup
Copy link
Contributor

@daijingz Feel free to give it a try, but it might be a little bit tricky. I'll give you one hint: start inspecting the code in MixerPanel.qml, and look what happens when the implicitHeight of the panel changes (because that is the trigger to resize the panel). From there, there seems to be a relatively straightforward path to the solution, but it does require some knowledge of the KDDockWidgets library and about how properties of QObjects work, and that's what makes it tricky.

If you really need some more hints at some point, feel free to ask in #development on Discord (that's highly preferred over private messages).

@daijingz
Copy link
Contributor

Before adding columns: (With timeline)
UEME8{3$WEB7ZQ3GSNL9LKM
After adding columns: (Without timeline)
LX_RUS$}A451Y%503O8(TIK

@daijingz
Copy link
Contributor

daijingz commented Mar 16, 2024

@lengthwave @cbjeukendrup I guess your meaning is when both the timeline and mixer are docked, the mixer does not work well in its resizing function. (When only the mixer is docked, this problem does not occur).
I want to see where the code of the mixer and timeline page is defined.
C`AV84CR505}X)FT~I 1VHF
4XE3ZAA 0)}BX KOB4QG

@daijingz
Copy link
Contributor

daijingz commented Mar 16, 2024

I suspect the problem occurs at the restrictions of mixer and timeline heights. When both of them are docked, do we have the requirement of making their height consistent? @lengthwave

@cbjeukendrup
Copy link
Contributor

cbjeukendrup commented Mar 17, 2024

@daijingz onImplicitHeightChanged is indeed the correct starting point. The next logical thing to do is to look what resizeRequested is: it is a signal of MixerPanel. So if it's a signal, then there must be some handler for it somewhere, because otherwise nothing would happen. So you search for onResizeRequested. You should find this in some other file.

But it seems you don't understand yet what's actually the issue here. The issue is that calling resizeRequested does not produce the expected result if there are tabs instead of just a title bar. The height of the panel becomes [the implicitHeight of the MixerPanel], but it should become [the implicitHeight of the MixerPanel] PLUS [the height of the tabs], otherwise the top of the MixerPanel is not visible. See the illustrations below:

Result after resizeRequested with just a title bar (correct) Current result after resizeRequested with tabs (incorrect) Desired result after resizeRequested with tabs
Scherm­afbeelding 2024-03-17 om 17 51 21 Scherm­afbeelding 2024-03-17 om 17 36 05 Scherm­afbeelding 2024-03-17 om 17 46 45

(Click the images to view them larger)

@daijingz
Copy link
Contributor

Okay, so you want to add the height of the title bar with the implicitHeight

@cbjeukendrup
Copy link
Contributor

Yes, but not at the place where resizeRequested is being called. The MixerPanel has namely no way to know the height of the tab bar, nor whether there is currently a tab bar of a title bar.

Your goal is now to figure out where the height of the title bar gets added, and then make sure that the tab bar is handled at that place too. To find the relevant code, you'll have to look which functions are called when resizeRequested is called.

@daijingz
Copy link
Contributor

daijingz commented Mar 17, 2024

N8I31@S_7U8K{CJK39V{()I

@cbjeukendrup
Copy link
Contributor

Yes, that's the onResizeRequested handler. So the next logical thing to do, is to look what this mixerPanel.resize function does / where it is defined.

One tip: this function is defined in C++, so you'll have to do some extra steps to find it.

You don't need to post every intermediate step here, but once you've found the function, feel free to post an update again, including how you found it.

By the way, I really recommend you invest some time in setting up Qt Creator. It really makes life easier, because then you get syntax highlighting, auto-complete, and Ctrl+click for "jump to definition". https://github.com/musescore/MuseScore/wiki/Compile-in-Qt-Creator

@daijingz
Copy link
Contributor

Yes, that's the onResizeRequested handler. So the next logical thing to do, is to look what this mixerPanel.resize function does / where it is defined.

One tip: this function is defined in C++, so you'll have to do some extra steps to find it.

You don't need to post every intermediate step here, but once you've found the function, feel free to post an update again, including how you found it.

By the way, I really recommend you invest some time in setting up Qt Creator. It really makes life easier, because then you get syntax highlighting, auto-complete, and Ctrl+click for "jump to definition". https://github.com/musescore/MuseScore/wiki/Compile-in-Qt-Creator

I am just going to update most information, and you do not need to take care of everything. Don't worry.

@daijingz
Copy link
Contributor

daijingz commented Mar 17, 2024

I think this is the corresponding code:
MBT0NJ8}3 %W1ILOY3S`RWJ
Method: Search ":size(" for definitions, and only look at two parameters' definitions.

Although there are two methods matching these, the second method is less likely:
38{}G99AA_VZA}TD_MCMS

@daijingz
Copy link
Contributor

daijingz commented Mar 17, 2024

To change the height, this is the height update code section:

    const QQuickItem* visualItem = frame->visualItem();
    int extraHeight = visualItem ? visualItem->property("nonContentsHeight").toInt() : 0;
    height += extraHeight;

Because the resizing should have a non-zero value of height, the corresponding branch has to be: property("nonContentsHeight").toInt(). Therefore, we need to know about this.

@cbjeukendrup
Copy link
Contributor

For the record, see my reply on Discord explaining a bit about the property system in Qt (https://doc.qt.io/qt-6/properties.html).

The conclusion was that searching for the property name, i.e. nonContentsHeight will lead you to the place where its value comes from. (Hint: it's in QML.)

@bkunda
Copy link

bkunda commented Mar 18, 2024

@daijingz @cbjeukendrup we've actually updated the design spec for this issue (only last week!), and @jessjwilliamson is going to raise it as a new task fairly shortly. Not sure how that will impact the work that's been happening here in the past few days, but it might be prudent to wait until the new design spec is raised before spending further time on this.

@cbjeukendrup
Copy link
Contributor

I think we can go ahead anyway, since it's trivial enough and if my guess about the new design is anywhere near correct we would benefit from this fix anyway.

@jessjwilliamson
Copy link
Contributor

Task made #22016

@daijingz
Copy link
Contributor

daijingz commented Mar 26, 2024

@cbjeukendrup @jessjwilliamson @bkunda I am still confused (Please don't leave me behind), about these hesitations, should we continue working on this issue or not?
(Still waiting on the last step)

@cbjeukendrup
Copy link
Contributor

It turns out the issue will already be fixed by #22050, so you can switch to a different task

@cbjeukendrup cbjeukendrup assigned cbjeukendrup and unassigned Eism Mar 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mixer Issues relating to the Mixer needs design Design is needed P2 Priority: Medium UI Visual issues affecting the UI (not notation)
Projects
Status: Already in progress
Development

Successfully merging a pull request may close this issue.

9 participants