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

Remove Track Fade #8

Closed
RebeccaDeField opened this issue Dec 11, 2015 · 17 comments
Closed

Remove Track Fade #8

RebeccaDeField opened this issue Dec 11, 2015 · 17 comments

Comments

@RebeccaDeField
Copy link
Collaborator

When you add colors to tracks in the code, it automatically adds a black fade overlay on the bottom. @HDDigitizerMusic and I would like to remove it, but we do not see where/how.

unnamed2

I've @mentioned the coders that have volunteered to assist with coding for this theme. I know you're all busy, but if you have time, I would really appreciate some assistance on this.

@Umcaruje
@tresf
@diizy
@Sti2nd

@tresf
Copy link

tresf commented Dec 11, 2015

Appears to be hard-coded here: src/gui/AutomationPatternView.cpp#L319:L323.

This could be tackled a similar way as the grid enhancement, by adding custom qproperty tags. Example commit here: LMMS@aaa798c

@zonkmachine
Copy link

@tresf I'm looking into this.

@tresf
Copy link

tresf commented Jan 25, 2016

@zonkmachine 👍

@zonkmachine
Copy link

gradientsdefault gradients
I've found all places where gradients are done and this is what it looks like when I just remove them.

Appears to be hard-coded here: src/gui/AutomationPatternView.cpp#L319:L323

Yes, that's the automation pattern. I've played with different gradients and placement of the center point.
automationtrackgradient
automationtrackgradient2
automationtrackgradient3
automationtrackgradient4
automationtrackgradient5
automationtrackgradient6

Unfortunately the different tracks doesn't use precisely the same method/style, so it's not going to be a totally straight forward mission. Here are the rest:
https:/LMMS/lmms/blob/master/src/gui/AutomationPatternView.cpp#L280:L281
https:/LMMS/lmms/blob/master/src/tracks/BBTrack.cpp#L240:241
https:/LMMS/lmms/blob/master/src/tracks/Pattern.cpp#L988:997
https:/LMMS/lmms/blob/master/src/tracks/SampleTrack.cpp#L371:372
Or somewhere around those places... 😃
One of the things is that we use both darker() and lighter() to set the gradient and for a uniform method we'd probably have to settle for one of them and that would be darker(), since it's the one used the most. Both darker() and lighter() can be used interchangeably but to quote the darker() description "If the factor is less than 100, the return color is lighter, but we recommend using the lighter() function for this purpose". I haven't seen a good description for what precise argument these functions take, and with what result, but 100 means no change and darker(300) will take down the brightness to one third. So it's basically about... dynamics. For darker(), 1 - 99 means brighter and over 100 you tone the brightness down. It's an int so that means 101 - 65536. The reason for not just having one function, gradient(), let it take a float/double and set the middle value to 0.5 as no change, must be overall efficiency of qt. What we lose if we use darker() to set a lighter gradient then is dynamics. A few values to express the tone, but that is fine in this case as we just have a thin strip some 30 pixels wide. We could go for one qproperty-gradient setting and modulate the hardcoded gradients with it but I don't know how useful it would be in the long run.

@tresf
Copy link

tresf commented Jan 25, 2016

@zonkmachine Great findings.

My opinion from a code simplicity and re-usability perspective is that we treat all track gradients the same and adjust the underlying colors to work with it. This may be pragmatic and not practical, but I think it would help us settle on a consistent track style moving forward and also help decisions down the road with the color-assignable tracks.

@zonkmachine
Copy link

treat all track gradients the same and adjust the underlying colors to work with it

I agree. So, a worst case scenario that the gradient part should be able to handle would be from https:/LMMS/lmms/blob/master/src/gui/AutomationPatternView.cpp#L319:L323
We can change lighter(150) for darker(~85) and maybe add a setting for gradientCenter() to end with something like this that could emulate all the former cases and some more:

QLinearGradient lin2grad( 0, min, 0, max );

lin2grad.setColorAt( 1, fgColor().darker( m_gradientTop ) );
lin2grad.setColorAt( gradientCenter(), fgColor() );
lin2grad.setColorAt( 0, fgColor().darker( m_gradientBottom ) );

I've never made a theme so I don't know what an artist, @RebeccaDeField with friends, expects to find. ;-)

@RebeccaDeField
Copy link
Collaborator Author

From a design standpoint, I was planning on something with a similar aesthetic to the picture bellow (the picture is of tracks designed by someone else that I liked), but that would just be for the Modern theme, not necasarily for the default.
fl12full_1

Overall, I agree with @tresf that the most important part of this is that we simplify the code and give people better control over how it looks.

@zonkmachine
Copy link

@RebeccaDeField Su-per-cool...
@Umcaruje Maybe this is an issue for you?

@Umcaruje
Copy link

@Umcaruje Maybe this is an issue for you?

Sure, I didn't tackle the issue because I thought you were working on it. I already had a concept for this in my head, so it shouldn't be too hard.

@zonkmachine
Copy link

👍

@Umcaruje
Copy link

So the way I wanna solve this is to add a boolean qproperty-gradient to the tcoviews. So, if you want your TCO's to have a gradient, you set it to true, and if you want them to have solid colors, you set it to false. Does that sound reasonable? That way we don't really have to tackle the problematic of multiple gradients.

@RebeccaDeField
Copy link
Collaborator Author

@Umcaruje Would it be possible for me to make the tracks slightly transparent with that setup or just flat/solid?

@Umcaruje
Copy link

@RebeccaDeField When I set a transparent color for a TCO, I get a glitched pattern, because there isn't anything drawn under the TCO:
screenshot from 2016-02-15 23 36 50
I don't know if TCO's are QWidgets, but I guess not, since these support transparency.

Anyways, I'll look into that somewhat later, and focus on getting rid of the gradients first.

The transparency issue is a bit out of scope of this issue, so if you could open up an issue on the main tracker about it (since it affects all themes), that would be great.

@RebeccaDeField
Copy link
Collaborator Author

@Umcaruje That makes sense. Thank you for trying for me. In that case, I will just come up with another idea for the look of the tracks based on the capabilities now currently available. I did not have my mind set on anything, so this won't be much of an issue.

@Umcaruje
Copy link

Ok, well anything is possible. I'm done with the gradients, and now am adding custom properties for the color of muted tracks as well as the selected ones. If you need anything else themeable, let me know.

@RebeccaDeField
Copy link
Collaborator Author

@Umcaruje I understand anything is possible, but I don't want to take coders away from important tasks just because the first design idea that came to mind was difficult when I could easily come up with something else. I hope that makes sense.

Thanks, will do :)

@Umcaruje
Copy link

@RebeccaDeField @tresf @zonkmachine PR LMMS#2574 should fix this. Comments and review welcome.

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

No branches or pull requests

4 participants