From 2cc6752c15371d87a0c8cf774515b0b44fc768d9 Mon Sep 17 00:00:00 2001 From: Mavridis Philippe Date: Sat, 16 Apr 2022 21:53:46 +0300 Subject: KMix: ported settings to TDEConfigXT/Designer This commit includes an improved Preferences dialog for KMix. It also exposes some previously hidden options and features, some of which experimental (build-time option, off by default). It also includes some minor UI improvements. Signed-off-by: Mavridis Philippe --- kmix/mdwslider.cpp | 47 +++++++++++++++++++++++------------------------ 1 file changed, 23 insertions(+), 24 deletions(-) (limited to 'kmix/mdwslider.cpp') diff --git a/kmix/mdwslider.cpp b/kmix/mdwslider.cpp index 6b4c3f51..6170992a 100644 --- a/kmix/mdwslider.cpp +++ b/kmix/mdwslider.cpp @@ -57,7 +57,7 @@ */ MDWSlider::MDWSlider(Mixer *mixer, MixDevice* md, bool showMuteLED, bool showRecordLED, - bool small, Qt::Orientation orientation, + bool small, TQt::Orientation orientation, TQWidget* parent, ViewBase* mw, const char* name) : MixDeviceWidget(mixer,md,small,orientation,parent,mw,name), m_linked(true), m_valueStyle( NNONE), m_iconLabel( 0 ), m_muteLED( 0 ), m_recordLED( 0 ), m_label( 0 ), _layout(0) @@ -96,7 +96,7 @@ MDWSlider::MDWSlider(Mixer *mixer, MixDevice* md, TQSizePolicy MDWSlider::sizePolicy() const { - if ( _orientation == Qt::Vertical ) { + if ( _orientation == TQt::Vertical ) { return TQSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Expanding ); } else { @@ -113,18 +113,17 @@ TQSizePolicy MDWSlider::sizePolicy() const */ void MDWSlider::createWidgets( bool showMuteLED, bool showRecordLED ) { - if ( _orientation == Qt::Vertical ) { - _layout = new TQVBoxLayout( this ); - _layout->setAlignment(TQt::AlignCenter); + if ( _orientation == TQt::Vertical ) { + _layout = new TQVBoxLayout( this ); } else { - _layout = new TQHBoxLayout( this ); - _layout->setAlignment(TQt::AlignCenter); + _layout = new TQHBoxLayout( this ); } + _layout->setAlignment(TQt::AlignCenter); // -- MAIN SLIDERS LAYOUT --- TQBoxLayout *slidersLayout; - if ( _orientation == Qt::Vertical ) { + if ( _orientation == TQt::Vertical ) { slidersLayout = new TQHBoxLayout( _layout ); slidersLayout->setAlignment(TQt::AlignVCenter); } @@ -136,14 +135,14 @@ void MDWSlider::createWidgets( bool showMuteLED, bool showRecordLED ) /* cesken: This is inconsistent. Why should vertical and horizontal layout differ? * Also it eats too much space - especially when you don't show sliders at all. * Even more on the vertical panel applet (see Bug #97667) - if ( _orientation == Qt::Horizontal ) + if ( _orientation == TQt::Horizontal ) slidersLayout->addSpacing( 10 ); */ // -- LABEL LAYOUT TO POSITION TQBoxLayout *labelLayout; - if ( _orientation == Qt::Vertical ) { + if ( _orientation == TQt::Vertical ) { labelLayout = new TQVBoxLayout( slidersLayout ); labelLayout->setAlignment(TQt::AlignHCenter); } @@ -151,7 +150,7 @@ void MDWSlider::createWidgets( bool showMuteLED, bool showRecordLED ) labelLayout = new TQHBoxLayout( slidersLayout ); labelLayout->setAlignment(TQt::AlignVCenter); } - if ( _orientation == Qt::Vertical ) { + if ( _orientation == TQt::Vertical ) { m_label = new VerticalText( this, m_mixdevice->name().utf8().data() ); TQToolTip::add( m_label, m_mixdevice->name() ); @@ -166,7 +165,7 @@ void MDWSlider::createWidgets( bool showMuteLED, bool showRecordLED ) /* This addSpacing() looks VERY bizarre => removing it (cesken, 21.2.2006). Also horizontal and vertical spacing differs. This doesn't look sensible. - if ( _orientation == Qt::Horizontal ) + if ( _orientation == TQt::Horizontal ) labelLayout->addSpacing( 36 ); */ labelLayout->addWidget( m_label ); @@ -174,14 +173,14 @@ void MDWSlider::createWidgets( bool showMuteLED, bool showRecordLED ) /* This addSpacing() looks VERY bizarre => removing it (cesken, 21.2.2006) Also horizontal and vertical spacing differs. This doesn't look sensible. - if ( _orientation == Qt::Vertical ) { + if ( _orientation == TQt::Vertical ) { labelLayout->addSpacing( 18 ); } */ // -- SLIDERS, LEDS AND ICON TQBoxLayout *sliLayout; - if ( _orientation == Qt::Vertical ) { + if ( _orientation == TQt::Vertical ) { sliLayout = new TQVBoxLayout( slidersLayout ); sliLayout->setAlignment(TQt::AlignHCenter); } @@ -192,7 +191,7 @@ void MDWSlider::createWidgets( bool showMuteLED, bool showRecordLED ) // --- ICON ---------------------------- TQBoxLayout *iconLayout; - if ( _orientation == Qt::Vertical ) { + if ( _orientation == TQt::Vertical ) { iconLayout = new TQHBoxLayout( sliLayout ); iconLayout->setAlignment(TQt::AlignVCenter); } @@ -214,7 +213,7 @@ void MDWSlider::createWidgets( bool showMuteLED, bool showRecordLED ) // --- MUTE LED if ( showMuteLED ) { TQBoxLayout *ledlayout; - if ( _orientation == Qt::Vertical ) { + if ( _orientation == TQt::Vertical ) { ledlayout = new TQHBoxLayout( sliLayout ); ledlayout->setAlignment(TQt::AlignVCenter); } @@ -251,7 +250,7 @@ void MDWSlider::createWidgets( bool showMuteLED, bool showRecordLED ) // --- SLIDERS --------------------------- TQBoxLayout *volLayout; - if ( _orientation == Qt::Vertical ) { + if ( _orientation == TQt::Vertical ) { volLayout = new TQHBoxLayout( sliLayout ); volLayout->setAlignment(TQt::AlignVCenter); } @@ -271,7 +270,7 @@ void MDWSlider::createWidgets( bool showMuteLED, bool showRecordLED ) int maxvol = m_mixdevice->getVolume().maxVolume(); int minvol = m_mixdevice->getVolume().minVolume(); - if ( _orientation == Qt::Vertical ) { + if ( _orientation == TQt::Vertical ) { slinumLayout = new TQVBoxLayout( volLayout ); slinumLayout->setAlignment(TQt::AlignHCenter); } @@ -328,7 +327,7 @@ void MDWSlider::createWidgets( bool showMuteLED, bool showRecordLED ) // --- LED LAYOUT TO CENTER --- TQBoxLayout *reclayout; - if ( _orientation == Qt::Vertical ) { + if ( _orientation == TQt::Vertical ) { reclayout = new TQHBoxLayout( sliLayout ); reclayout->setAlignment(TQt::AlignVCenter); } @@ -651,7 +650,7 @@ void MDWSlider::volumeChange( int ) else { TQSlider *slider = dynamic_cast(m_sliders.first()); if (slider) { - if ( _orientation == Qt::Vertical ) + if ( _orientation == TQt::Vertical ) sliderValue= slider->maxValue() - slider->value(); else sliderValue= slider->value(); @@ -691,7 +690,7 @@ void MDWSlider::volumeChange( int ) { TQSlider *bigSlider = dynamic_cast(slider); if (bigSlider) - if ( _orientation == Qt::Vertical ) + if ( _orientation == TQt::Vertical ) vol.setVolume( chid, bigSlider->maxValue() - bigSlider->value() ); else vol.setVolume( chid, bigSlider->value() ); @@ -808,7 +807,7 @@ void MDWSlider::update() // show the top of both volumes, and not strangely low down // the main volume by half - if ( _orientation == Qt::Vertical ) + if ( _orientation == TQt::Vertical ) bigSlider->setValue( vol.maxVolume() - vol.getTopStereoVolume( Volume::MMAIN ) ); else bigSlider->setValue( vol.getTopStereoVolume( Volume::MMAIN ) ); @@ -844,7 +843,7 @@ void MDWSlider::update() { TQSlider *bigSlider = dynamic_cast(slider); if (bigSlider) - if ( _orientation == Qt::Vertical ) { + if ( _orientation == TQt::Vertical ) { bigSlider->setValue( vol.maxVolume() - vol[i] ); } else { @@ -936,7 +935,7 @@ bool MDWSlider::eventFilter( TQObject* obj, TQEvent* e ) { if (e->type() == TQEvent::MouseButtonPress) { TQMouseEvent *qme = TQT_TQMOUSEEVENT(e); - if (qme->button() == Qt::RightButton) { + if (qme->button() == TQt::RightButton) { showContextMenu(); return true; } -- cgit v1.2.1