-rw-r--r-- | libopie/colordialog.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libopie/colordialog.cpp b/libopie/colordialog.cpp index d46da41..b2854a6 100644 --- a/libopie/colordialog.cpp +++ b/libopie/colordialog.cpp | |||
@@ -427,100 +427,100 @@ protected: | |||
427 | private: | 427 | private: |
428 | QColor col; | 428 | QColor col; |
429 | bool mousePressed; | 429 | bool mousePressed; |
430 | QPoint pressPos; | 430 | QPoint pressPos; |
431 | 431 | ||
432 | }; | 432 | }; |
433 | 433 | ||
434 | void QColorShowLabel::drawContents( QPainter *p ) | 434 | void QColorShowLabel::drawContents( QPainter *p ) |
435 | { | 435 | { |
436 | p->fillRect( contentsRect(), col ); | 436 | p->fillRect( contentsRect(), col ); |
437 | } | 437 | } |
438 | 438 | ||
439 | void QColorShower::showAlpha( bool b ) | 439 | void QColorShower::showAlpha( bool b ) |
440 | { | 440 | { |
441 | if ( b ) { | 441 | if ( b ) { |
442 | alphaLab->show(); | 442 | alphaLab->show(); |
443 | alphaEd->show(); | 443 | alphaEd->show(); |
444 | } else { | 444 | } else { |
445 | alphaLab->hide(); | 445 | alphaLab->hide(); |
446 | alphaEd->hide(); | 446 | alphaEd->hide(); |
447 | } | 447 | } |
448 | } | 448 | } |
449 | 449 | ||
450 | void QColorShowLabel::mousePressEvent( QMouseEvent *e ) | 450 | void QColorShowLabel::mousePressEvent( QMouseEvent *e ) |
451 | { | 451 | { |
452 | mousePressed = TRUE; | 452 | mousePressed = TRUE; |
453 | pressPos = e->pos(); | 453 | pressPos = e->pos(); |
454 | } | 454 | } |
455 | 455 | ||
456 | void QColorShowLabel::mouseReleaseEvent( QMouseEvent * ) | 456 | void QColorShowLabel::mouseReleaseEvent( QMouseEvent * ) |
457 | { | 457 | { |
458 | if ( !mousePressed ) | 458 | if ( !mousePressed ) |
459 | return; | 459 | return; |
460 | mousePressed = FALSE; | 460 | mousePressed = FALSE; |
461 | } | 461 | } |
462 | 462 | ||
463 | QColorShower::QColorShower( QWidget *parent, const char *name ) | 463 | QColorShower::QColorShower( QWidget *parent, const char *name ) |
464 | :QWidget( parent, name) | 464 | :QWidget( parent, name) |
465 | { | 465 | { |
466 | curCol = qRgb( -1, -1, -1 ); | 466 | curCol = qRgb( -1, -1, -1 ); |
467 | QColIntValidator *val256 = new QColIntValidator( 0, 255, this ); | 467 | QColIntValidator *val256 = new QColIntValidator( 0, 255, this ); |
468 | QColIntValidator *val360 = new QColIntValidator( 0, 360, this ); | 468 | QColIntValidator *val360 = new QColIntValidator( 0, 360, this ); |
469 | 469 | ||
470 | QGridLayout *gl = new QGridLayout( this, 1, 1, 2 ); | 470 | QGridLayout *gl = new QGridLayout( this, 1, 1, 2 ); |
471 | gl->setMargin( 0 ); | 471 | gl->setMargin( 0 ); |
472 | lab = new QColorShowLabel( this ); | 472 | lab = new QColorShowLabel( this ); |
473 | lab->setMinimumWidth( 60 ); //### | 473 | lab->setMinimumWidth( 60 ); //### |
474 | gl->addMultiCellWidget(lab, 0,-1,0,0); | 474 | gl->addMultiCellWidget(lab, 0,-1,0,0); |
475 | connect( lab, SIGNAL( colorDropped( QRgb ) ), | 475 | connect( lab, SIGNAL( colorDropped(QRgb) ), |
476 | this, SIGNAL( newCol( QRgb ) ) ); | 476 | this, SIGNAL( newCol(QRgb) ) ); |
477 | connect( lab, SIGNAL( colorDropped( QRgb ) ), | 477 | connect( lab, SIGNAL( colorDropped(QRgb) ), |
478 | this, SLOT( setRgb( QRgb ) ) ); | 478 | this, SLOT( setRgb(QRgb) ) ); |
479 | 479 | ||
480 | hEd = new QColNumLineEdit( this ); | 480 | hEd = new QColNumLineEdit( this ); |
481 | hEd->setValidator( val360 ); | 481 | hEd->setValidator( val360 ); |
482 | QLabel *l = new QLabel( hEd, OColorDialog::tr("Hue:"), this ); | 482 | QLabel *l = new QLabel( hEd, OColorDialog::tr("Hue:"), this ); |
483 | l->setAlignment( AlignRight|AlignVCenter ); | 483 | l->setAlignment( AlignRight|AlignVCenter ); |
484 | gl->addWidget( l, 0, 1 ); | 484 | gl->addWidget( l, 0, 1 ); |
485 | gl->addWidget( hEd, 0, 2 ); | 485 | gl->addWidget( hEd, 0, 2 ); |
486 | 486 | ||
487 | sEd = new QColNumLineEdit( this ); | 487 | sEd = new QColNumLineEdit( this ); |
488 | sEd->setValidator( val256 ); | 488 | sEd->setValidator( val256 ); |
489 | l = new QLabel( sEd, OColorDialog::tr("Sat:"), this ); | 489 | l = new QLabel( sEd, OColorDialog::tr("Sat:"), this ); |
490 | l->setAlignment( AlignRight|AlignVCenter ); | 490 | l->setAlignment( AlignRight|AlignVCenter ); |
491 | gl->addWidget( l, 1, 1 ); | 491 | gl->addWidget( l, 1, 1 ); |
492 | gl->addWidget( sEd, 1, 2 ); | 492 | gl->addWidget( sEd, 1, 2 ); |
493 | 493 | ||
494 | vEd = new QColNumLineEdit( this ); | 494 | vEd = new QColNumLineEdit( this ); |
495 | vEd->setValidator( val256 ); | 495 | vEd->setValidator( val256 ); |
496 | l = new QLabel( vEd, OColorDialog::tr("Val:"), this ); | 496 | l = new QLabel( vEd, OColorDialog::tr("Val:"), this ); |
497 | l->setAlignment( AlignRight|AlignVCenter ); | 497 | l->setAlignment( AlignRight|AlignVCenter ); |
498 | gl->addWidget( l, 2, 1 ); | 498 | gl->addWidget( l, 2, 1 ); |
499 | gl->addWidget( vEd, 2, 2 ); | 499 | gl->addWidget( vEd, 2, 2 ); |
500 | 500 | ||
501 | rEd = new QColNumLineEdit( this ); | 501 | rEd = new QColNumLineEdit( this ); |
502 | rEd->setValidator( val256 ); | 502 | rEd->setValidator( val256 ); |
503 | l = new QLabel( rEd, OColorDialog::tr("Red:"), this ); | 503 | l = new QLabel( rEd, OColorDialog::tr("Red:"), this ); |
504 | l->setAlignment( AlignRight|AlignVCenter ); | 504 | l->setAlignment( AlignRight|AlignVCenter ); |
505 | gl->addWidget( l, 0, 3 ); | 505 | gl->addWidget( l, 0, 3 ); |
506 | gl->addWidget( rEd, 0, 4 ); | 506 | gl->addWidget( rEd, 0, 4 ); |
507 | 507 | ||
508 | gEd = new QColNumLineEdit( this ); | 508 | gEd = new QColNumLineEdit( this ); |
509 | gEd->setValidator( val256 ); | 509 | gEd->setValidator( val256 ); |
510 | l = new QLabel( gEd, OColorDialog::tr("Green:"), this ); | 510 | l = new QLabel( gEd, OColorDialog::tr("Green:"), this ); |
511 | l->setAlignment( AlignRight|AlignVCenter ); | 511 | l->setAlignment( AlignRight|AlignVCenter ); |
512 | gl->addWidget( l, 1, 3 ); | 512 | gl->addWidget( l, 1, 3 ); |
513 | gl->addWidget( gEd, 1, 4 ); | 513 | gl->addWidget( gEd, 1, 4 ); |
514 | 514 | ||
515 | bEd = new QColNumLineEdit( this ); | 515 | bEd = new QColNumLineEdit( this ); |
516 | bEd->setValidator( val256 ); | 516 | bEd->setValidator( val256 ); |
517 | l = new QLabel( bEd, OColorDialog::tr("Blue:"), this ); | 517 | l = new QLabel( bEd, OColorDialog::tr("Blue:"), this ); |
518 | l->setAlignment( AlignRight|AlignVCenter ); | 518 | l->setAlignment( AlignRight|AlignVCenter ); |
519 | gl->addWidget( l, 2, 3 ); | 519 | gl->addWidget( l, 2, 3 ); |
520 | gl->addWidget( bEd, 2, 4 ); | 520 | gl->addWidget( bEd, 2, 4 ); |
521 | 521 | ||
522 | alphaEd = new QColNumLineEdit( this ); | 522 | alphaEd = new QColNumLineEdit( this ); |
523 | alphaEd->setValidator( val256 ); | 523 | alphaEd->setValidator( val256 ); |
524 | alphaLab = new QLabel( alphaEd, OColorDialog::tr("Alpha channel:"), this ); | 524 | alphaLab = new QLabel( alphaEd, OColorDialog::tr("Alpha channel:"), this ); |
525 | alphaLab->setAlignment( AlignRight|AlignVCenter ); | 525 | alphaLab->setAlignment( AlignRight|AlignVCenter ); |
526 | gl->addMultiCellWidget( alphaLab, 3, 3, 1, 3 ); | 526 | gl->addMultiCellWidget( alphaLab, 3, 3, 1, 3 ); |