Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/mmstyle.h
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ class MMStyle: public QObject
QColor photoSketchingBlueColor() const {return QColor::fromString( "#5E9EE4" );}
QColor photoSketchingPinkColor() const {return QColor::fromString( "#FF8F93" );}

QColor shadowColor() const {return QColor::fromString( "#66777777" );}
QColor shadowColor() const {return QColor::fromString( "#4D000000" );}
Copy link
Contributor

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?

Copy link
Contributor Author

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.


QUrl splitGeometryIcon() const {return QUrl( "qrc:/SplitGeometry.svg" );}
QUrl streamingIcon() const {return QUrl( "qrc:/Streaming.svg" );}
Expand Down
26 changes: 12 additions & 14 deletions app/qml/components/MMIcon.qml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
***************************************************************************/

import QtQuick
import Qt5Compat.GraphicalEffects
import QtQuick.Controls.impl

/**
Use the size property instead of width and height
Expand All @@ -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 {
Copy link
Contributor

Choose a reason for hiding this comment

The 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?

Copy link
Contributor Author

@Withalion Withalion Mar 23, 2026

Choose a reason for hiding this comment

The 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
}
}
2 changes: 1 addition & 1 deletion app/qml/components/MMPopup.qml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Popup {

layer.enabled: true
layer.effect: MMShadow {
radius: __style.radius20
blurMax: 64
}
}
}
14 changes: 6 additions & 8 deletions app/qml/components/MMShadow.qml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@
***************************************************************************/

import QtQuick
import Qt5Compat.GraphicalEffects
import QtQuick.Effects

DropShadow {
id: shadow
horizontalOffset: 2 * __dp
verticalOffset: 3 * __dp
radius: 7 * __dp
color: __style.shadowColor
transparentBorder: true
MultiEffect {
shadowEnabled: true
shadowHorizontalOffset: 2 * __dp
shadowVerticalOffset: 3 * __dp
shadowColor: __style.shadowColor
}
1 change: 0 additions & 1 deletion app/qml/gps/MMMeasureDrawer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import Qt5Compat.GraphicalEffects
import QtQuick.Shapes

import mm 1.0 as MM
Expand Down
1 change: 0 additions & 1 deletion app/qml/gps/MMSelectionDrawer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import Qt5Compat.GraphicalEffects
import QtQuick.Shapes

import mm 1.0 as MM
Expand Down
1 change: 0 additions & 1 deletion app/qml/gps/MMStakeoutDrawer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import Qt5Compat.GraphicalEffects
import QtQuick.Shapes

import mm 1.0 as MM
Expand Down
1 change: 0 additions & 1 deletion app/qml/map/MMMapSketchesDrawer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import Qt5Compat.GraphicalEffects
import QtQuick.Shapes

import mm 1.0 as MM
Expand Down
8 changes: 2 additions & 6 deletions app/qml/map/components/MMCrosshair.qml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
***************************************************************************/

import QtQuick
import Qt5Compat.GraphicalEffects
import QtQuick.Controls.impl

import mm 1.0 as MM

Expand Down Expand Up @@ -72,7 +72,7 @@ Item {
sourceSize.height: height
}

Image {
IconImage {
id: crosshairForeground // green / purple outer circle of the crosshair

x: root.screenPoint.x - width / 2
Expand Down Expand Up @@ -100,11 +100,7 @@ Item {
source: __style.crosshairForegroundImage
sourceSize.width: width
sourceSize.height: height
}

ColorOverlay {
anchors.fill: crosshairForeground
source: crosshairForeground
color: snapUtils.snapped ? __style.snappingColor : __style.forestColor
}

Expand Down
1 change: 0 additions & 1 deletion app/qml/map/components/MMMeasureCrosshair.qml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
***************************************************************************/

import QtQuick
import Qt5Compat.GraphicalEffects

import mm 1.0 as MM
import "../../components"
Expand Down
1 change: 0 additions & 1 deletion app/qml/project/MMProjectController.qml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Qt5Compat.GraphicalEffects
import QtQuick.Dialogs

import mm 1.0 as MM
Expand Down
1 change: 0 additions & 1 deletion app/qml/project/MMProjectIssuesPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Qt5Compat.GraphicalEffects

import "../components" as MMComponents

Expand Down
Loading