Commit db73f778 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: reduce the size of the margins and spacing between buttons

parent 84daf8ce
...@@ -46,6 +46,8 @@ ...@@ -46,6 +46,8 @@
#include <QSignalMapper> #include <QSignalMapper>
#include <QTimer> #include <QTimer>
//#define DEBUG_LAYOUT 1
/********************************************************************** /**********************************************************************
* TEH controls * TEH controls
**********************************************************************/ **********************************************************************/
...@@ -143,13 +145,13 @@ void AbstractController::createAndAddWidget( QBoxLayout *controlLayout, ...@@ -143,13 +145,13 @@ void AbstractController::createAndAddWidget( QBoxLayout *controlLayout,
/* Special case for SPACERS, who aren't QWidgets */ /* Special case for SPACERS, who aren't QWidgets */
if( i_type == WIDGET_SPACER ) if( i_type == WIDGET_SPACER )
{ {
controlLayout->insertSpacing( i_index, 16 ); controlLayout->insertSpacing( i_index, 12 );
return; return;
} }
if( i_type == WIDGET_SPACER_EXTEND ) if( i_type == WIDGET_SPACER_EXTEND )
{ {
controlLayout->insertStretch( i_index, 16 ); controlLayout->insertStretch( i_index, 12 );
return; return;
} }
...@@ -547,19 +549,22 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i, ...@@ -547,19 +549,22 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i,
{ {
/* advanced Controls handling */ /* advanced Controls handling */
b_advancedVisible = b_advControls; b_advancedVisible = b_advControls;
#if DEBUG_LAYOUT
setStyleSheet( " background: red ");
#endif
QVBoxLayout *controlLayout = new QVBoxLayout( this ); QVBoxLayout *controlLayout = new QVBoxLayout( this );
controlLayout->setContentsMargins( 5, 3, 5, 2 ); controlLayout->setContentsMargins( 4, 2, 4, 0 );
controlLayout->setSpacing( 0 ); controlLayout->setSpacing( 0 );
QHBoxLayout *controlLayout1 = new QHBoxLayout; QHBoxLayout *controlLayout1 = new QHBoxLayout;
controlLayout1->setSpacing( 0 ); controlLayout1->setSpacing( 0 ); controlLayout1->setMargin( 0 );
QString line1 = getSettings()->value( "MainToolbar1", MAIN_TB1_DEFAULT ) QString line1 = getSettings()->value( "MainToolbar1", MAIN_TB1_DEFAULT )
.toString(); .toString();
parseAndCreate( line1, controlLayout1 ); parseAndCreate( line1, controlLayout1 );
QHBoxLayout *controlLayout2 = new QHBoxLayout; QHBoxLayout *controlLayout2 = new QHBoxLayout;
controlLayout2->setSpacing( 0 ); controlLayout2->setSpacing( 0 ); controlLayout2->setMargin( 0 );
QString line2 = getSettings()->value( "MainToolbar2", MAIN_TB2_DEFAULT ) QString line2 = getSettings()->value( "MainToolbar2", MAIN_TB2_DEFAULT )
.toString(); .toString();
parseAndCreate( line2, controlLayout2 ); parseAndCreate( line2, controlLayout2 );
...@@ -596,6 +601,10 @@ AdvControlsWidget::AdvControlsWidget( intf_thread_t *_p_i, QWidget *_parent ) : ...@@ -596,6 +601,10 @@ AdvControlsWidget::AdvControlsWidget( intf_thread_t *_p_i, QWidget *_parent ) :
controlLayout = new QHBoxLayout( this ); controlLayout = new QHBoxLayout( this );
controlLayout->setMargin( 0 ); controlLayout->setMargin( 0 );
controlLayout->setSpacing( 0 ); controlLayout->setSpacing( 0 );
#if DEBUG_LAYOUT
setStyleSheet( " background: orange ");
#endif
QString line = getSettings()->value( "AdvToolbar", ADV_TB_DEFAULT ) QString line = getSettings()->value( "AdvToolbar", ADV_TB_DEFAULT )
.toString(); .toString();
...@@ -608,6 +617,9 @@ InputControlsWidget::InputControlsWidget( intf_thread_t *_p_i, QWidget *_parent ...@@ -608,6 +617,9 @@ InputControlsWidget::InputControlsWidget( intf_thread_t *_p_i, QWidget *_parent
controlLayout = new QHBoxLayout( this ); controlLayout = new QHBoxLayout( this );
controlLayout->setMargin( 0 ); controlLayout->setMargin( 0 );
controlLayout->setSpacing( 0 ); controlLayout->setSpacing( 0 );
#if DEBUG_LAYOUT
setStyleSheet( " background: green ");
#endif
QString line = getSettings()->value( "InputToolbar", INPT_TB_DEFAULT ).toString(); QString line = getSettings()->value( "InputToolbar", INPT_TB_DEFAULT ).toString();
parseAndCreate( line, controlLayout ); parseAndCreate( line, controlLayout );
......
Markdown is supported
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