-
-
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
Refactored PR: Theming of disabled knobs #5549
Refactored PR: Theming of disabled knobs #5549
Conversation
🤖 Hey, I'm @LmmsBot from github.com/lmms/bot and I made downloads for this pull request, click me to make them magically appear! 🎩
Linux
Windows
macOS
🤖{"platform_name_to_artifacts": {"Linux": [{"artifact": {"title": {"title": "(AppImage)", "platform_name": "Linux"}, "link": {"link": "https://8470-15778896-gh.circle-artifacts.com/0/lmms-1.2.2.698-linux-x86_64.AppImage"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/8470?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}], "Windows": [{"artifact": {"title": {"title": "32-bit", "platform_name": "Windows"}, "link": {"link": "https://8469-15778896-gh.circle-artifacts.com/0/lmms-1.2.2.698-mingw-win32.exe"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/8469?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}, {"artifact": {"title": {"title": "64-bit", "platform_name": "Windows"}, "link": {"link": "https://8468-15778896-gh.circle-artifacts.com/0/lmms-1.2.2.698-mingw-win64.exe"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/8468?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}, {"artifact": {"title": {"title": "32-bit", "platform_name": "Windows"}, "link": {"link": "https://ci.appveyor.com/api/buildjobs/jo82pryiq89cwpw7/artifacts/build/lmms-1.2.2-msvc2017-win32.exe"}}, "build_link": "https://ci.appveyor.com/project/Lukas-W/lmms/builds/34847156"}, {"artifact": {"title": {"title": "64-bit", "platform_name": "Windows"}, "link": {"link": "https://ci.appveyor.com/api/buildjobs/8o7tnmjpx2yaii69/artifacts/build/lmms-1.2.2-msvc2017-win64.exe"}}, "build_link": "https://ci.appveyor.com/project/Lukas-W/lmms/builds/34847156"}], "macOS": [{"artifact": {"title": {"title": "", "platform_name": "macOS"}, "link": {"link": "https://8466-15778896-gh.circle-artifacts.com/0/lmms-1.2.2.698-mac10.13.dmg"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/8466?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}]}, "commit_sha": "ba39988d3a7d424fb414c3dd4d672f4444a786dc"} |
Q_PROPERTY(QColor lineActiveColor MEMBER m_lineActiveColor) | ||
Q_PROPERTY(QColor lineInactiveColor MEMBER m_lineInactiveColor) | ||
Q_PROPERTY(QColor arcActiveColor MEMBER m_arcActiveColor) | ||
Q_PROPERTY(QColor arcInactiveColor MEMBER m_arcInactiveColor) |
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.
One thing that might be cool to do and allow even cooler themes is to allow gradients instead of single colors. Changing these to QBrush
would allow you to define gradients or colors.
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 @Veratil for the suggestion. I replaced QColor by QBrush, below is an example. You get the idea from the picture, but a QLinearGradient
does not result in the intended behavior here, see e.g. the red color at low volumes (I think this is due to the gradient being applied independent of the length of the active line). Furthermore, you can observe that m_lineColor
is used both for the "middle line" and the active part of the "arc line".
Maybe we could address this feature separately?
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.
You wouldn't use a linear gradient in that instance, you'd use a conical gradient in the CSS. Example from Qt documentation:
/* conical gradient from white to green */
QTextEdit {
background: qconicalgradient(cx:0.5, cy:0.5, angle:30,
stop:0 white, stop:1 #00FF00)
}
At the same time though, if you wanted single color you can define the brush to be the normal rgba(...)
.
Can we merge this once the open discussions are resolved? |
Co-authored-by: Hyunjin Song <tteu.ingog@gmail.com>
I think this works really well now. |
@thmueller64 Does this need an update the classic theme as well? Other than my suggestion for using QBrush instead of QColor, LGTM. 👍 |
I updated the classic theme. Thanks again for the suggestion. I've looked into the conical gradient, but didn't find a straightforward way to replace QColor this way. For example, the middle line is drawn in the same color as the active part of the arc, so I would possibly have to introduce a separate color for it. I suggest to address this in another PR. |
@@ -169,7 +178,7 @@ private slots: | |||
|
|||
QString m_label; | |||
|
|||
QPixmap * m_knobPixmap; | |||
std::unique_ptr<QPixmap> m_knobPixmap; |
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.
It might be a good idea to explicitly #include <QPixmap>
- it's currently available via <QWidget>
, but if this is changed to use a forward declaration, the unique_ptr
here will fail to compile since QPixmap
's destructor won't be declared.
Co-authored-by: Dominic Clark <mrdomclark@gmail.com>
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.
LGTM
@thmueller64 Looks good! Ready to merge? |
Co-authored-by: Hyunjin Song <tteu.ingog@gmail.com> Co-authored-by: Dominic Clark <mrdomclark@gmail.com>
Co-authored-by: Hyunjin Song <tteu.ingog@gmail.com> Co-authored-by: Dominic Clark <mrdomclark@gmail.com>
This PR partly addresses #4749 and introduces the possibility to theme disabled knobs. I refactored my old draft PR #5481, based on suggestions by @Veratil, using a similar approach as #5253.