summaryrefslogtreecommitdiff
path: root/core
authordeller <deller>2005-04-01 22:46:30 (UTC)
committer deller <deller>2005-04-01 22:46:30 (UTC)
commit88cc0cc17864de6e36bdeedaae6df0a5cc738c5a (patch) (unidiff)
treeae0b24a579e940e6d508821dd98ee0edf2c95c03 /core
parentcc4594a5c8d45d2f8d14c6ac1723a8ed39577f8f (diff)
downloadopie-88cc0cc17864de6e36bdeedaae6df0a5cc738c5a.zip
opie-88cc0cc17864de6e36bdeedaae6df0a5cc738c5a.tar.gz
opie-88cc0cc17864de6e36bdeedaae6df0a5cc738c5a.tar.bz2
show the popups inside the visible screen
Diffstat (limited to 'core') (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/volumeapplet/volume.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/applets/volumeapplet/volume.cpp b/core/applets/volumeapplet/volume.cpp
index 11ba2f6..7f0aca5 100644
--- a/core/applets/volumeapplet/volume.cpp
+++ b/core/applets/volumeapplet/volume.cpp
@@ -470,97 +470,97 @@ void VolumeControl::keyPressEvent ( QKeyEvent *e )
470 switch ( e-> key ( )) { 470 switch ( e-> key ( )) {
471 case Key_Up: 471 case Key_Up:
472 volSlider-> subtractStep ( ); 472 volSlider-> subtractStep ( );
473 break; 473 break;
474 case Key_Down: 474 case Key_Down:
475 volSlider-> addStep ( ); 475 volSlider-> addStep ( );
476 break; 476 break;
477 case Key_Space: 477 case Key_Space:
478 volLed-> toggle ( ); 478 volLed-> toggle ( );
479 break; 479 break;
480 case Key_Escape: 480 case Key_Escape:
481 hide ( ); 481 hide ( );
482 break; 482 break;
483 } 483 }
484} 484}
485 485
486void VolumeControl::buttonChanged ( ) 486void VolumeControl::buttonChanged ( )
487{ 487{
488 if ( upButton-> isDown ( ) || downButton->isDown ( )) { 488 if ( upButton-> isDown ( ) || downButton->isDown ( )) {
489 rateTimerDone ( ); // Call it one time manually, otherwise it wont get 489 rateTimerDone ( ); // Call it one time manually, otherwise it wont get
490 // called at all when a button is pressed for a time 490 // called at all when a button is pressed for a time
491 // shorter than RATE_TIMER_INTERVAL. 491 // shorter than RATE_TIMER_INTERVAL.
492 rateTimer-> start ( RATE_TIMER_INTERVAL, false ); 492 rateTimer-> start ( RATE_TIMER_INTERVAL, false );
493 } 493 }
494 else 494 else
495 rateTimer-> stop ( ); 495 rateTimer-> stop ( );
496} 496}
497 497
498void VolumeControl::rateTimerDone ( ) 498void VolumeControl::rateTimerDone ( )
499{ 499{
500 if ( upButton-> isDown ( )) 500 if ( upButton-> isDown ( ))
501 volSlider-> setValue ( volSlider-> value ( ) - 2 ); 501 volSlider-> setValue ( volSlider-> value ( ) - 2 );
502 else // if ( downButton-> isDown ( )) 502 else // if ( downButton-> isDown ( ))
503 volSlider-> setValue ( volSlider-> value ( ) + 2 ); 503 volSlider-> setValue ( volSlider-> value ( ) + 2 );
504} 504}
505 505
506void VolumeControl::show ( bool /*showMic*/ ) 506void VolumeControl::show ( bool /*showMic*/ )
507{ 507{
508 readConfig ( ); 508 readConfig ( );
509 509
510 QPoint curPos = m_icon-> mapToGlobal ( QPoint ( 0, 0 )); 510 QPoint curPos = m_icon-> mapToGlobal ( QPoint ( 0, 0 ));
511 511
512 int w = sizeHint ( ). width ( ); 512 int w = sizeHint ( ). width ( );
513 int x = curPos.x ( ) - ( w / 2 ); 513 int x = curPos.x ( ) - ( w / 2 );
514 514
515 if (( x + w ) > QPEApplication::desktop ( )-> width ( )) 515 if (( x + w ) > QPEApplication::desktop ( )-> width ( ))
516 x = QPEApplication::desktop ( )-> width ( ) - w; 516 x = QPEApplication::desktop ( )-> width ( ) - w;
517 517
518 move ( x, curPos. y ( ) - sizeHint ( ). height ( )); 518 move ( QMAX(x,0), curPos. y ( ) - sizeHint ( ). height ( ));
519 QFrame::show ( ); 519 QFrame::show ( );
520 520
521} 521}
522 522
523void VolumeControl::readConfig ( bool force ) 523void VolumeControl::readConfig ( bool force )
524{ 524{
525 Config cfg ( "qpe" ); 525 Config cfg ( "qpe" );
526 cfg. setGroup ( "Volume" ); 526 cfg. setGroup ( "Volume" );
527 527
528 int old_vp = m_vol_percent; 528 int old_vp = m_vol_percent;
529 int old_mp = m_mic_percent; 529 int old_mp = m_mic_percent;
530 int old_bass = m_bass_percent; 530 int old_bass = m_bass_percent;
531 int old_treble = m_treble_percent; 531 int old_treble = m_treble_percent;
532 bool old_vm = m_vol_muted; 532 bool old_vm = m_vol_muted;
533 bool old_mm = m_mic_muted; 533 bool old_mm = m_mic_muted;
534 bool old_sk = m_snd_key; 534 bool old_sk = m_snd_key;
535 bool old_st = m_snd_touch; 535 bool old_st = m_snd_touch;
536 bool old_sa = m_snd_alarm; 536 bool old_sa = m_snd_alarm;
537 int old_ap = m_alarm_percent; 537 int old_ap = m_alarm_percent;
538 538
539 m_vol_percent = cfg. readNumEntry ( "VolumePercent", 50 ); 539 m_vol_percent = cfg. readNumEntry ( "VolumePercent", 50 );
540 m_mic_percent = cfg. readNumEntry ( "Mic", 50 ); 540 m_mic_percent = cfg. readNumEntry ( "Mic", 50 );
541 m_bass_percent = cfg. readNumEntry ( "BassPercent", 50 ); 541 m_bass_percent = cfg. readNumEntry ( "BassPercent", 50 );
542 m_treble_percent = cfg. readNumEntry ( "TreblePercent", 50 ); 542 m_treble_percent = cfg. readNumEntry ( "TreblePercent", 50 );
543 m_vol_muted = cfg. readBoolEntry ( "Mute", 0 ); 543 m_vol_muted = cfg. readBoolEntry ( "Mute", 0 );
544 m_mic_muted = cfg. readBoolEntry ( "MicMute", 0 ); 544 m_mic_muted = cfg. readBoolEntry ( "MicMute", 0 );
545 m_snd_key = cfg. readBoolEntry ( "KeySound", 0 ); 545 m_snd_key = cfg. readBoolEntry ( "KeySound", 0 );
546 m_snd_touch = cfg. readBoolEntry ( "TouchSound", 0 ); 546 m_snd_touch = cfg. readBoolEntry ( "TouchSound", 0 );
547 m_snd_alarm = cfg. readBoolEntry ( "AlarmSound", 1 ); 547 m_snd_alarm = cfg. readBoolEntry ( "AlarmSound", 1 );
548 m_alarm_percent = cfg. readNumEntry ( "AlarmPercent", 65 ); 548 m_alarm_percent = cfg. readNumEntry ( "AlarmPercent", 65 );
549 549
550 if ( force || ( m_vol_percent != old_vp )) 550 if ( force || ( m_vol_percent != old_vp ))
551 volSlider-> setValue ( 100 - m_vol_percent ); 551 volSlider-> setValue ( 100 - m_vol_percent );
552 if ( force || ( m_mic_percent != old_mp )) 552 if ( force || ( m_mic_percent != old_mp ))
553 micSlider-> setValue ( 100 - m_mic_percent ); 553 micSlider-> setValue ( 100 - m_mic_percent );
554 if ( force || ( m_alarm_percent != old_ap )) 554 if ( force || ( m_alarm_percent != old_ap ))
555 alarmSlider-> setValue ( 100 - m_alarm_percent ); 555 alarmSlider-> setValue ( 100 - m_alarm_percent );
556 if ( force || ( m_bass_percent != old_bass )) 556 if ( force || ( m_bass_percent != old_bass ))
557 bassSlider-> setValue ( 100 - m_bass_percent ); 557 bassSlider-> setValue ( 100 - m_bass_percent );
558 if ( force || ( m_treble_percent != old_treble )) 558 if ( force || ( m_treble_percent != old_treble ))
559 trebleSlider-> setValue ( 100 - m_treble_percent ); 559 trebleSlider-> setValue ( 100 - m_treble_percent );
560 560
561 561
562 if ( force || ( m_vol_muted != old_vm )) 562 if ( force || ( m_vol_muted != old_vm ))
563 volLed-> setOn ( !m_vol_muted ); 563 volLed-> setOn ( !m_vol_muted );
564 if ( force || ( m_mic_muted != old_mm )) 564 if ( force || ( m_mic_muted != old_mm ))
565 micLed-> setOn ( !m_mic_muted ); 565 micLed-> setOn ( !m_mic_muted );
566 if ( force || ( m_snd_alarm != old_sa )) 566 if ( force || ( m_snd_alarm != old_sa ))