Skip to content

Commit

Permalink
Removed the excessive margin in instruments' GUI (#5129) (#5171)
Browse files Browse the repository at this point in the history
* Removed the excessive margin in instruments' GUI (#5129)

* Reduced the font size for "master pitch" label.
* Reduced the layout spacing for MIDI Input and MIDI Output groups
* Shortened labels, so that the LcdSpinBoxes are spaced evenly

* Added translator's comments

* Whitespace fix
  • Loading branch information
artur-twardowski authored Jul 9, 2020
1 parent e07c78d commit 9895472
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions src/gui/widgets/InstrumentMidiIOView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,22 @@ InstrumentMidiIOView::InstrumentMidiIOView( QWidget* parent ) :

QHBoxLayout* midiInputLayout = new QHBoxLayout( m_midiInputGroupBox );
midiInputLayout->setContentsMargins( 8, 18, 8, 8 );
midiInputLayout->setSpacing( 6 );
midiInputLayout->setSpacing( 4 );

m_inputChannelSpinBox = new LcdSpinBox( 2, m_midiInputGroupBox );
m_inputChannelSpinBox->addTextForValue( 0, "--" );
m_inputChannelSpinBox->setLabel( tr( "CHANNEL" ) );
/*: This string must be be short, its width must be less than
* width of LCD spin-box of two digits */
m_inputChannelSpinBox->setLabel( tr( "CHAN" ) );
m_inputChannelSpinBox->setEnabled( false );
midiInputLayout->addWidget( m_inputChannelSpinBox );

m_fixedInputVelocitySpinBox = new LcdSpinBox( 3, m_midiInputGroupBox );
m_fixedInputVelocitySpinBox->setDisplayOffset( 1 );
m_fixedInputVelocitySpinBox->addTextForValue( 0, "---" );
m_fixedInputVelocitySpinBox->setLabel( tr( "VELOCITY" ) );
/*: This string must be be short, its width must be less than
* width of LCD spin-box of three digits */
m_fixedInputVelocitySpinBox->setLabel( tr( "VELOC" ) );
m_fixedInputVelocitySpinBox->setEnabled( false );
midiInputLayout->addWidget( m_fixedInputVelocitySpinBox );
midiInputLayout->addStretch();
Expand All @@ -81,28 +85,37 @@ InstrumentMidiIOView::InstrumentMidiIOView( QWidget* parent ) :

QHBoxLayout* midiOutputLayout = new QHBoxLayout( m_midiOutputGroupBox );
midiOutputLayout->setContentsMargins( 8, 18, 8, 8 );
midiOutputLayout->setSpacing( 6 );
midiOutputLayout->setSpacing( 4 );

m_outputChannelSpinBox = new LcdSpinBox( 2, m_midiOutputGroupBox );
m_outputChannelSpinBox->addTextForValue( 0, "--" );
m_outputChannelSpinBox->setLabel( tr( "CHANNEL" ) );
/*: This string must be be short, its width must be less than
* width of LCD spin-box of two digits */
m_outputChannelSpinBox->setLabel( tr( "CHAN" ) );
m_outputChannelSpinBox->setEnabled( false );
midiOutputLayout->addWidget( m_outputChannelSpinBox );

m_fixedOutputVelocitySpinBox = new LcdSpinBox( 3, m_midiOutputGroupBox );
m_fixedOutputVelocitySpinBox->setDisplayOffset( 1 );
m_fixedOutputVelocitySpinBox->addTextForValue( 0, "---" );
m_fixedOutputVelocitySpinBox->setLabel( tr( "VELOCITY" ) );
/*: This string must be be short, its width must be less than
* width of LCD spin-box of three digits */
m_fixedOutputVelocitySpinBox->setLabel( tr( "VELOC" ) );
m_fixedOutputVelocitySpinBox->setEnabled( false );
midiOutputLayout->addWidget( m_fixedOutputVelocitySpinBox );

m_outputProgramSpinBox = new LcdSpinBox( 3, m_midiOutputGroupBox );
m_outputProgramSpinBox->setLabel( tr( "PROGRAM" ) );
/*: This string must be be short, its width must be less than the
* width of LCD spin-box of three digits */
m_outputProgramSpinBox->setLabel( tr( "PROG" ) );
m_outputProgramSpinBox->setEnabled( false );
midiOutputLayout->addWidget( m_outputProgramSpinBox );

m_fixedOutputNoteSpinBox = new LcdSpinBox( 3, m_midiOutputGroupBox );
m_fixedOutputNoteSpinBox->setDisplayOffset( 1 );
m_fixedOutputNoteSpinBox->addTextForValue( 0, "---" );
/*: This string must be be short, its width must be less than
* width of LCD spin-box of three digits */
m_fixedOutputNoteSpinBox->setLabel( tr( "NOTE" ) );
m_fixedOutputNoteSpinBox->setEnabled( false );
midiOutputLayout->addWidget( m_fixedOutputNoteSpinBox );
Expand Down Expand Up @@ -211,6 +224,7 @@ InstrumentMiscView::InstrumentMiscView(InstrumentTrack *it, QWidget *parent) :
QHBoxLayout* masterPitchLayout = new QHBoxLayout( m_pitchGroupBox );
masterPitchLayout->setContentsMargins( 8, 18, 8, 8 );
QLabel *tlabel = new QLabel(tr( "Enables the use of master pitch" ) );
tlabel->setFont( pointSize<8>( tlabel->font() ) );
m_pitchGroupBox->setModel( &it->m_useMasterPitchModel );
masterPitchLayout->addWidget( tlabel );
layout->addStretch();
Expand Down

0 comments on commit 9895472

Please sign in to comment.