diff --git a/kstyle/breeze.kcfg b/kstyle/breeze.kcfg index 4fb72a9d..b7a96f5e 100644 --- a/kstyle/breeze.kcfg +++ b/kstyle/breeze.kcfg @@ -8,6 +8,11 @@ + + + false + + 255 diff --git a/kstyle/breezestyle.cpp b/kstyle/breezestyle.cpp index 99c21589..d584b5e2 100644 --- a/kstyle/breezestyle.cpp +++ b/kstyle/breezestyle.cpp @@ -267,6 +267,7 @@ namespace Breeze QEvent e(QEvent::StyleChange); QCoreApplication::sendEvent(w, &e); w->update(); + w->updateGeometry(); } } }); @@ -585,61 +586,61 @@ namespace Breeze return Metrics::MenuItem_MarginHeight; } case LineEdit_FrameWidth: - if( isTabletMode() ) { + if( isTabletMode() && StyleConfigData::bigControlsOnTablet() ) { return Metrics::LineEdit_FrameWidth_Tablet; } else { return Metrics::LineEdit_FrameWidth; } case ComboBox_FrameWidth: - if( isTabletMode() ) { + if( isTabletMode() && StyleConfigData::bigControlsOnTablet() ) { return Metrics::ComboBox_FrameWidth_Tablet; } else { return Metrics::ComboBox_FrameWidth; } case SpinBox_FrameWidth: - if( isTabletMode() ) { + if( isTabletMode() && StyleConfigData::bigControlsOnTablet() ) { return Metrics::SpinBox_FrameWidth_Tablet; } else { return Metrics::SpinBox_FrameWidth; } case CheckBox_Size: - if( isTabletMode() ) { + if( isTabletMode() && StyleConfigData::bigControlsOnTablet() ) { return Metrics::CheckBox_Size_Tablet; } else { return Metrics::CheckBox_Size; } case Button_MarginWidth: - if( isTabletMode() ) { + if( isTabletMode() && StyleConfigData::bigControlsOnTablet() ) { return Metrics::Button_MarginWidth_Tablet; } else { return Metrics::Button_MarginWidth; } case ToolButton_MarginWidth: - if( isTabletMode() ) { + if( isTabletMode() && StyleConfigData::bigControlsOnTablet() ) { return Metrics::ToolButton_MarginWidth_Tablet; } else { return Metrics::ToolButton_MarginWidth; } case Slider_GrooveThickness: - if( isTabletMode() ) { + if( isTabletMode() && StyleConfigData::bigControlsOnTablet() ) { return Metrics::Slider_GrooveThickness_Tablet; } else { return Metrics::Slider_GrooveThickness; } case Slider_ControlThickness: - if( isTabletMode() ) { + if( isTabletMode() && StyleConfigData::bigControlsOnTablet() ) { return Metrics::Slider_ControlThickness_Tablet; } else { return Metrics::Slider_ControlThickness; } case TabBar_TabMarginHeight: - if( isTabletMode() ) { + if( isTabletMode() && StyleConfigData::bigControlsOnTablet() ) { return Metrics::TabBar_TabMarginHeight_Tablet; } else { return Metrics::TabBar_TabMarginHeight; } case TabBar_TabMarginWidth: - if( isTabletMode() ) { + if( isTabletMode() && StyleConfigData::bigControlsOnTablet() ) { return Metrics::TabBar_TabMarginWidth_Tablet; } else { return Metrics::TabBar_TabMarginWidth; @@ -1778,6 +1779,20 @@ namespace Breeze // widget explorer _widgetExplorer->setEnabled( StyleConfigData::widgetExplorerEnabled() ); _widgetExplorer->setDrawWidgetRects( StyleConfigData::drawWidgetRects() ); + + // Refresh the tablet mode layout changes +#if BREEZE_HAVE_QTQUICK + const QWidgetList all = qApp->allWidgets(); + for (QWidgetList::ConstIterator it = all.constBegin(), cend = all.constEnd(); it != cend; ++it) { + QWidget *w = *it; + if (w->windowType() != Qt::Desktop && !w->testAttribute(Qt::WA_SetStyle)) { + QEvent e(QEvent::StyleChange); + QCoreApplication::sendEvent(w, &e); + w->update(); + w->updateGeometry(); + } + } +#endif } //___________________________________________________________________________________________________________________ diff --git a/kstyle/config/breezestyleconfig.cpp b/kstyle/config/breezestyleconfig.cpp index ce2bd1e8..08bdbd61 100644 --- a/kstyle/config/breezestyleconfig.cpp +++ b/kstyle/config/breezestyleconfig.cpp @@ -31,6 +31,7 @@ namespace Breeze // load setup from configData load(); + connect( _bigControlsOnTablet, &QAbstractButton::toggled, this, &StyleConfig::updateChanged ); connect( _tabBarDrawCenteredTabs, &QAbstractButton::toggled, this, &StyleConfig::updateChanged ); connect( _toolBarDrawItemSeparator, &QAbstractButton::toggled, this, &StyleConfig::updateChanged ); connect( _viewDrawFocusIndicator, &QAbstractButton::toggled, this, &StyleConfig::updateChanged ); @@ -50,6 +51,7 @@ namespace Breeze //__________________________________________________________________ void StyleConfig::save() { + StyleConfigData::setBigControlsOnTablet( _bigControlsOnTablet->isChecked() ); StyleConfigData::setTabBarDrawCenteredTabs( _tabBarDrawCenteredTabs->isChecked() ); StyleConfigData::setToolBarDrawItemSeparator( _toolBarDrawItemSeparator->isChecked() ); StyleConfigData::setViewDrawFocusIndicator( _viewDrawFocusIndicator->isChecked() ); @@ -96,6 +98,7 @@ namespace Breeze // check if any value was modified if( _tabBarDrawCenteredTabs->isChecked() != StyleConfigData::tabBarDrawCenteredTabs() ) modified = true; + else if( _bigControlsOnTablet->isChecked() != StyleConfigData::bigControlsOnTablet() ) modified = true; else if( _toolBarDrawItemSeparator->isChecked() != StyleConfigData::toolBarDrawItemSeparator() ) modified = true; else if( _viewDrawFocusIndicator->isChecked() != StyleConfigData::viewDrawFocusIndicator() ) modified = true; else if( _dockWidgetDrawFrame->isChecked() != StyleConfigData::dockWidgetDrawFrame() ) modified = true; @@ -117,6 +120,7 @@ namespace Breeze void StyleConfig::load() { + _bigControlsOnTablet->setChecked( StyleConfigData::bigControlsOnTablet() ); _tabBarDrawCenteredTabs->setChecked( StyleConfigData::tabBarDrawCenteredTabs() ); _toolBarDrawItemSeparator->setChecked( StyleConfigData::toolBarDrawItemSeparator() ); _viewDrawFocusIndicator->setChecked( StyleConfigData::viewDrawFocusIndicator() ); diff --git a/kstyle/config/ui/breezestyleconfig.ui b/kstyle/config/ui/breezestyleconfig.ui index e33c31f3..02ab9516 100644 --- a/kstyle/config/ui/breezestyleconfig.ui +++ b/kstyle/config/ui/breezestyleconfig.ui @@ -7,7 +7,7 @@ 0 0 562 - 264 + 428 @@ -39,7 +39,80 @@ General - + + + + Qt::Vertical + + + + 20 + 49 + + + + + + + + Enable extended resize handles + + + + + + + + Drag windows from titlebar only + + + + + Drag windows from titlebar, menubar and toolbars + + + + + Drag windows from all empty areas + + + + + + + + Draw slider tick marks + + + + + + + Qt::Horizontal + + + + 65 + 20 + + + + + + + + Center tabbar tabs + + + + + + + Draw focus indicator in lists + + + + @@ -59,13 +132,13 @@ - + - Draw focus indicator in lists + Draw toolbar item separators - + &Keyboard accelerators visibility: @@ -78,7 +151,7 @@ - + @@ -97,76 +170,10 @@ - - - - Qt::Horizontal - - - - 65 - 20 - - - - - - - - - Drag windows from titlebar only - - - - - Drag windows from titlebar, menubar and toolbars - - - - - Drag windows from all empty areas - - - - - - - - Qt::Vertical - - - - 20 - 49 - - - - - - - - Center tabbar tabs - - - - - - - Draw toolbar item separators - - - - - - - Draw slider tick marks - - - - - + + - Enable extended resize handles + Bigger buttons in tablet mode @@ -464,6 +471,5 @@ _scrollBarAddLineButtons - - +