-
-
Notifications
You must be signed in to change notification settings - Fork 216
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
Add remaining properties needed to unlock beautiful dark theme support to the elevation profile canvas #5260
Conversation
🎉 Ta-daaa, freshly created APKs are available for a7869e6: arm64-android |
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.
clang-tidy made some suggestions
…t to the elevation profile canvas
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.
clang-tidy made some suggestions
@@ -18,7 +18,12 @@ | |||
|
|||
#include "qgsabstractprofilegenerator.h" | |||
#include "qgsabstractprofilesource.h" | |||
#include "qgscolorutils.h" | |||
#include "qgsexpressioncontextutils.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.
warning: included header qgscolorutils.h is not used directly [misc-include-cleaner]
#include "qgsexpressioncontextutils.h" | |
#include "qgsexpressioncontextutils.h" |
void QgsQuickElevationProfileCanvas::setBackgroundColor( const QColor &color ) | ||
{ | ||
if ( mBackgroundColor == color ) | ||
return; |
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.
warning: statement should be inside braces [readability-braces-around-statements]
return; | |
if ( mBackgroundColor == color ) { | |
return; | |
} |
void QgsQuickElevationProfileCanvas::setBorderColor( const QColor &color ) | ||
{ | ||
if ( mBorderColor == color ) | ||
return; |
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.
warning: statement should be inside braces [readability-braces-around-statements]
return; | |
if ( mBorderColor == color ) { | |
return; | |
} |
@@ -775,6 +812,16 @@ | |||
textFormat.setSizeUnit( Qgis::RenderUnit::Points ); | |||
mPlotItem->yAxis().setTextFormat( textFormat ); | |||
|
|||
std::unique_ptr<QgsSimpleLineSymbolLayer> lineSymbolLayer = std::make_unique<QgsSimpleLineSymbolLayer>( mBorderColor, 0.1 ); | |||
lineSymbolLayer->setPenCapStyle( Qt::FlatCap ); |
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.
warning: no header providing "Qt::FlatCap" is directly included [misc-include-cleaner]
lineSymbolLayer->setPenCapStyle( Qt::FlatCap );
^
@@ -775,6 +812,16 @@ | |||
textFormat.setSizeUnit( Qgis::RenderUnit::Points ); | |||
mPlotItem->yAxis().setTextFormat( textFormat ); | |||
|
|||
std::unique_ptr<QgsSimpleLineSymbolLayer> lineSymbolLayer = std::make_unique<QgsSimpleLineSymbolLayer>( mBorderColor, 0.1 ); | |||
lineSymbolLayer->setPenCapStyle( Qt::FlatCap ); | |||
mPlotItem->xAxis().setGridMinorSymbol( new QgsLineSymbol( QgsSymbolLayerList( { lineSymbolLayer->clone() } ) ) ); |
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.
warning: no header providing "QgsSymbolLayerList" is directly included [misc-include-cleaner]
src/core/qgsquick/qgsquickelevationprofilecanvas.cpp:40:
+ #include <qgssymbol.h>
* | ||
* \see setBackgroundColor | ||
*/ | ||
QColor backgroundColor() const; |
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.
warning: no header providing "QColor" is directly included [misc-include-cleaner]
src/core/qgsquick/qgsquickelevationprofilecanvas.h:25:
+ #include <qcolor.h>
@@ -292,6 +328,8 @@ | |||
|
|||
bool mDirty = false; | |||
|
|||
QColor mBackgroundColor = QColor( 255, 255, 255 ); |
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.
warning: 255 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers]
QColor mBackgroundColor = QColor( 255, 255, 255 );
^
@@ -292,6 +328,8 @@ | |||
|
|||
bool mDirty = false; | |||
|
|||
QColor mBackgroundColor = QColor( 255, 255, 255 ); |
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.
warning: 255 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers]
QColor mBackgroundColor = QColor( 255, 255, 255 );
^
@@ -292,6 +328,8 @@ | |||
|
|||
bool mDirty = false; | |||
|
|||
QColor mBackgroundColor = QColor( 255, 255, 255 ); |
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.
warning: 255 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers]
QColor mBackgroundColor = QColor( 255, 255, 255 );
^
Light theme:
![Screenshot from 2024-05-21 16-39-39](https://private-user-images.githubusercontent.com/1728657/332371086-3e5be2ee-6ebc-49ac-b196-a26cd3823d3b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE1OTk0NDksIm5iZiI6MTcyMTU5OTE0OSwicGF0aCI6Ii8xNzI4NjU3LzMzMjM3MTA4Ni0zZTViZTJlZS02ZWJjLTQ5YWMtYjE5Ni1hMjZjZDM4MjNkM2IucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcyMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MjFUMjE1OTA5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NDdlOTFiMDA5M2FkODc4Yjg5ODU2OTkwMzM3NGJlYWMxMTRiZTZjMzE3ZGYyM2I4OWE5YWNmNjEyNTNmN2ZkOSZYLUFtei1TaWduZWRIZWFkZXJzPWh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