Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[FEATURE] New "preset" colors color ramp option
Allows use of a color ramp consisting of a list of selected colors. Currently there's no way in QGIS to classify a renderer using some list of colors you've previously selected. So you can modify the colors manually after classifying, but that's a pain if you're regularly using the same color scheme. Basically, it's like the color brewer color ramp options but allowing users to pick their own preset list of colors to use* (Because Cynthia Brewer isn't the only cartographic color expert!)
- Loading branch information
1 parent
8ac1460
commit ec50cac
Showing
13 changed files
with
793 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/** \ingroup gui | ||
* \class QgsPresetColorRampWidget | ||
* A widget which allows users to modify the properties of a QgsPresetSchemeColorRamp. | ||
* \note added in QGIS 3.0 | ||
*/ | ||
|
||
class QgsPresetColorRampWidget : QgsPanelWidget | ||
{ | ||
%TypeHeaderCode | ||
#include <qgspresetcolorrampdialog.h> | ||
%End | ||
|
||
public: | ||
|
||
/** Constructor for QgsPresetColorRampWidget. | ||
* @param ramp initial ramp to show in dialog | ||
* @param parent parent widget | ||
*/ | ||
QgsPresetColorRampWidget( const QgsPresetSchemeColorRamp& ramp, QWidget* parent /TransferThis/ = nullptr ); | ||
|
||
~QgsPresetColorRampWidget(); | ||
|
||
/** Returns a color ramp representing the current settings from the dialog. | ||
* @see setRamp() | ||
*/ | ||
QgsPresetSchemeColorRamp ramp() const; | ||
|
||
/** Sets the color ramp to show in the dialog. | ||
* @param ramp color ramp | ||
* @see ramp() | ||
*/ | ||
void setRamp( const QgsPresetSchemeColorRamp& ramp ); | ||
|
||
signals: | ||
|
||
//! Emitted when the dialog settings change | ||
void changed(); | ||
}; | ||
|
||
/** \ingroup gui | ||
* \class QgsPresetColorRampDialog | ||
* A dialog which allows users to modify the properties of a QgsPresetSchemeColorRamp. | ||
* \note added in QGIS 3.0 | ||
*/ | ||
|
||
class QgsPresetColorRampDialog : QDialog | ||
{ | ||
%TypeHeaderCode | ||
#include <qgspresetcolorrampdialog.h> | ||
%End | ||
|
||
public: | ||
|
||
/** Constructor for QgsPresetColorRampDialog. | ||
* @param ramp initial ramp to show in dialog | ||
* @param parent parent widget | ||
*/ | ||
QgsPresetColorRampDialog( const QgsPresetSchemeColorRamp& ramp, QWidget* parent /TransferThis/ = nullptr ); | ||
|
||
/** Returns a color ramp representing the current settings from the dialog. | ||
* @see setRamp() | ||
*/ | ||
QgsPresetSchemeColorRamp ramp() const; | ||
|
||
/** Sets the color ramp to show in the dialog. | ||
* @param ramp color ramp | ||
* @see ramp() | ||
*/ | ||
void setRamp( const QgsPresetSchemeColorRamp& ramp ); | ||
|
||
signals: | ||
|
||
//! Emitted when the dialog settings change | ||
void changed(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.