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

fix #287528, fix #283258 & fix #289773: panels not dockable after undock & close #5086

Merged
merged 1 commit into from Jun 17, 2019

Conversation

Obliquely
Copy link
Contributor

  1. Adds a function that tests if widget is both not-shown (!isVisible) AND
    in the floating state. If so, it cycles the floating state through off
    and on again to ensure widget is re-dockable. The !isVisible() test
    avoids side effect of dock being resized, e.g. made wider, even when
    the widget won't be landing on it (#289773). Function used to the fix
    issue for:
  • Play Panel
  • Palettes
  • Inspector
  • Selection Filter
  • Piano Keyboard (when dockable, only dockable in footer)
  • Time Line (when dockable, only dockable in footer)
  • Score Comparison Tool
  • Mixer
  1. Addresses some issues with the mixer (#283258) being converted from
    an independent window to a dock widget:
  • add code to ensure the show/hide menu is in sync with the mixer being
    shown
  • removed inappropriate widget configuration on setup

@RobFog
Copy link

RobFog commented Jun 1, 2019

Is this pull request complete and ready for review?

@RobFog
Copy link

RobFog commented Jun 1, 2019

For reference, here are the three issues which are meant to be fixed by this pull request:

@Obliquely
Copy link
Contributor Author

Yes. Complete and ready for review.

Copy link
Contributor

@dmitrio95 dmitrio95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, this solution looks good to me, as far as I understand it shouldn't cause any unwanted side effects as it was the case for #5011. I left some comments pointing to code style issues, but once they are corrected I believe this PR should be good to merge.

mscore/mixer.cpp Outdated
@@ -200,6 +200,10 @@ void Mixer::masterVolumeChanged(double decibels)

void Mixer::on_partOnlyCheckBox_toggled(bool checked)
{

if (!_activeScore) // cope with case of no score being present
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and the following if statements can probably be combined:

if (!_activeScore || !_activeScore->excerpt()
      return;

//---------------------------------------------------------

void MuseScore::reDisplayDockWidget(QDockWidget* widget, bool visible)
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong indentation: we use 6-space indent for these braces (see other functions definitions)

// Ensure the widget is re-dockable if it has been closed and re-opened when un-docked
widget->setFloating(false);
widget->setFloating(true);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong indentation: this brace should be indented one level (6 spaces) more (see the Handbook).

@@ -4424,6 +4439,10 @@ void MuseScore::readSettings()

MuseScore::restoreGeometry(this);

// grab the visible state before the beginGroup
// this awkwardness to ensure state saved before code changes should
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add a brief description of which code changes are mentioned in this comment? It will be possible to find this out via git blame but it will be even better if one could understand this comment without searching through the changes history.

void MuseScore::reDisplayDockWidget(QDockWidget* widget, bool visible)
{
if (widget->isFloating() && !widget->isVisible()) {
// Ensure the widget is re-dockable if it has been closed and re-opened when un-docked
Copy link
Contributor

@dmitrio95 dmitrio95 Jun 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also could you please add a reference to QTBUG-69922 (something short, like see QTBUG-69922, would be enough)? Even though this is a really good workaround it is still a workaround, and it is better not to keep it in the code if that issue gets fixed (and ensure that we keep it while this Qt issue is still present).

@Obliquely
Copy link
Contributor Author

Thanks for review. Requested changes made and pushed.

mscore/mixer.cpp Outdated
//---------------------------------------------------------

void Mixer::hideEvent(QHideEvent* e)
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6 space indent is needed too, I seem to have missed that in my last review.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I missed that too. Fixed and pushed.

@Jojo-Schmitz
Copy link
Contributor

Jojo-Schmitz commented Jun 16, 2019

getting super picky: typo in commit and PR title, "afer" vs "after"
Also in order to auto close issues the commit title needs to be fix #287528, fix #283258 & fix #289773: …

@Obliquely Obliquely changed the title Fixes #287528, #283258 & #289773 Panels not dockable afer undock & close Fixes #287528, #283258 & #289773 Panels not dockable after undock & close Jun 16, 2019
…ock & close

1) Adds a function that tests if widget is both not-shown (!isVisible) AND
in the floating state. If so, it cycles the floating state through off
and on again to ensure widget is re-dockable. This is a workaround for
QT-69922.  The !isVisible() test avoids side effect of dock being resized,
e.g. made wider, even when the widget won't be landing on it (#289773).
Function used to the fix issue for:

- Play Panel
- Palettes
- Inspector
- Selection Filter
- Piano Keyboard (when dockable, only dockable in footer)
- Time Line (when dockable, only dockable in footer)
- Score Comparison Tool
- Mixer

2) Addresses some issues with the mixer (#283258) being converted from
an independent window to a dock widget:

- add code to ensure the show/hide menu is in sync with the mixer being
shown
- removed inappropriate widget configuration on setup
@Obliquely Obliquely changed the title Fixes #287528, #283258 & #289773 Panels not dockable after undock & close fixes #287528, fix #283258 & fix #289773: panels not dockable after undock & close Jun 16, 2019
@Obliquely Obliquely changed the title fixes #287528, fix #283258 & fix #289773: panels not dockable after undock & close fix #287528, fix #283258 & fix #289773: panels not dockable after undock & close Jun 16, 2019
@Obliquely
Copy link
Contributor Author

Thanks. Have fixed typo and changed the fix's to the appropriate format.

@dmitrio95 dmitrio95 merged commit 91ae302 into musescore:master Jun 17, 2019
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.

None yet

4 participants