mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-24 11:45:53 +01:00
Do not enable alpha channel for background colors
This commit is contained in:
parent
d0b3f48caf
commit
753c4e8db0
@ -9,6 +9,8 @@
|
||||
ColorBox::ColorBox(QWidget *parent) : QWidget(parent)
|
||||
{
|
||||
_color = Qt::red;
|
||||
_alpha = true;
|
||||
|
||||
setSizePolicy(QSizePolicy::QSizePolicy::Minimum, QSizePolicy::Fixed);
|
||||
}
|
||||
|
||||
@ -51,9 +53,9 @@ void ColorBox::mousePressEvent(QMouseEvent *event)
|
||||
{
|
||||
if (event->button() != Qt::LeftButton)
|
||||
return;
|
||||
|
||||
QColor color = QColorDialog::getColor(_color, this, QString(),
|
||||
QColorDialog::ShowAlphaChannel);
|
||||
QColorDialog::ColorDialogOptions options = _alpha
|
||||
? QColorDialog::ShowAlphaChannel : (QColorDialog::ColorDialogOptions)0;
|
||||
QColor color = QColorDialog::getColor(_color, this, QString(), options);
|
||||
if (color.isValid()) {
|
||||
_color = color;
|
||||
update();
|
||||
|
@ -12,6 +12,7 @@ public:
|
||||
|
||||
const QColor &color() const {return _color;}
|
||||
void setColor(const QColor &color);
|
||||
void enableAlphaChannel(bool enable) {_alpha = enable;}
|
||||
|
||||
QSize sizeHint() const;
|
||||
|
||||
@ -24,6 +25,7 @@ protected:
|
||||
|
||||
private:
|
||||
QColor _color;
|
||||
bool _alpha;
|
||||
};
|
||||
|
||||
#endif // COLORBOX_H
|
||||
|
@ -181,6 +181,7 @@ QWidget *OptionsDialog::createAppearancePage()
|
||||
_mapOpacity->setValue(_options->mapOpacity);
|
||||
_backgroundColor = new ColorBox();
|
||||
_backgroundColor->setColor(_options->backgroundColor);
|
||||
_backgroundColor->enableAlphaChannel(false);
|
||||
QFormLayout *mapLayout = new QFormLayout();
|
||||
mapLayout->addRow(tr("Background color:"), _backgroundColor);
|
||||
mapLayout->addRow(tr("Map opacity:"), _mapOpacity);
|
||||
|
Loading…
Reference in New Issue
Block a user