mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-28 09:55:37 -04:00
Try a statically calculated selection margin.
This commit is contained in:
parent
798a491296
commit
a27a5496b7
1 changed files with 6 additions and 7 deletions
|
@ -35,7 +35,8 @@
|
|||
|
||||
static const int VIEW_HEIGHT = CalamaresUtils::defaultFontHeight() + 8;
|
||||
static const int CORNER_RADIUS = 3;
|
||||
static const int EXTENDED_PARTITION_MARGIN = 4;
|
||||
static const int EXTENDED_PARTITION_MARGIN = qMax( 4, VIEW_HEIGHT / 6 );
|
||||
static const int SELECTION_MARGIN = ( EXTENDED_PARTITION_MARGIN - 2 ) / 2;
|
||||
|
||||
|
||||
PartitionBarsView::PartitionBarsView( QWidget* parent )
|
||||
|
@ -152,8 +153,6 @@ PartitionBarsView::drawSection( QPainter* painter, const QRect& rect_, int x, in
|
|||
highlightColor.setAlpha( 120 );
|
||||
painter->setBrush( highlightColor );
|
||||
|
||||
const int SEL_PADDING = 1;
|
||||
|
||||
QRect selectionRect = rect;
|
||||
selectionRect.setX( x + 1 );
|
||||
selectionRect.setWidth( width - 3 ); //account for the previous rect.adjust
|
||||
|
@ -164,10 +163,10 @@ PartitionBarsView::drawSection( QPainter* painter, const QRect& rect_, int x, in
|
|||
if ( rect.right() < selectionRect.right() ) //hack for last item
|
||||
selectionRect.adjust( 0, 0, - ( selectionRect.right() - rect.right() ), 0 );
|
||||
|
||||
selectionRect.adjust( SEL_PADDING,
|
||||
SEL_PADDING,
|
||||
-SEL_PADDING,
|
||||
-SEL_PADDING );
|
||||
selectionRect.adjust( SELECTION_MARGIN,
|
||||
SELECTION_MARGIN,
|
||||
-SELECTION_MARGIN,
|
||||
-SELECTION_MARGIN );
|
||||
|
||||
painter->drawRoundedRect( selectionRect,
|
||||
radius - 1,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue