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