-rw-r--r-- | core/applets/volumeapplet/volume.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/core/applets/volumeapplet/volume.cpp b/core/applets/volumeapplet/volume.cpp index 23c847d..11ba2f6 100644 --- a/core/applets/volumeapplet/volume.cpp +++ b/core/applets/volumeapplet/volume.cpp | |||
@@ -259,40 +259,43 @@ VolumeControl::VolumeControl ( VolumeApplet *icon, bool /*showMic*/, QWidget *pa | |||
259 | 259 | ||
260 | setFrameStyle ( QFrame::PopupPanel | QFrame::Raised ); | 260 | setFrameStyle ( QFrame::PopupPanel | QFrame::Raised ); |
261 | 261 | ||
262 | QGridLayout *grid = new QGridLayout ( this, 1, 1, 6, 4 ); | 262 | QGridLayout *grid = new QGridLayout ( this, 1, 1, 6, 4 ); |
263 | grid-> setSpacing ( 4 ); | 263 | grid-> setSpacing ( 4 ); |
264 | grid-> setMargin ( 6 ); | 264 | grid-> setMargin ( 6 ); |
265 | 265 | ||
266 | QVBoxLayout *vbox; | 266 | QVBoxLayout *vbox; |
267 | QLabel *l; | 267 | QLabel *l; |
268 | 268 | ||
269 | vbox = new QVBoxLayout ( ); | 269 | vbox = new QVBoxLayout ( ); |
270 | vbox-> setSpacing ( 4 ); | 270 | vbox-> setSpacing ( 4 ); |
271 | grid-> addLayout ( vbox, 1, 0 ); | 271 | grid-> addLayout ( vbox, 1, 0 ); |
272 | 272 | ||
273 | upButton = new QPushButton ( this ); | 273 | upButton = new QPushButton ( this ); |
274 | upButton-> setSizePolicy ( QSizePolicy ( QSizePolicy::Minimum, QSizePolicy::Expanding )); | 274 | upButton-> setSizePolicy ( QSizePolicy ( QSizePolicy::Minimum, QSizePolicy::Expanding )); |
275 | upButton-> setPixmap ( Resource::loadPixmap ( "up" )); | 275 | QPixmap pic; |
276 | pic.convertFromImage( Resource::loadImage( "up" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); | ||
277 | upButton-> setPixmap ( pic ); | ||
276 | upButton-> setFocusPolicy ( QWidget::NoFocus ); | 278 | upButton-> setFocusPolicy ( QWidget::NoFocus ); |
277 | 279 | ||
278 | vbox-> addWidget ( upButton ); | 280 | vbox-> addWidget ( upButton ); |
279 | 281 | ||
280 | downButton = new QPushButton ( this ); | 282 | downButton = new QPushButton ( this ); |
281 | downButton-> setSizePolicy ( QSizePolicy ( QSizePolicy::Minimum, QSizePolicy::Expanding )); | 283 | downButton-> setSizePolicy ( QSizePolicy ( QSizePolicy::Minimum, QSizePolicy::Expanding )); |
282 | downButton-> setPixmap ( Resource::loadPixmap ( "down" )); | 284 | pic.convertFromImage( Resource::loadImage( "down" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); |
285 | downButton-> setPixmap ( pic ); | ||
283 | downButton-> setFocusPolicy ( QWidget::NoFocus ); | 286 | downButton-> setFocusPolicy ( QWidget::NoFocus ); |
284 | 287 | ||
285 | vbox-> addWidget ( downButton ); | 288 | vbox-> addWidget ( downButton ); |
286 | 289 | ||
287 | volSlider = new QSlider ( this ); | 290 | volSlider = new QSlider ( this ); |
288 | volSlider-> setRange ( 0, 100 ); | 291 | volSlider-> setRange ( 0, 100 ); |
289 | volSlider-> setTickmarks ( QSlider::Both ); | 292 | volSlider-> setTickmarks ( QSlider::Both ); |
290 | volSlider-> setTickInterval ( 20 ); | 293 | volSlider-> setTickInterval ( 20 ); |
291 | volSlider-> setFocusPolicy ( QWidget::NoFocus ); | 294 | volSlider-> setFocusPolicy ( QWidget::NoFocus ); |
292 | 295 | ||
293 | l = new QLabel ( this ); | 296 | l = new QLabel ( this ); |
294 | l-> setPixmap ( QPixmap ( vol_xpm )); | 297 | l-> setPixmap ( QPixmap ( vol_xpm )); |
295 | 298 | ||
296 | grid-> addWidget ( l, 0, 1, AlignCenter ); | 299 | grid-> addWidget ( l, 0, 1, AlignCenter ); |
297 | grid-> addWidget ( volSlider, 1, 1, AlignCenter ); | 300 | grid-> addWidget ( volSlider, 1, 1, AlignCenter ); |
298 | 301 | ||
@@ -711,33 +714,35 @@ void VolumeControl::writeConfigEntry ( const char *entry, int val, eUpdate upd ) | |||
711 | } | 714 | } |
712 | 715 | ||
713 | case UPD_None: | 716 | case UPD_None: |
714 | break; | 717 | break; |
715 | } | 718 | } |
716 | #endif | 719 | #endif |
717 | } | 720 | } |
718 | 721 | ||
719 | //=========================================================================== | 722 | //=========================================================================== |
720 | 723 | ||
721 | VolumeApplet::VolumeApplet( QWidget *parent, const char *name ) | 724 | VolumeApplet::VolumeApplet( QWidget *parent, const char *name ) |
722 | : QWidget( parent, name ) | 725 | : QWidget( parent, name ) |
723 | { | 726 | { |
724 | setFixedWidth ( AppLnk::smallIconSize() ); | 727 | setFixedWidth ( AppLnk::smallIconSize() ); |
725 | setFixedHeight ( AppLnk::smallIconSize()+4 ); | 728 | setFixedHeight ( AppLnk::smallIconSize()+4 ); |
726 | 729 | ||
727 | m_pixmap = new QPixmap ( Resource::loadPixmap ( "volume" )); | 730 | QPixmap pic; |
731 | pic.convertFromImage( Resource::loadImage( "volume" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); | ||
732 | m_pixmap = new QPixmap ( pic ); | ||
728 | m_dialog = new VolumeControl ( this, true, this, "volumecontrol" ); | 733 | m_dialog = new VolumeControl ( this, true, this, "volumecontrol" ); |
729 | 734 | ||
730 | connect ( qApp, SIGNAL( volumeChanged(bool)), m_dialog, SLOT( volumeChanged(bool))); | 735 | connect ( qApp, SIGNAL( volumeChanged(bool)), m_dialog, SLOT( volumeChanged(bool))); |
731 | connect ( qApp, SIGNAL( micChanged(bool)), m_dialog, SLOT ( micChanged(bool))); | 736 | connect ( qApp, SIGNAL( micChanged(bool)), m_dialog, SLOT ( micChanged(bool))); |
732 | } | 737 | } |
733 | 738 | ||
734 | VolumeApplet::~VolumeApplet() | 739 | VolumeApplet::~VolumeApplet() |
735 | { | 740 | { |
736 | delete m_pixmap; | 741 | delete m_pixmap; |
737 | } | 742 | } |
738 | 743 | ||
739 | int VolumeApplet::position() | 744 | int VolumeApplet::position() |
740 | { | 745 | { |
741 | return 6; | 746 | return 6; |
742 | } | 747 | } |
743 | 748 | ||