Skip to content

Commit

Permalink
Remove option for custom side bar style, always on now
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed May 21, 2015
1 parent daee595 commit de3377b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 50 deletions.
44 changes: 15 additions & 29 deletions src/app/qgisappstylesheet.cpp
Expand Up @@ -89,8 +89,6 @@ QMap<QString, QVariant> QgisAppStyleSheet::defaultOptions()
bool gbxCustom = ( mMacStyle ? true : false );
opts.insert( "groupBoxCustom", settings.value( "groupBoxCustom", QVariant( gbxCustom ) ) );

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

settings.endGroup(); // "qgis/stylesheet"

return opts;
Expand All @@ -116,8 +114,6 @@ void QgisAppStyleSheet::buildStyleSheet( const QMap<QString, QVariant>& opts )
bool gbxCustom = opts.value( "groupBoxCustom" ).toBool();
QgsDebugMsg( QString( "groupBoxCustom: %1" ).arg( gbxCustom ) );

bool sidebar = opts.value( "sidebarStyle" ).toBool();

ss += "QGroupBox{";
// doesn't work for QGroupBox::title
ss += QString( "color: rgb(%1,%1,%1);" ).arg( mMacStyle ? 25 : 60 );
Expand Down Expand Up @@ -151,31 +147,21 @@ void QgisAppStyleSheet::buildStyleSheet( const QMap<QString, QVariant>& opts )
ss += "} ";
}

if ( sidebar )
{
QString style = "QListWidget#mOptionsListWidget {"
" background-color: rgb(69, 69, 69, 220);"
" outline: 0;"
"}"
"QListWidget#mOptionsListWidget::item {"
" color: white;"
" padding: 3px;"
"}"
"QListWidget#mOptionsListWidget::item::selected {"
" color: black;"
" background-color:palette(Window);"
" padding-right: 0px;"
"}";
ss += style;
}

//fix background issue for gnome desktop
if ( mLinuxOS && mGtkStyle && !sidebar )
{
ss += "QListWidget#mOptionsListWidget{";
ss += "background-color: white;";
ss += "} ";
}
//sidebar style
QString style = "QListWidget#mOptionsListWidget {"
" background-color: rgb(69, 69, 69, 220);"
" outline: 0;"
"}"
"QListWidget#mOptionsListWidget::item {"
" color: white;"
" padding: 3px;"
"}"
"QListWidget#mOptionsListWidget::item::selected {"
" color: black;"
" background-color:palette(Window);"
" padding-right: 0px;"
"}";
ss += style;

// Fix selection color on loosing focus (Windows)
const QPalette palette = qApp->palette();
Expand Down
7 changes: 0 additions & 7 deletions src/app/qgsoptions.cpp
Expand Up @@ -513,7 +513,6 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl ) :

// custom group boxes
mCustomGroupBoxChkBx->setChecked( mStyleSheetOldOpts.value( "groupBoxCustom" ).toBool() );
mCustomSideBarSide->setChecked( mStyleSheetOldOpts.value( "sidebarStyle" ).toBool() );

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

Expand Down Expand Up @@ -1394,12 +1393,6 @@ void QgsOptions::on_mCustomGroupBoxChkBx_clicked( bool chkd )
mStyleSheetBuilder->buildStyleSheet( mStyleSheetNewOpts );
}

void QgsOptions::on_mCustomSideBarSide_clicked( bool chkd )
{
mStyleSheetNewOpts.insert( "sidebarStyle", chkd );
mStyleSheetBuilder->buildStyleSheet( mStyleSheetNewOpts );
}

void QgsOptions::on_leProjectGlobalCrs_crsChanged( QgsCoordinateReferenceSystem crs )
{
mDefaultCrs = crs;
Expand Down
5 changes: 0 additions & 5 deletions src/app/qgsoptions.h
Expand Up @@ -103,11 +103,6 @@ class APP_EXPORT QgsOptions : public QgsOptionsDialogBase, private Ui::QgsOption
/** Slot to set whether to use custom group boxes */
void on_mCustomGroupBoxChkBx_clicked( bool chkd );

/** Slot to set whether to use custom side bar style
* @note added in QGIS 2.2
*/
void on_mCustomSideBarSide_clicked( bool chkd );

void on_mProxyTypeComboBox_currentIndexChanged( int idx );

/**Add a new URL to exclude from Proxy*/
Expand Down
10 changes: 1 addition & 9 deletions src/ui/qgsoptionsbase.ui
Expand Up @@ -310,7 +310,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>635</width>
<width>610</width>
<height>635</height>
</rect>
</property>
Expand Down Expand Up @@ -600,13 +600,6 @@
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_32">
<item>
<widget class="QCheckBox" name="mCustomSideBarSide">
<property name="text">
<string>Custom side bar style</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cbxCanvasRotation">
<property name="text">
Expand Down Expand Up @@ -4929,7 +4922,6 @@
<tabstop>mCustomGroupBoxChkBx</tabstop>
<tabstop>mNativeColorDialogsChkBx</tabstop>
<tabstop>mLiveColorDialogsChkBx</tabstop>
<tabstop>mCustomSideBarSide</tabstop>
<tabstop>cbxCanvasRotation</tabstop>
<tabstop>mProjectOnLaunchCmbBx</tabstop>
<tabstop>mProjectOnLaunchLineEdit</tabstop>
Expand Down

0 comments on commit de3377b

Please sign in to comment.