File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -1377,7 +1377,8 @@ void QgsColorTextWidget::updateText()
1377
1377
void QgsColorTextWidget::textChanged ()
1378
1378
{
1379
1379
QString testString = mLineEdit ->text ();
1380
- QColor color = QgsSymbolLayerV2Utils::parseColor ( testString );
1380
+ bool containsAlpha;
1381
+ QColor color = QgsSymbolLayerV2Utils::parseColorWithAlpha ( testString, containsAlpha );
1381
1382
if ( !color.isValid () )
1382
1383
{
1383
1384
// bad color string
@@ -1388,6 +1389,11 @@ void QgsColorTextWidget::textChanged()
1388
1389
// good color string
1389
1390
if ( color != mCurrentColor )
1390
1391
{
1392
+ // retain alpha if no explicit alpha set
1393
+ if ( !containsAlpha )
1394
+ {
1395
+ color.setAlpha ( mCurrentColor .alpha () );
1396
+ }
1391
1397
// color has changed
1392
1398
mCurrentColor = color;
1393
1399
emit colorChanged ( mCurrentColor );
You can’t perform that action at this time.
0 commit comments