Skip to content

Commit

Permalink
[ui] Improve rendering of color tooltips
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn authored and nyalldawson committed Dec 2, 2024
1 parent 09e6496 commit 06178d2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/gui/qgscolortooltip_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,19 @@ class QgsColorTooltip

//draw color over pattern
p.setBrush( QBrush( color ) );
p.drawRect( margin, margin, width, height );

if ( color.alpha() < 255 )
{
//draw fully opaque color over half of the area
color.setAlpha( 255 );
p.setBrush( QBrush( color ) );
p.drawRect( margin, margin, width / 2, height );
}

//draw border
p.setPen( QColor( 197, 197, 197 ) );
p.setBrush( Qt::NoBrush );
p.drawRect( margin, margin, width, height );
p.end();

Expand Down

0 comments on commit 06178d2

Please sign in to comment.