fixed alignment for mixer fader

This commit is contained in:
Volker Fischer 2006-12-09 11:17:51 +00:00
parent f3ce0f8ea2
commit d3644c447d
2 changed files with 25 additions and 12 deletions

View file

@ -336,8 +336,8 @@ for ( i = 0; i < vecChanInfo.Size(); i++ )
{ {
QHostAddress addrTest ( vecChanInfo[i].veciIpAddr ); QHostAddress addrTest ( vecChanInfo[i].veciIpAddr );
vecpChanFader[i]->Show();
vecpChanFader[i]->SetText ( addrTest.toString().latin1() ); vecpChanFader[i]->SetText ( addrTest.toString().latin1() );
vecpChanFader[i]->Show();
@ -391,9 +391,9 @@ void CLlconClientDlg::customEvent ( QCustomEvent* Event )
// Help classes --------------------------------------------------------------- // Help classes ---------------------------------------------------------------
CLlconClientDlg::CChannelFader::CChannelFader ( QWidget* pNW, CLlconClientDlg::CChannelFader::CChannelFader ( QWidget* pNW,
QHBoxLayout* pNPtLy, QHBoxLayout* pNPtLy,
QString sName ) : QString sName ) :
pParentLayout ( pNPtLy ) pParentLayout ( pNPtLy )
{ {
// create new GUI control objects and store pointers to them // create new GUI control objects and store pointers to them
@ -401,9 +401,6 @@ CLlconClientDlg::CChannelFader::CChannelFader ( QWidget* pNW,
pFader = new QSlider ( Qt::Vertical, pNW ); pFader = new QSlider ( Qt::Vertical, pNW );
pLabel = new QLabel ( "", pNW ); pLabel = new QLabel ( "", pNW );
// add slider to grid as position 0 / 0
pMainGrid->addWidget( pFader, 0, 0 );
// setup slider // setup slider
pFader->setPageStep ( 1 ); pFader->setPageStep ( 1 );
pFader->setTickmarks ( QSlider::Both ); pFader->setTickmarks ( QSlider::Both );
@ -414,17 +411,33 @@ CLlconClientDlg::CChannelFader::CChannelFader ( QWidget* pNW,
pFader->setValue ( 0 ); pFader->setValue ( 0 );
pFader->setEnabled ( FALSE ); pFader->setEnabled ( FALSE );
// add label to grid
pMainGrid->addWidget( pLabel, 1, 0 );
// set label text // set label text
pLabel->setText ( sName ); pLabel->setText ( sName );
// add slider to grid as position 0 / 0
pMainGrid->addWidget( pFader, 0, 0, Qt::AlignHCenter );
// add label to grid as position 1 / 0
pMainGrid->addWidget( pLabel, 1, 0, Qt::AlignHCenter );
pParentLayout->insertLayout ( 0, pMainGrid ); pParentLayout->insertLayout ( 0, pMainGrid );
} }
void CLlconClientDlg::CChannelFader::SetText ( const std::string sText ) void CLlconClientDlg::CChannelFader::SetText ( const std::string sText )
{ {
pLabel->setText ( sText.c_str() ); const int iBreakPos = 6;
// break text at predefined position
QString sModText = sText.c_str();
if ( sModText.length() > iBreakPos )
{
sModText.insert ( iBreakPos, QString ( "<br>" ) );
}
// use bold text
sModText.prepend ( "<b>" );
sModText.append ( "</b>" );
pLabel->setText ( sModText );
} }

View file

@ -103,7 +103,7 @@ protected:
QTimer TimerStatus; QTimer TimerStatus;
virtual void customEvent ( QCustomEvent* Event ); virtual void customEvent ( QCustomEvent* Event );
virtual void closeEvent ( QCloseEvent * Event ); virtual void closeEvent ( QCloseEvent * Event );
void UpdateDisplay(); void UpdateDisplay();
QPopupMenu* pSettingsMenu; QPopupMenu* pSettingsMenu;