mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-20 08:10:52 +01:00
Small fixes
- Better call of QColorDialog::getColor in ColorButton (reflects new ColorComboBox class) - no CamelCase for variable - Typo
This commit is contained in:
@@ -56,12 +56,12 @@ void ColorButton::setColor(const QColor &color)
|
|||||||
void ColorButton::clicked(bool checked)
|
void ColorButton::clicked(bool checked)
|
||||||
{
|
{
|
||||||
// Open color selection dialog
|
// Open color selection dialog
|
||||||
auto newColor = QColorDialog::getColor(m_color);
|
auto new_color = QColorDialog::getColor(m_color, this, tr("Select color"), QColorDialog::DontUseNativeDialog);
|
||||||
|
|
||||||
// Validate user input
|
// Validate user input
|
||||||
if (newColor.isValid()) {
|
if (new_color.isValid()) {
|
||||||
m_color = newColor;
|
m_color = new_color;
|
||||||
emit changed(newColor);
|
emit changed(new_color);
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -75,7 +75,7 @@ void ColorButton::paintEvent(QPaintEvent *e) {
|
|||||||
QPushButton::paintEvent(e);
|
QPushButton::paintEvent(e);
|
||||||
QPainter painter(this);
|
QPainter painter(this);
|
||||||
|
|
||||||
// Get dimensions of te button paint surface
|
// Get dimensions of the button paint surface
|
||||||
auto r_width = painter.device()->width();
|
auto r_width = painter.device()->width();
|
||||||
auto r_height = painter.device()->height();
|
auto r_height = painter.device()->height();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user