Summary: | icons ruin vertical panel applet usability | ||
---|---|---|---|
Product: | [Applications] kmix | Reporter: | amrit <amrit> |
Component: | Obsolete component. Do NOT use!!! (ex: KMix Panel Applet). | Assignee: | Christian Esken <esken> |
Status: | RESOLVED FIXED | ||
Severity: | minor | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Slackware | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
amrit
2005-01-22 19:19:59 UTC
Oh sorry, I suppose I should have noted what I'd like to see happen, as well. IMHO 3.3.1's behavior of no icons and no padding was perfectly fine. Use the tooltips to find out which channels you want, hide the rest, and then it's set that way forever, so no need for icons or anything. I can confirm that behaviour. I have checked the situation, and it seems to be a Kicker/Panel problem. It tells me it is 36 pixels wide, when it is only 24 pixels. The "vertical padding" problem is now fixed. The "icon" problem unfortunately not. I finally found the source of the "icon" problem ... YEAH !!! Somebody put a "spacing" of 36 in the geometry manager, but ONLY in vertical mode. This was a REALLY bad idea!!! The fix will remove all of the the spacing. The fixed version will ship with KDE3.5.2 . In the KDE4 branch this has already been removed 6 months ago during a general source code cleanup session. SVN commit 512112 by esken: Fix the "icons ruin vertical panel applet usability" issue. Fix the "Split channel in kmix applet shows one channel as a slider, the other numerical" issue. BUGS: 122114 BUGS: 97666 M +11 -2 mdwslider.cpp M +25 -11 viewapplet.cpp M +3 -0 viewapplet.h --- branches/KDE/3.5/kdemultimedia/kmix/mdwslider.cpp #512111:512112 @@ -121,7 +121,6 @@ _layout = new QHBoxLayout( this ); _layout->setAlignment(Qt::AlignCenter); } - QToolTip::add( this, m_mixdevice->name() ); // -- MAIN SLIDERS LAYOUT --- QBoxLayout *slidersLayout; @@ -154,22 +153,31 @@ } if ( _orientation == Qt::Vertical ) { m_label = new VerticalText( this, m_mixdevice->name().utf8().data() ); + QToolTip::add( m_label, m_mixdevice->name() ); + } else { m_label = new QLabel(this); static_cast<QLabel*>(m_label) ->setText(m_mixdevice->name()); + QToolTip::add( m_label, m_mixdevice->name() ); } m_label->hide(); + +/* 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 ) labelLayout->addSpacing( 36 ); - +*/ labelLayout->addWidget( m_label ); m_label->installEventFilter( this ); +/* 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 ) { labelLayout->addSpacing( 18 ); } +*/ // -- SLIDERS, LEDS AND ICON QBoxLayout *sliLayout; @@ -300,6 +308,7 @@ } slider->installEventFilter( this ); + QToolTip::add( slider, m_mixdevice->name() ); if( i>0 && isStereoLinked() ) { // show only one (the first) slider, when the user wants it so --- branches/KDE/3.5/kdemultimedia/kmix/viewapplet.cpp #512111:512112 @@ -23,6 +23,7 @@ // Qt #include <qwidget.h> #include <qlayout.h> +#include <qsize.h> // KDE #include <kactioncollection.h> @@ -31,6 +32,7 @@ #include <kstdaction.h> // KMix +#include "kmixtoolbox.h" #include "mdwslider.h" #include "mixer.h" @@ -120,12 +122,17 @@ this, // View widget md->name().latin1() ); + static_cast<MDWSlider*>(mdw)->setValueStyle(MixDeviceWidget::NNONE); + static_cast<MDWSlider*>(mdw)->setIcons(shouldShowIcons( size()) ); // !!! This should use the panel size _layoutMDW->add(mdw); return mdw; } void ViewApplet::constructionFinished() { _layoutMDW->activate(); + + KMixToolBox::setIcons ( _mdws, shouldShowIcons( size()) ); // !!! This should use the panel size + KMixToolBox::setValueStyle( _mdws, MixDeviceWidget::NNONE); } @@ -147,24 +154,29 @@ } } - -void ViewApplet::resizeEvent(QResizeEvent *qre) -{ - //kdDebug(67100) << "ViewApplet::resizeEvent() size=" << qre->size() << "\n"; - // decide whether we have to show or hide all icons +bool ViewApplet::shouldShowIcons(QSize qsz) { bool showIcons = false; if ( _viewOrientation == Qt::Horizontal ) { - if ( qre->size().height() >= 32 ) { - //kdDebug(67100) << "ViewApplet::resizeEvent() hor >=32" << qre->size() << "\n"; - showIcons = true; - } + if ( qsz.height() >= 32 ) { + //kdDebug(67100) << "ViewApplet::resizeEvent() hor >=32" << qre->size() << "\n"; + showIcons = true; + } } else { - if ( qre->size().width() >= 32 ) { + if ( qsz.width() >= 32 ) { //kdDebug(67100) << "ViewApplet::resizeEvent() vert >=32" << qre->size() << "\n"; showIcons = true; } } + return showIcons; +} + +void ViewApplet::resizeEvent(QResizeEvent *qre) +{ + //kdDebug(67100) << "ViewApplet::resizeEvent() size=" << qre->size() << "\n"; + // decide whether we have to show or hide all icons + bool showIcons = shouldShowIcons(qre->size()); + for ( QWidget *mdw = _mdws.first(); mdw != 0; mdw = _mdws.next() ) { if ( mdw == 0 ) { kdError(67100) << "ViewApplet::resizeEvent(): mdw == 0\n"; @@ -173,6 +185,7 @@ else { if ( mdw->inherits("MDWSlider")) { static_cast<MDWSlider*>(mdw)->setIcons(showIcons); + static_cast<MDWSlider*>(mdw)->setValueStyle(MixDeviceWidget::NNONE); //static_cast<MDWSlider*>(mdw)->resize(qre->size()); } } @@ -213,7 +226,8 @@ void ViewApplet::configurationUpdate() { updateGeometry(); - _layoutMDW->activate(); + //_layoutMDW->activate(); + constructionFinished(); // contains "_layoutMDW->activate();" emit appletContentChanged(); kdDebug(67100) << "ViewApplet::configurationUpdate()" << endl; // the following "emit" is only here to be picked up by KMixApplet, because it has to --- branches/KDE/3.5/kdemultimedia/kmix/viewapplet.h #512111:512112 @@ -6,6 +6,8 @@ class QBoxLayout; class QHBox; +class QSize; + class Mixer; class ViewApplet : public ViewBase @@ -33,6 +35,7 @@ virtual void refreshVolumeLevels(); private: + bool shouldShowIcons(QSize); QBoxLayout* _layoutMDW; // Position of the applet (pLeft, pRight, pTop, pBottom) //KPanelApplet::Position _KMIXposition; On Tuesday 21 February 2006 12:44, Christian Esken wrote: [bugs.kde.org quoted mail] Wow! I thought this bug ended up in /dev/null.. I had resorted to using the horizontal panel again. Great to hear that this is fixed though, KDE rocks because of people like you. :) |