author | llornkcor <llornkcor> | 2005-08-12 02:00:00 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2005-08-12 02:00:00 (UTC) |
commit | 374d60dacd347a947d5833b21cd73793ffb057ca (patch) (unidiff) | |
tree | d63f544aaec56e58c8b8d37675d8170166aaaa9e | |
parent | a1b3e5bac75575be3e22b7361d7a4820761403c1 (diff) | |
download | opie-374d60dacd347a947d5833b21cd73793ffb057ca.zip opie-374d60dacd347a947d5833b21cd73793ffb057ca.tar.gz opie-374d60dacd347a947d5833b21cd73793ffb057ca.tar.bz2 |
revert but leave in new stuff
-rw-r--r-- | noncore/applets/volumeapplet2/volumeapplet.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/noncore/applets/volumeapplet2/volumeapplet.cpp b/noncore/applets/volumeapplet2/volumeapplet.cpp index 2122007..946616f 100644 --- a/noncore/applets/volumeapplet2/volumeapplet.cpp +++ b/noncore/applets/volumeapplet2/volumeapplet.cpp | |||
@@ -150,61 +150,64 @@ void VolumeAppletControl::hideEvent( QHideEvent* e ) | |||
150 | 150 | ||
151 | VolumeApplet::VolumeApplet( QWidget *parent, const char *name ) | 151 | VolumeApplet::VolumeApplet( QWidget *parent, const char *name ) |
152 | :OTaskbarApplet( parent, name ) | 152 | :OTaskbarApplet( parent, name ) |
153 | { | 153 | { |
154 | setFixedHeight( AppLnk::smallIconSize() +4); | 154 | setFixedHeight( AppLnk::smallIconSize() +4); |
155 | setFixedWidth( AppLnk::smallIconSize() ); | 155 | setFixedWidth( AppLnk::smallIconSize() ); |
156 | _pixmap = new QPixmap (Opie::Core::OResource::loadPixmap( "volume", Opie::Core::OResource::SmallIcon )); | 156 | _pixmap = new QPixmap (Opie::Core::OResource::loadPixmap( "volume", Opie::Core::OResource::SmallIcon )); |
157 | _control = new VolumeAppletControl( this, "control" ); | 157 | _control = new VolumeAppletControl( this, "control" ); |
158 | } | 158 | } |
159 | 159 | ||
160 | 160 | ||
161 | VolumeApplet::~VolumeApplet() | 161 | VolumeApplet::~VolumeApplet() |
162 | { | 162 | { |
163 | } | 163 | } |
164 | 164 | ||
165 | 165 | ||
166 | int VolumeApplet::position() | 166 | int VolumeApplet::position() |
167 | { | 167 | { |
168 | return 4; | 168 | return 4; |
169 | } | 169 | } |
170 | 170 | ||
171 | 171 | ||
172 | void VolumeApplet::paintEvent( QPaintEvent* ) | 172 | void VolumeApplet::paintEvent( QPaintEvent* ) |
173 | { | 173 | { |
174 | QPainter p ( this ); | 174 | QPainter p(this); |
175 | p.drawPixmap(0, 2, _pixmap ); | ||
175 | 176 | ||
177 | /* | ||
176 | p. drawPixmap ( (width()- _pixmap->width())/2, QMAX( (height()-4-_pixmap->height() )/2, 1), *_pixmap ); | 178 | p. drawPixmap ( (width()- _pixmap->width())/2, QMAX( (height()-4-_pixmap->height() )/2, 1), *_pixmap ); |
177 | p. setPen ( darkGray ); | 179 | p. setPen ( darkGray ); |
178 | p. drawRect ( 1, height() - 4, width() - 2, 4 ); | 180 | p. drawRect ( 1, height() - 4, width() - 2, 4 ); |
179 | 181 | ||
180 | OMixerInterface* mixer = new OMixerInterface( this, "/dev/mixer" ); | 182 | OMixerInterface* mixer = new OMixerInterface( this, "/dev/mixer" ); |
181 | 183 | ||
182 | int volPercent = mixer->volume( "Vol" ) >> 8; | 184 | int volPercent = mixer->volume( "Vol" ) >> 8; |
183 | 185 | ||
184 | int pixelsWide = volPercent * ( width() - 4 ) / 100; | 186 | int pixelsWide = volPercent * ( width() - 4 ) / 100; |
185 | p. fillRect ( 2, height() - 3, pixelsWide, 2, red ); | 187 | p. fillRect ( 2, height() - 3, pixelsWide, 2, red ); |
186 | p. fillRect ( pixelsWide + 2, height() - 3, width() - 4 - pixelsWide, 2, lightGray ); | 188 | p. fillRect ( pixelsWide + 2, height() - 3, width() - 4 - pixelsWide, 2, lightGray ); |
189 | */ | ||
187 | 190 | ||
188 | // if ( _control-> volMuted ( )) { | 191 | // if ( _control-> volMuted ( )) { |
189 | // p. setPen ( red ); | 192 | // p. setPen ( red ); |
190 | // p. drawLine ( 1, 2, width() - 2, height() - 5 ); | 193 | // p. drawLine ( 1, 2, width() - 2, height() - 5 ); |
191 | // p. drawLine ( 1, 3, width() - 2, height() - 4 ); | 194 | // p. drawLine ( 1, 3, width() - 2, height() - 4 ); |
192 | // p. drawLine ( width() - 2, 2, 1, height() - 5 ); | 195 | // p. drawLine ( width() - 2, 2, 1, height() - 5 ); |
193 | // p. drawLine ( width() - 2, 3, 1, height() - 4 ); | 196 | // p. drawLine ( width() - 2, 3, 1, height() - 4 ); |
194 | // } | 197 | // } |
195 | 198 | ||
196 | // QPainter p(this); | 199 | // QPainter p(this); |
197 | // p.drawPixmap(0, 2, _pixmap ); | 200 | // p.drawPixmap(0, 2, _pixmap ); |
198 | } | 201 | } |
199 | 202 | ||
200 | 203 | ||
201 | void VolumeApplet::mousePressEvent( QMouseEvent* ) | 204 | void VolumeApplet::mousePressEvent( QMouseEvent* ) |
202 | { | 205 | { |
203 | if ( !_control->isVisible() ) | 206 | if ( !_control->isVisible() ) |
204 | { | 207 | { |
205 | popup( _control ); | 208 | popup( _control ); |
206 | } | 209 | } |
207 | else | 210 | else |
208 | { | 211 | { |
209 | _control->hide(); | 212 | _control->hide(); |
210 | } | 213 | } |