diff --git a/kstyle/config/breezestyleconfig.cpp b/kstyle/config/breezestyleconfig.cpp index df51f0f1..62999465 100644 --- a/kstyle/config/breezestyleconfig.cpp +++ b/kstyle/config/breezestyleconfig.cpp @@ -1,143 +1,147 @@ /************************************************************************* * Copyright (C) 2014 by Hugo Pereira Da Costa * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * *************************************************************************/ #include "breezestyleconfig.h" #include "breezestyleconfig.moc" #include "../breeze.h" #include "../config-breeze.h" #include "breezestyleconfigdata.h" #include #include extern "C" { Q_DECL_EXPORT QWidget* allocate_kstyle_config(QWidget* parent) { return new Breeze::StyleConfig(parent); } } namespace Breeze { //__________________________________________________________________ StyleConfig::StyleConfig(QWidget* parent): QWidget(parent) { setupUi(this); // load setup from configData load(); connect( _toolBarDrawItemSeparator, SIGNAL(toggled(bool)), SLOT(updateChanged()) ); + connect( _dockWidgetDrawFrame, SIGNAL(toggled(bool)), SLOT(updateChanged()) ); connect( _sliderDrawTickMarks, SIGNAL(toggled(bool)), SLOT(updateChanged()) ); connect( _splitterProxyEnabled, SIGNAL(toggled(bool)), SLOT(updateChanged()) ); connect( _mnemonicsMode, SIGNAL(currentIndexChanged(int)), SLOT(updateChanged()) ); connect( _animationsEnabled, SIGNAL(toggled(bool)), SLOT(updateChanged()) ); connect( _animationsDuration, SIGNAL(valueChanged(int)), SLOT(updateChanged()) ); connect( _scrollBarAddLineButtons, SIGNAL(currentIndexChanged(int)), SLOT(updateChanged()) ); connect( _scrollBarSubLineButtons, SIGNAL(currentIndexChanged(int)), SLOT(updateChanged()) ); connect( _windowDragMode, SIGNAL(currentIndexChanged(int)), SLOT(updateChanged()) ); } //__________________________________________________________________ void StyleConfig::save( void ) { StyleConfigData::setToolBarDrawItemSeparator( _toolBarDrawItemSeparator->isChecked() ); + StyleConfigData::setDockWidgetDrawFrame( _dockWidgetDrawFrame->isChecked() ); StyleConfigData::setSliderDrawTickMarks( _sliderDrawTickMarks->isChecked() ); StyleConfigData::setSplitterProxyEnabled( _splitterProxyEnabled->isChecked() ); StyleConfigData::setMnemonicsMode( _mnemonicsMode->currentIndex() ); StyleConfigData::setScrollBarAddLineButtons( _scrollBarAddLineButtons->currentIndex() ); StyleConfigData::setScrollBarSubLineButtons( _scrollBarSubLineButtons->currentIndex() ); StyleConfigData::setAnimationsEnabled( _animationsEnabled->isChecked() ); StyleConfigData::setAnimationsDuration( _animationsDuration->value() ); StyleConfigData::setWindowDragMode( _windowDragMode->currentIndex() ); #if BREEZE_USE_KDE4 StyleConfigData::self()->writeConfig(); #else StyleConfigData::self()->save(); #endif // emit dbus signal QDBusMessage message( QDBusMessage::createSignal( QStringLiteral( "/BreezeStyle" ), QStringLiteral( "org.kde.Breeze.Style" ), QStringLiteral( "reparseConfiguration" ) ) ); QDBusConnection::sessionBus().send(message); } //__________________________________________________________________ void StyleConfig::defaults( void ) { StyleConfigData::self()->setDefaults(); load(); } //__________________________________________________________________ void StyleConfig::reset( void ) { // reparse configuration #if BREEZE_USE_KDE4 StyleConfigData::self()->readConfig(); #else StyleConfigData::self()->load(); #endif load(); } //__________________________________________________________________ void StyleConfig::updateChanged() { bool modified( false ); // check if any value was modified if( _toolBarDrawItemSeparator->isChecked() != StyleConfigData::toolBarDrawItemSeparator() ) modified = true; + else if( _dockWidgetDrawFrame->isChecked() != StyleConfigData::dockWidgetDrawFrame() ) modified = true; else if( _sliderDrawTickMarks->isChecked() != StyleConfigData::sliderDrawTickMarks() ) modified = true; else if( _mnemonicsMode->currentIndex() != StyleConfigData::mnemonicsMode() ) modified = true; else if( _scrollBarAddLineButtons->currentIndex() != StyleConfigData::scrollBarAddLineButtons() ) modified = true; else if( _scrollBarSubLineButtons->currentIndex() != StyleConfigData::scrollBarSubLineButtons() ) modified = true; else if( _splitterProxyEnabled->isChecked() != StyleConfigData::splitterProxyEnabled() ) modified = true; else if( _animationsEnabled->isChecked() != StyleConfigData::animationsEnabled() ) modified = true; else if( _animationsDuration->value() != StyleConfigData::animationsDuration() ) modified = true; else if( _windowDragMode->currentIndex() != StyleConfigData::windowDragMode() ) modified = true; emit changed(modified); } //__________________________________________________________________ void StyleConfig::load( void ) { _toolBarDrawItemSeparator->setChecked( StyleConfigData::toolBarDrawItemSeparator() ); + _dockWidgetDrawFrame->setChecked( StyleConfigData::toolBarDrawItemSeparator() ); _sliderDrawTickMarks->setChecked( StyleConfigData::sliderDrawTickMarks() ); _mnemonicsMode->setCurrentIndex( StyleConfigData::mnemonicsMode() ); _splitterProxyEnabled->setChecked( StyleConfigData::splitterProxyEnabled() ); _scrollBarAddLineButtons->setCurrentIndex( StyleConfigData::scrollBarAddLineButtons() ); _scrollBarSubLineButtons->setCurrentIndex( StyleConfigData::scrollBarSubLineButtons() ); _animationsEnabled->setChecked( StyleConfigData::animationsEnabled() ); _animationsDuration->setValue( StyleConfigData::animationsDuration() ); _windowDragMode->setCurrentIndex( StyleConfigData::windowDragMode() ); } } diff --git a/kstyle/config/ui/breezestyleconfig.ui b/kstyle/config/ui/breezestyleconfig.ui index 1817e49e..b48e4d0d 100644 --- a/kstyle/config/ui/breezestyleconfig.ui +++ b/kstyle/config/ui/breezestyleconfig.ui @@ -1,308 +1,314 @@ BreezeStyleConfig 0 0 - 464 - 404 + 466 + 466 Form 0 0 0 Animations Animations d&uration: _animationsDuration ms 500 Qt::Horizontal 461 20 Enable animations Scrollbars &Top arrow button type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _scrollBarSubLineButtons No Buttons One Button Two Buttons Botto&m arrow button type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _scrollBarAddLineButtons No Buttons One Button Two Buttons Qt::Horizontal 405 20 Advanced - + + + + Draw frames around side panels + + + + &Keyboard accelerators visibility: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _mnemonicsMode - + Drag windows from titlebar only Drag windows from titlebar, menubar and toolbars Drag windows from all empty areas - + Always Hide Keyboard Accelerators Show Keyboard Accelerators When Needed Always Show Keyboard Accelerators - + Enable extended resize handles - + 0 0 W&indows' drag mode: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _windowDragMode - - - - Draw toolbar item separators - - - - + Draw slider tick marks - + Qt::Horizontal 65 20 + + + + Draw toolbar item separators + + + Qt::Vertical 20 40 KComboBox QComboBox
kcombobox.h
_animationsEnabled _animationsDuration _scrollBarSubLineButtons _scrollBarAddLineButtons - _toolBarDrawItemSeparator _splitterProxyEnabled _mnemonicsMode _windowDragMode