-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Refactor the drawing of TCO's; Get rid of hardcoded colors in TCOs; Even out the color scheme #2574
Conversation
4788c49
to
7d874fc
Compare
@Umcaruje I don't have words to express my gratitude on the work you have done so far. |
@zonkmachine @tresf @michaelgregorius can I get some testing/review on this one? |
qproperty-fgColor: rgb( 187, 227, 236 ); | ||
qproperty-fgMutedColor: rgb( 128, 128, 128 ); |
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.
Of no implication to you... I'm not a fan of the fgFoo
tag, personally because normally in css fg
is synonymous with foreground
which is synonymous with color
which is synonymous with textColor
. In this case, it's the gradient/overlay, right? Long term, I think we need to cleanup our naming conventions a bit, but you've at least kept it consistent. 👍
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.
no, this is the color of the drawn notes/automation/waveform when a pattern is muted.
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 was thinking about this. Maybe we can avoid a lot of this by using the background-color
property in CSS. So, fgColor
becomes color
and color
becomes background-color
.
Also we could avoid the muted and selected properties by adding custom css pseudo class selectors like
AutomationPatternView:muted
or AutomationPatternView:selected
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.
Is :muted
a valid selector? If so, that may certainly help. I'm glad you're thinking about it thought because we do need to cleanup and standardize the style.css
eventually, and you've quickly become the most active dev looking at that file. 👍
Although you didn't write it, this draw code is bloated in my opinion. Although not fair to pick on you about it, this may be our best chance to clean it up and make it consistent. I left an example of what I mean here: #2574 (comment) but just about every draw function could benefit from some cleanup. |
|
||
p.fillRect( QRectF( x1, 0.0f, x2-x1, it.value() ), | ||
lin2grad ); | ||
if ( gradient() ) { |
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.
Although I quite prefer if () {
to if () <newline> {
, we should try to be consistent with the styling of the current file.
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.
Ah, ok, will fix.
0fe2e8f
to
d226c71
Compare
@tresf I simplified the code, and also refactored it, so now all patterns draw in the same way/order. I also fixed the problem where the text was getting drawn over the pattern borders. I also commented the code in some places. Inspired by #2579, I will implement static text drawing on the patterns, since their text doesn't change so often, which should speed up the gui. |
@@ -21,12 +21,12 @@ | |||
* Boston, MA 02110-1301 USA. | |||
* | |||
*/ | |||
#include "AutomationPatternView.h" |
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.
@Umcaruje moving this up like this... is this just a "THIS IS MY HEADER!!" convention? This is new to me.
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.
Its in https://github.com/LMMS/lmms/wiki/Coding-conventions
The exception is that in a source file, the first included file should always be its header.
I think this is in a very good state now. Since we use similar methods to draw it simplifies the code as well as the maintenance of it.
Good catch. Have we put any thought into consolidation? If we can consolidate the paint-event code, we may be able to make subclass-specific paint functions that pertain exactly to that particular class and handle everything else in the inherited class. Likely not worth it this time around, but I wanted to mention it.... if we can draw all |
The thing is, in |
👍 |
{ | ||
p.setFont( pointSize<7>( p.font() ) ); | ||
|
||
p.setPen( QColor( 0, 0, 0 ) ); | ||
p.setPen( textShadowColor() ); |
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.
👍 for fixing future code too.
Update: Comparison between old and new text: What's left to do: refactor the bar-line drawing code and also make sample tracks render to a pixmap. |
6d7eb28
to
d22cc82
Compare
Is there a chance your new code checks |
aa73d52
to
db46bed
Compare
@Umcaruje To fix #2148, try adding this to the constructor of
Signals/slots after all, but not between Pattern and BBTCOView. Turns out Pattern's |
@Fastigium it works! Thanks a lot. |
e545bfb
to
f96a4ea
Compare
The diffs are outdated, so I'll reply in the PR comments directly...
Sorry, my own misunderstanding of it. This article explains it: http://www.qtcentre.org/threads/864-diffrence-between-void-and-virtual-void, but it's fine as-is.
Yes, exactly. But, from a design perspective this would also assume you have a use for it inside TCOV by consolidating your common |
Well, I implemented it so that This is pretty much where I draw the line. I'd want to work on some new issues now and this code is in a much better state than before. As I said previously, complete consolidation of the code is currently out of the scope of this PR :) |
@Umcaruje well I don't think it harms to have an external API to force the redraw and agreed, out of scope. I don't have a chance to compile and test this for a few days, so if someone else can give it the OK, that would be great. |
…ake TCO gradient configurable; Even out the color scheme Thanks to @Fastigium for helping with the BB Pattern redraw problem
👍 |
Refactor the drawing of TCO's; Get rid of hardcoded colors in TCOs; Even out the color scheme
Why? |
Then the comment should be moved, and not the property. Cuz, you see, we are overriding the colors on hover and also the border and other stuff. If that property was moved where you suggest, the look of the buttons wouldn't change. |
No it shouldn't look like that, you just made the play and stop buttons square again... |
Anyways, this conversation is entirely pointless on this PR and has 0 relevance to it. Issue a Pull Request or open an issue about this if you want, I'm locking this. |
Per HDDigitizerMusic#8
Fixes #2148
This PR does several things:
Before & after
qproperty-gradient
that allows themers to get rid of the hardcoded gradients on TCO's.Comparison:
Old

New

New with gradients off
