[ux] Hide frame when collapsible group box is collapsed

Prevents an ugly cropped frame from showing in collapsed group
boxes
This commit is contained in:
Nyall Dawson 2018-09-14 15:15:41 +10:00
parent a60324b79b
commit a78a7e7908
3 changed files with 7 additions and 1 deletions

View File

@ -118,6 +118,7 @@ Visual fixes for when group box is collapsed/expanded
void clearModifiers();
};

View File

@ -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;
@ -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 );
@ -457,6 +459,7 @@ void QgsCollapsibleGroupBoxBasic::collapseExpandFixes()
}
else // on expand
{
setStyleSheet( mStyleSheet );
Q_FOREACH ( QObject *child, children() )
{
QWidget *w = qobject_cast<QWidget *>( child );

View File

@ -166,6 +166,8 @@ class GUI_EXPORT QgsCollapsibleGroupBoxBasic : public QGroupBox
QIcon mCollapseIcon;
QIcon mExpandIcon;
QString mStyleSheet;
};
/**