-
Notifications
You must be signed in to change notification settings - Fork 80
Remove Qt5Compat effects #4382
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
base: master
Are you sure you want to change the base?
Remove Qt5Compat effects #4382
Changes from all commits
8b8c4d3
e4b313b
f239ba6
a4d5313
fff3cde
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,7 +8,7 @@ | |
| ***************************************************************************/ | ||
|
|
||
| import QtQuick | ||
| import Qt5Compat.GraphicalEffects | ||
| import QtQuick.Controls.impl | ||
|
|
||
| /** | ||
| Use the size property instead of width and height | ||
|
|
@@ -19,27 +19,25 @@ Item { | |
| required property url source | ||
| property real size: __style.icon24 | ||
| property color color: __style.forestColor | ||
| readonly property bool colorable: source.toString().endsWith("-coloroverlay.svg") | ||
|
|
||
| width: size | ||
| height: size | ||
|
|
||
| Image { | ||
| id: icon | ||
|
|
||
| // IconImage is not part of QML's public API, so this can break on Qt version change. | ||
| // However, if we don't want to use shaders, this is the most straightforward way. | ||
| IconImage { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a way to implement this so that it would work with a Qt version change?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well we can always use shaders to do that, but this might break. It doesn't mean it will break every Qt release. |
||
| visible: !root.source.toString().endsWith("-nocoloroverlay.svg") | ||
| source: root.source | ||
| sourceSize.width: root.width | ||
| sourceSize.height: root.height | ||
| color: root.color | ||
| } | ||
|
|
||
| // TODO: if all icons are white, we do not need Qt5Compat.GraphicalEffects | ||
| ColorOverlay { | ||
| id: overlay | ||
|
|
||
| // Use original colors for some icons, e.g. QGIS layer icons | ||
| visible: !root.source.toString().endsWith("-nocoloroverlay.svg") | ||
|
|
||
| color: root.color | ||
| anchors.fill: icon | ||
| source: icon | ||
| Image { | ||
| visible: root.source.toString().endsWith("-nocoloroverlay.svg") | ||
| source: root.source | ||
| sourceSize.width: root.width | ||
| sourceSize.height: root.height | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,7 +22,7 @@ Popup { | |
|
|
||
| layer.enabled: true | ||
| layer.effect: MMShadow { | ||
| radius: __style.radius20 | ||
| blurMax: 64 | ||
| } | ||
| } | ||
| } | ||
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.
Why did you change the shadow color?
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.
Because the old one didn't produce shadow at all with the new approach. For the new approach only alpha channel is important and this color looked the most similar to the old one.