Commit 28903091 authored by Marco Martin's avatar Marco Martin
Browse files

Bigger button on tablet mode configurable

put the button enlarge on tablet mode behind a config option default off.
For now the menus and the titlebars still grow in tablet mode

BUG:452987
parent d649c0d7
Pipeline #168640 failed with stage
in 2 minutes and 16 seconds
......@@ -8,6 +8,11 @@
<!-- common options -->
<group name="Common">
<!-- tablet mode -->
<entry name="BigControlsOnTablet" type = "Bool">
<default>false</default>
</entry>
<!-- shadow -->
<entry name="ShadowStrength" type = "Int">
<default>255</default>
......
......@@ -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
}
//___________________________________________________________________________________________________________________
......
......@@ -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() );
......
......@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>562</width>
<height>264</height>
<height>428</height>
</rect>
</property>
<property name="sizePolicy">
......@@ -39,7 +39,80 @@
<string>General</string>
</attribute>
<layout class="QGridLayout" name="gridLayout">
<item row="6" column="1">
<item row="8" column="1" colspan="3">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>49</height>
</size>
</property>
</spacer>
</item>
<item row="5" column="1" colspan="4">
<widget class="QCheckBox" name="_splitterProxyEnabled">
<property name="text">
<string>Enable extended resize handles</string>
</property>
</widget>
</item>
<item row="7" column="2" colspan="2">
<widget class="QComboBox" name="_windowDragMode">
<item>
<property name="text">
<string>Drag windows from titlebar only</string>
</property>
</item>
<item>
<property name="text">
<string>Drag windows from titlebar, menubar and toolbars</string>
</property>
</item>
<item>
<property name="text">
<string>Drag windows from all empty areas</string>
</property>
</item>
</widget>
</item>
<item row="4" column="1" colspan="4">
<widget class="QCheckBox" name="_sliderDrawTickMarks">
<property name="text">
<string>Draw slider tick marks</string>
</property>
</widget>
</item>
<item row="6" column="4">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>65</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1" colspan="4">
<widget class="QCheckBox" name="_tabBarDrawCenteredTabs">
<property name="text">
<string>Center tabbar tabs</string>
</property>
</widget>
</item>
<item row="3" column="1" colspan="4">
<widget class="QCheckBox" name="_viewDrawFocusIndicator">
<property name="text">
<string>Draw focus indicator in lists</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QLabel" name="_windowDragLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
......@@ -59,13 +132,13 @@
</widget>
</item>
<item row="2" column="1" colspan="4">
<widget class="QCheckBox" name="_viewDrawFocusIndicator">
<widget class="QCheckBox" name="_toolBarDrawItemSeparator">
<property name="text">
<string>Draw focus indicator in lists</string>
<string>Draw toolbar item separators</string>
</property>
</widget>
</item>
<item row="5" column="1">
<item row="6" column="1">
<widget class="QLabel" name="_mnemonicsLabel">
<property name="text">
<string>&amp;Keyboard accelerators visibility:</string>
......@@ -78,7 +151,7 @@
</property>
</widget>
</item>
<item row="5" column="2" colspan="2">
<item row="6" column="2" colspan="2">
<widget class="QComboBox" name="_mnemonicsMode">
<item>
<property name="text">
......@@ -97,76 +170,10 @@
</item>
</widget>
</item>
<item row="5" column="4">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>65</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="6" column="2" colspan="2">
<widget class="QComboBox" name="_windowDragMode">
<item>
<property name="text">
<string>Drag windows from titlebar only</string>
</property>
</item>
<item>
<property name="text">
<string>Drag windows from titlebar, menubar and toolbars</string>
</property>
</item>
<item>
<property name="text">
<string>Drag windows from all empty areas</string>
</property>
</item>
</widget>
</item>
<item row="7" column="1" colspan="3">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>49</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1" colspan="4">
<widget class="QCheckBox" name="_tabBarDrawCenteredTabs">
<property name="text">
<string>Center tabbar tabs</string>
</property>
</widget>
</item>
<item row="1" column="1" colspan="4">
<widget class="QCheckBox" name="_toolBarDrawItemSeparator">
<property name="text">
<string>Draw toolbar item separators</string>
</property>
</widget>
</item>
<item row="3" column="1" colspan="4">
<widget class="QCheckBox" name="_sliderDrawTickMarks">
<property name="text">
<string>Draw slider tick marks</string>
</property>
</widget>
</item>
<item row="4" column="1" colspan="4">
<widget class="QCheckBox" name="_splitterProxyEnabled">
<item row="1" column="1">
<widget class="QCheckBox" name="_bigControlsOnTablet">
<property name="text">
<string>Enable extended resize handles</string>
<string>Bigger buttons in tablet mode</string>
</property>
</widget>
</item>
......@@ -464,6 +471,5 @@
<tabstop>_scrollBarAddLineButtons</tabstop>
</tabstops>
<resources/>
<connections>
</connections>
<connections/>
</ui>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment