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

Enables style sheets for knob line colors for all knob types #2680

Merged

Conversation

michaelgregorius
Copy link
Contributor

The fix works as follows: until now the method Knob::drawKnob has used
hard coded palette colors to draw the knob lines for the different knob
types. These palette colors are now assigned to the line color property
in Knob::initUi. The method Knob::drawKnob in turn now uses the line
color property for almost all knob types. This means that all knobs
lines will be painted in the same color as before unless that property
is overridden by the stylesheet.

Also removes an unnecessary typedef from QWidget to trackSettingsWidget
in Track.h.

This commit fixes the problem described in HDDigitizerMusic#3.

@tresf
Copy link
Member

tresf commented Mar 15, 2016

FYI, Travis error was a stalled Mac build. Re-started to ensure it passes (which it should). 👍

default:
break;
}

Copy link
Member

Choose a reason for hiding this comment

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

Very interesting.... so lineColor was already part of the API but wasn't used for this particular draw function? Elegant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tresf Yes, the property lineColor was neither used in the style sheet nor in the code.

The fix works as follows: until now the method Knob::drawKnob has used
hard coded palette colors to draw the knob lines for the different knob
types. These palette colors are now assigned to the line color property
in Knob::initUi. The method Knob::drawKnob in turn now uses the line
color property for almost all knob types. This means that all knobs
lines will be painted in the same color as before unless that property
is overridden by the stylesheet.

Also removes an unnecessary typedef from QWidget to trackSettingsWidget
in Track.h.
@michaelgregorius
Copy link
Contributor Author

@tresf I have just rebased against the current master which does not have the enum knobGreen_17 anymore. So the poor build server will have to go through all this again anyway. 😄

@michaelgregorius michaelgregorius merged commit 4e9de49 into LMMS:master Mar 24, 2016
@michaelgregorius michaelgregorius deleted the knob-line-stylesheets branch March 24, 2016 11:00
@IvanMaldonado
Copy link
Contributor

Where in the .css file can I change the color? this didn't fix it for me, the color is still linked by qproperty-windowText.

@michaelgregorius
Copy link
Contributor Author

@IvanMaldonado You should be able to change the line color using the lineColor property. For example if you want to switch the knob line color for the TrackViews you can use the following CSS:

TrackView Knob {
    qproperty-lineColor: rgb(255, 0, 0);
}

@IvanMaldonado
Copy link
Contributor

@michaelgregorius Thank you! I didn't know you had to do that, it works fine for me 👍

Edit: What about the bigger knobs?

captura de pantalla_2016-03-25_10-33-46

@Umcaruje
Copy link
Member

Umcaruje commented Apr 1, 2016

@IvanMaldonado Just put Knob rather than TrackView Knob in the CSS

@IvanMaldonado
Copy link
Contributor

@Umcaruje Thank you 👍

@michaelgregorius
Copy link
Contributor Author

@IvanMaldonado Sorry, I was not messaged with regards to your edit but it looks like your question got answered.

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.

4 participants