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

When a daughter window (e.g. Piano Roll, Pitch-bend window) is maximized, it cannot be normalized #4215

Closed
raindropsfromsky opened this issue Mar 5, 2018 · 17 comments
Assignees
Labels
Milestone

Comments

@raindropsfromsky
Copy link

raindropsfromsky commented Mar 5, 2018

Edited by @tresf, corrected description

MDI Subwindow controls are hard to see when maximized.
image


LMMS provides a Mximize button for all its daughter windows (e.g. Piano Roll, Pitch-bend window) (See screenshot bellow, with red circle.)
image

If this button is pressed, LMMS maximizes that daughter window. Now this daughter window occupies the entire right side of the main window, and cannot be detached from it. The effect is as if LMMS suddenly switches to modeless.

After this, LMMS does not allow us to make this window a floating window, as before.
Its size control (image) simply vanishes.

@raindropsfromsky
Copy link
Author

oops. I didn't notice the pair of buttons image for that purpose.

Please close this issue.

@zonkmachine
Copy link
Member

You can close issues that you've opened yourself.

@tresf
Copy link
Member

tresf commented Mar 5, 2018

This seems to have been introduced with Qt5. I spent a considerable amount of time investigating the restore buttons to no avail: #2611 (comment). Help here is appreciated, but I think it's a base Qt5 bug that occurs when running the non-default themes available.

@tresf
Copy link
Member

tresf commented Mar 8, 2018

I took a second look after reviewing my screenshots from Windows, Mac and Ubuntu and it appears our theme is influencing it. Here's the main property: style.css:

LmmsPalette {
    /** .... **/
    qproperty-button:  #3f4750;

If we change it to: qproperty-button: #FFFFFF;, it looks like this:
image

Reopening and tagging @Umcaruje. We might be able to workaround this bug.

@tresf tresf reopened this Mar 8, 2018
@tresf tresf added gui and removed invalid labels Mar 8, 2018
@tresf tresf added this to the 1.2.0 milestone Mar 8, 2018
@PhysSong
Copy link
Member

PhysSong commented Mar 8, 2018

If we change it to: qproperty-button: #FFFFFF;, it looks like this:

Changing that property also changes other buttons' background color.
I guess the main issue is the background color for QMenuBar(Using LmmsPalette's qproperty-background #262b30) and LmmsPalette's qproperty-background(#3f4750) are hard to distinguish. If changing button's color breaks whole theme, It might be a good chance to change menu bar's background color.

@BaraMGB
Copy link
Contributor

BaraMGB commented Mar 11, 2018

Perhaps, we could draw a button at this place. This would be a little bit "hacky", but we do this all the time in our subwindows.

@Umcaruje
Copy link
Member

Proposed a CSS-only fix in #4242

@Umcaruje
Copy link
Member

Also realised this problem doesn't exist in the classic theme:
image

@Umcaruje Umcaruje self-assigned this Mar 12, 2018
@tresf
Copy link
Member

tresf commented Mar 12, 2018

image

image

🙄

@Umcaruje
Copy link
Member

Haha yeah that's one of the side effects, I'll see to fix those. What's weird is the buttons in the menu are not QPushButtons and I'm not sure what they are exactly, if I find out we could just directly apply CSS to them

@raindropsfromsky
Copy link
Author

raindropsfromsky commented Mar 13, 2018

@Umcaruje did you mean the white headers of the windows? (I had raised another bug that some dialogs in LMMS have white headers: They do not follow the theme.)

Probably that can also be resolved by Qt code?

(Both the screenshots have white headers.)

@musikBear
Copy link

How strange that classic does have that button 😕

@tresf
Copy link
Member

tresf commented Mar 13, 2018

@raindropsfromsky, Please stop talking about "white headers", this is the Windows 10 default theme.

@raindropsfromsky
Copy link
Author

raindropsfromsky commented Mar 13, 2018 via email

@PhysSong
Copy link
Member

@Umcaruje Some more side effects...
filebrowser
sf2dialog

@PhysSong
Copy link
Member

CSS approach seems to bring too many side effects. After some investigation, I found that QProxyStyle::drawComplexControl handles subwindow control drawing and our LmmsStyle reimplements that function.
I guess handling CC_MdiControls in LmmsStyle::drawComplexControl might be an alternative way.

@PhysSong
Copy link
Member

Here's a proof-of-concept codewhich makes subwindow control buttons red.

index b883a2b2f..f48f59eec 100644
--- a/src/gui/LmmsStyle.cpp
+++ b/src/gui/LmmsStyle.cpp
@@ -177,6 +177,14 @@ void LmmsStyle::drawComplexControl( ComplexControl control,
 			return;
 		}
 	}
+	else if (control == CC_MdiControls)
+	{
+		QStyleOptionComplex so(*option);
+		so.palette.setColor(QPalette::Button, QColor(255, 0, 0));
+		QProxyStyle::drawComplexControl(control, &so,
+						painter, widget);
+		return;
+	}
 /*	else if( control == CC_ScrollBar )
 	{
 		painter->fillRect( option->rect, QApplication::palette().color( QPalette::Active,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants