Skip to content

Commit

Permalink
Remove option to bold group box names, now always on
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed May 21, 2015
1 parent fca8c5e commit 4e09d4d
Show file tree
Hide file tree
Showing 4 changed files with 285 additions and 123 deletions.
64 changes: 28 additions & 36 deletions src/app/qgisappstylesheet.cpp
Expand Up @@ -89,9 +89,6 @@ QMap<QString, QVariant> QgisAppStyleSheet::defaultOptions()
bool gbxCustom = ( mMacStyle ? true : false );
opts.insert( "groupBoxCustom", settings.value( "groupBoxCustom", QVariant( gbxCustom ) ) );

bool gbxBoldTitle = false;
opts.insert( "groupBoxBoldTitle", settings.value( "groupBoxBoldTitle", QVariant( gbxBoldTitle ) ) );

opts.insert( "sidebarStyle", settings.value( "sidebarStyle", true ) );

settings.endGroup(); // "qgis/stylesheet"
Expand All @@ -118,45 +115,40 @@ void QgisAppStyleSheet::buildStyleSheet( const QMap<QString, QVariant>& opts )
// QGroupBox and QgsCollapsibleGroupBox, mostly for Ubuntu and Mac
bool gbxCustom = opts.value( "groupBoxCustom" ).toBool();
QgsDebugMsg( QString( "groupBoxCustom: %1" ).arg( gbxCustom ) );
bool gbxBoldTitle = opts.value( "groupBoxBoldTitle" ).toBool();
QgsDebugMsg( QString( "groupBoxBoldTitle: %1" ).arg( gbxBoldTitle ) );

bool sidebar = opts.value( "sidebarStyle" ).toBool();
if ( gbxCustom || gbxBoldTitle )

ss += "QGroupBox{";
// doesn't work for QGroupBox::title
ss += QString( "color: rgb(%1,%1,%1);" ).arg( mMacStyle ? 25 : 60 );
ss += "font-weight: bold;";

if ( gbxCustom )
{
ss += "QGroupBox{";
if ( gbxBoldTitle )
{
// doesn't work for QGroupBox::title
ss += QString( "color: rgb(%1,%1,%1);" ).arg( mMacStyle ? 25 : 60 );
ss += "font-weight: bold;";
}
if ( gbxCustom )
{
ss += QString( "background-color: rgba(0,0,0,%1%);" )
.arg( mWinOS && mStyle.startsWith( "windows" ) ? 0 : 3 );
ss += "border: 1px solid rgba(0,0,0,20%);";
ss += "border-radius: 5px;";
ss += "margin-top: 2.5ex;";
ss += QString( "margin-bottom: %1ex;" ).arg( mMacStyle ? 1.5 : 1 );
}
ss += QString( "background-color: rgba(0,0,0,%1%);" )
.arg( mWinOS && mStyle.startsWith( "windows" ) ? 0 : 3 );
ss += "border: 1px solid rgba(0,0,0,20%);";
ss += "border-radius: 5px;";
ss += "margin-top: 2.5ex;";
ss += QString( "margin-bottom: %1ex;" ).arg( mMacStyle ? 1.5 : 1 );
}
ss += "} ";
if ( gbxCustom )
{
ss += "QGroupBox:flat{";
ss += "background-color: rgba(0,0,0,0);";
ss += "border: rgba(0,0,0,0);";
ss += "} ";
if ( gbxCustom )

ss += "QGroupBox::title{";
ss += "subcontrol-origin: margin;";
ss += "subcontrol-position: top left;";
ss += "margin-left: 6px;";
if ( !( mWinOS && mStyle.startsWith( "windows" ) ) && !mOxyStyle )
{
ss += "QGroupBox:flat{";
ss += "background-color: rgba(0,0,0,0);";
ss += "border: rgba(0,0,0,0);";
ss += "} ";

ss += "QGroupBox::title{";
ss += "subcontrol-origin: margin;";
ss += "subcontrol-position: top left;";
ss += "margin-left: 6px;";
if ( !( mWinOS && mStyle.startsWith( "windows" ) ) && !mOxyStyle )
{
ss += "background-color: rgba(0,0,0,0);";
}
ss += "} ";
}
ss += "} ";
}

if ( sidebar )
Expand Down
7 changes: 0 additions & 7 deletions src/app/qgsoptions.cpp
Expand Up @@ -537,7 +537,6 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl ) :
// custom group boxes
mCustomGroupBoxChkBx->setChecked( mStyleSheetOldOpts.value( "groupBoxCustom" ).toBool() );
mCustomSideBarSide->setChecked( mStyleSheetOldOpts.value( "sidebarStyle" ).toBool() );
mBoldGroupBoxTitleChkBx->setChecked( mStyleSheetOldOpts.value( "groupBoxBoldTitle" ).toBool() );

mMessageTimeoutSpnBx->setValue( settings.value( "/qgis/messageTimeout", 5 ).toInt() );

Expand Down Expand Up @@ -1446,12 +1445,6 @@ void QgsOptions::on_mCustomSideBarSide_clicked( bool chkd )
mStyleSheetBuilder->buildStyleSheet( mStyleSheetNewOpts );
}

void QgsOptions::on_mBoldGroupBoxTitleChkBx_clicked( bool chkd )
{
mStyleSheetNewOpts.insert( "groupBoxBoldTitle", QVariant( chkd ) );
mStyleSheetBuilder->buildStyleSheet( mStyleSheetNewOpts );
}

void QgsOptions::on_leProjectGlobalCrs_crsChanged( QgsCoordinateReferenceSystem crs )
{
mDefaultCrs = crs;
Expand Down
3 changes: 0 additions & 3 deletions src/app/qgsoptions.h
Expand Up @@ -115,9 +115,6 @@ class APP_EXPORT QgsOptions : public QgsOptionsDialogBase, private Ui::QgsOption
*/
void on_mCustomSideBarSide_clicked( bool chkd );

/** Slot to set whether to bold group box title. */
void on_mBoldGroupBoxTitleChkBx_clicked( bool chkd );

void on_mProxyTypeComboBox_currentIndexChanged( int idx );

/**Add a new URL to exclude from Proxy*/
Expand Down

0 comments on commit 4e09d4d

Please sign in to comment.