Skip to content

Commit

Permalink
[ux] Hide frame when collapsible group box is collapsed
Browse files Browse the repository at this point in the history
Prevents an ugly cropped frame from showing in collapsed group
boxes
  • Loading branch information
nyalldawson committed Sep 14, 2018
1 parent a60324b commit a78a7e7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions python/gui/auto_generated/qgscollapsiblegroupbox.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ Visual fixes for when group box is collapsed/expanded
void clearModifiers();



};


Expand Down
5 changes: 4 additions & 1 deletion src/gui/qgscollapsiblegroupbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,8 @@ void QgsCollapsibleGroupBoxBasic::updateStyle()
ss += QLatin1String( " background-color: rgba(0,0,0,0)" );
}
ss += '}';
setStyleSheet( styleSheet() + ss );
mStyleSheet = styleSheet() + ss;
setStyleSheet( mStyleSheet );

// clear toolbutton default background and border and apply offset
QString ssd;
Expand Down Expand Up @@ -445,6 +446,7 @@ void QgsCollapsibleGroupBoxBasic::collapseExpandFixes()

if ( mCollapsed )
{
setStyleSheet( mStyleSheet + " QgsCollapsibleGroupBoxBasic { border: none; }" );
Q_FOREACH ( QObject *child, children() )
{
QWidget *w = qobject_cast<QWidget *>( child );
Expand All @@ -457,6 +459,7 @@ void QgsCollapsibleGroupBoxBasic::collapseExpandFixes()
}
else // on expand
{
setStyleSheet( mStyleSheet );
Q_FOREACH ( QObject *child, children() )
{
QWidget *w = qobject_cast<QWidget *>( child );
Expand Down
2 changes: 2 additions & 0 deletions src/gui/qgscollapsiblegroupbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ class GUI_EXPORT QgsCollapsibleGroupBoxBasic : public QGroupBox

QIcon mCollapseIcon;
QIcon mExpandIcon;

QString mStyleSheet;
};

/**
Expand Down

0 comments on commit a78a7e7

Please sign in to comment.