-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Hotcue Buttons, Context Menu + Skin Improvements. #2560
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking care of this. Opening the cue menu on right click is a real usability improvement IMHO.
I'm not super sure if it's smart to introduce inconsistencies for the Hotcue COs at this point (for unset hotcues the color CO value is not -1
anymore), when all other COs behave differently.
Also, I think that qss styles allows much greater flexibility for skin deveĺopers than just changing background and text color, so I think we should discuss how we can implementing WHotcueButton while still allowing that.
res/skins/Deere/style.qss
Outdated
#HotcueButton[backgroundIsDark=false][hasBackgroundColor=true] { | ||
color: #1f1e1e; | ||
qproperty-light: #FDFDFD; | ||
qproperty-dark: #1f1e1e; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really inflexible. What if I want to modify the border color or set a button icon or do other stuff in QSS depending on the dark/light property? This isn't possible at the moment, we can only set the text color. Can't we do something like this:
#HotCueButton {
color: #1F1E1E;
}
#HotCueButton[hasDarkColor="true"] {
color: #FDFDFD;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was the original concept.
I found it quite chunky and is suffers bugs that the wrong color was displayed.
We can revert it if it is a real requirement.
src/engine/controls/cuecontrol.cpp
Outdated
@@ -1769,7 +1766,7 @@ HotcueControl::HotcueControl(QString group, int i) | |||
|
|||
// The rgba value of the color assigned to this color. | |||
m_hotcueColor = new ControlObject(keyForControl(i, "color")); | |||
m_hotcueColor->set(kNoColorControlValue); | |||
m_hotcueColor->set(QRgb(ColorPalette::kDefaultCueColor)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I'm still not really sure that this is a good idea. All other COs contain -1
when the hotcue is not set, and since it's possible to modify the CO value via developer mode we need range checks anyway IMHO.
ConfigKey WHotcueButton::createConfigKey(const QString& name) { | ||
ConfigKey key; | ||
key.group = m_group; | ||
// Add one to hotcue so that we don't have a hotcue_0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Add one to hotcue so that we don't have a hotcue_0 | |
// Increment hotcue index by one so that we don't have a hotcue_0 |
: QString()) + | ||
QStringLiteral("; }"); | ||
|
||
if (m_hoverCueColor) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idea: In addition to a boolean dark/light property, you could set these QPalette
colors:
button
highlight
Then we do something like this in QSS:
#HotcueButton {
color: black;
background-color: palette(button);
}
#HotcueButton[hasDarkColor="true"] {
color: white;
}
#HotcueButton:hover {
background-color: palette(highlight);
}
See: https://doc.qt.io/qt-5/stylesheet-reference.html#paletterole
That way we can still be flexible with our qss styles, but also have support for hightlights.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will give it a try.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
palette() is in this case the default QPalette() set by QApplication::setPalette().
We may change it but this restyles the whole Application, so this is no option yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
palette() is in this case the default QPalette() set by QApplication::setPalette().
We may change it but this restyles the whole Application, so this is no option yet.
Ok, that unfortunate. @ronso0 Do you have any ideas how to proceed? Do you think these two properies are sufficient?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I'm not happy with just light and dark. For the 'white border' example below it would be more convenient to have dark, medium & bright so that I could use the white border for dark and medium and only change it to grey if we have a bright hotcue.
Nevertheless, I think this is okay fo now. Also I think brightness() is used elsewhere in Mixxx, isn't it?
The value color is irrelevant if enabled is 0. |
Yes, but all other COs do that, too. If we change that behaviour, we should do it for all these COs, not just color. |
what are "All" other COs? Only the position CO is set to -1 because it represents the invalid value, which has a programmatic use case. |
Done. Now you can
or/and
to style the colored state |
You're right. I was under the impression that more CO's were using
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Deere for example most buttons have a hover effect and for hotcue buttons this is 'stuck' as soon as the cue popup is opened.
what about emulating a leaveEvent to force [hover="false"] & repaint when the popup is opened?
…oids some unnecessary code cycles.
Ups, Hopefully Latenight Looks good again. |
It we agree to the qss and xml fromat, I will
I cannot confirm this with Ubuntu Xenial. On which OS did you experience this. |
Is it a temporary issue? Can we live with it for now? It is hard to fix this remote, I had a brief look without a Idea. I can remember that we had a similar problem with the microphone pop up and the pressed state. |
res/skins/Tango/style.qss
Outdated
#HotcueButton[backgroundIsDark=false][hasBackgroundColor=true] { | ||
color: #0f0f0f; | ||
#HotcueButton[light="true"]:hover { | ||
border: 1px solid #0f0f0f; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this blends with the bg and makes the button shrink.
also, the distinction between light & dark should be shifted: dark is applied to default orange already.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually I think we could stick to the white border for all colors, except for white ;) where I'd use 50% grey for example
Ubuntu Studio 18.04, Qt 5.9 |
Just notice, the pause button is also orange with a black sign. So I think we should not make orange dark. |
This could be a related bug: |
When I worked on the Mixxx menu styles someone posted a link to this very useful tool I'm not really happy with light/dark distinction for hover borders in Tango. I'd rather switch to changing the background color on hover the way this happens in Deere. Though that effect is not from our qss, it's probably the default QPushbutton behaviour: (gif is entirely without Deere/style.qss) I hope I can work out how to get this into Tango, will do so in separate PR |
Done |
I am highly doubtful we should this. If we do, we lock ourselves out of using right click as an alternate action for loop cues (#2194). |
I'm not saying we definitely shouldn't do this. But let's not rush it before we have decided on all the UX details for #2194. I don't want to get into that discussion now; let's keep focusing on 2.3. Maybe if we figure out the design for #2194 before the final 2.3 release we can merge this PR during the 2.3 beta period. |
Right click is the standard way to open context menus. I accidently deleted cues due to this when I started to use mixxx and was looking for a way to set cue labels. Secondary action could be triggered with middle click. Just sayin'. The current master branch has issues with this, e.g. it's not possible to edit cues that are too close next to each other. Additionally, cues at position 0 also aren't editable by right click for some reason. So we need some kind of fix for 2.3 anyway. We could move the right click menu change to another PR that can be merged separately. |
Yup. At first I was skeptical about this, too, because I was used to right-click for clearing a hotcue. Re: middle-click |
Since we don't need to map right click on controllers if that just opens the cue menu (which is not usable on controllers anyway), we can just map it like this:
No idea how to map secondary action touch screens, but if you use limited hardware you get limited functionality I guess. Mapping the secondary action to long press makes no sense because your timing would be way off. I think the cue menu is more useful for touch screens. That way you can take your tablet, get on a train and start preparing your set, color and label cues, etc. while traveling. |
Have we considered setting loop cues similar to how its done in rekordbox / CDJs? You can set loop cues by creating a cue inside a loop (the loop cue then also has the length of that loop) and regular cues are set outside of a loop. |
Yes, that's what we do as well. This about secondary actions, e.g. when you have a loop cue, then primary would activate the loop and secondary would activate and jump to it fo example. |
This PR is mendarory for 2.3, be because it fixes some bugs and changes the Skin interface. I am open to comment out the context menu. This is only a single line of code. However I am confident that this is correct to continue with the context menu. The loop cue controls can also be placed in the context menu as a workaround. IMHO this is mature and can be merged now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code and manual test LGTM, thank you!
In general I agree with @ronso0 that we should be reluctant to use middle click. But I tested this and I can't help but agree that it's just so intuitive to show the menu on right click. I think it's acceptable to use middle click as the alternate action for loop cues. It breaks our usual design pattern of right click on buttons matches shift + button press on controllers, but that's not a strict rule anyway.
Middle click is three finger click with touchpads. Mice that don't have a scroll wheel or third button can emulate middle click by simultaneously pressing both buttons. Right click doesn't exist either on touchscreens, so I don't think that should block anything here. |
One small detail I'd like to see addressed before this is merged: clicking on the hotcue button while the right click menu is open does nothing. I expect it to close the menu. |
@Be-ing: Here the menu closes if you click outside the menu. It does not matter if there is a hotcue button or anything else. When does it close in your setup? |
The menu closes if I click another widget. But if I click the hotcue button it doesn't close. |
Does it also not close if you click another hotcue button? Can you confirm the sticky hoover state? |
Sorry, I was confused. There isn't actually a bug. I right clicked then got confused when left clicking immediately didn't close the menu, but my cursor was slightly inside the menu area. So, looks good to me. 👍 @ronso0 do you think this is ready to merge? If you want changes to the hover behavior, I suggest we merge this now and you can work on that in a new PR. |
Exactly. LGTM |
I get a skin error with LateNight now: https://github.com/mixxxdj/mixxx/projects/2#card-35230536 |
can't reproduce with master. |
Strange, now I cannot reproduce it anymore. |
Re: documentation |
Instead of clear, the Hotcue menu is displayed on right click.
This also simplifies styling and skin.