-rw-r--r-- | libopie/colordialog.cpp | 56 | ||||
-rw-r--r-- | libopie/colordialog.h | 22 | ||||
-rw-r--r-- | libopie/colorpopupmenu.cpp | 2 |
3 files changed, 40 insertions, 40 deletions
diff --git a/libopie/colordialog.cpp b/libopie/colordialog.cpp index 6d72ff6..684d6ea 100644 --- a/libopie/colordialog.cpp +++ b/libopie/colordialog.cpp | |||
@@ -1,8 +1,8 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | ** $Id$ | 2 | ** $Id$ |
3 | ** | 3 | ** |
4 | ** Implementation of QColorDialog class | 4 | ** Implementation of OColorDialog class |
5 | ** | 5 | ** |
6 | ** Created : 990222 | 6 | ** Created : 990222 |
7 | ** | 7 | ** |
8 | ** Copyright (C) 1999-2000 Trolltech AS. All rights reserved. | 8 | ** Copyright (C) 1999-2000 Trolltech AS. All rights reserved. |
@@ -475,51 +475,51 @@ QColorShower::QColorShower( QWidget *parent, const char *name ) | |||
475 | this, SLOT( setRgb( QRgb ) ) ); | 475 | this, SLOT( setRgb( QRgb ) ) ); |
476 | 476 | ||
477 | hEd = new QColNumLineEdit( this ); | 477 | hEd = new QColNumLineEdit( this ); |
478 | hEd->setValidator( val360 ); | 478 | hEd->setValidator( val360 ); |
479 | QLabel *l = new QLabel( hEd, QColorDialog::tr("Hue:"), this ); | 479 | QLabel *l = new QLabel( hEd, OColorDialog::tr("Hue:"), this ); |
480 | l->setAlignment( AlignRight|AlignVCenter ); | 480 | l->setAlignment( AlignRight|AlignVCenter ); |
481 | gl->addWidget( l, 0, 1 ); | 481 | gl->addWidget( l, 0, 1 ); |
482 | gl->addWidget( hEd, 0, 2 ); | 482 | gl->addWidget( hEd, 0, 2 ); |
483 | 483 | ||
484 | sEd = new QColNumLineEdit( this ); | 484 | sEd = new QColNumLineEdit( this ); |
485 | sEd->setValidator( val256 ); | 485 | sEd->setValidator( val256 ); |
486 | l = new QLabel( sEd, QColorDialog::tr("Sat:"), this ); | 486 | l = new QLabel( sEd, OColorDialog::tr("Sat:"), this ); |
487 | l->setAlignment( AlignRight|AlignVCenter ); | 487 | l->setAlignment( AlignRight|AlignVCenter ); |
488 | gl->addWidget( l, 1, 1 ); | 488 | gl->addWidget( l, 1, 1 ); |
489 | gl->addWidget( sEd, 1, 2 ); | 489 | gl->addWidget( sEd, 1, 2 ); |
490 | 490 | ||
491 | vEd = new QColNumLineEdit( this ); | 491 | vEd = new QColNumLineEdit( this ); |
492 | vEd->setValidator( val256 ); | 492 | vEd->setValidator( val256 ); |
493 | l = new QLabel( vEd, QColorDialog::tr("Val:"), this ); | 493 | l = new QLabel( vEd, OColorDialog::tr("Val:"), this ); |
494 | l->setAlignment( AlignRight|AlignVCenter ); | 494 | l->setAlignment( AlignRight|AlignVCenter ); |
495 | gl->addWidget( l, 2, 1 ); | 495 | gl->addWidget( l, 2, 1 ); |
496 | gl->addWidget( vEd, 2, 2 ); | 496 | gl->addWidget( vEd, 2, 2 ); |
497 | 497 | ||
498 | rEd = new QColNumLineEdit( this ); | 498 | rEd = new QColNumLineEdit( this ); |
499 | rEd->setValidator( val256 ); | 499 | rEd->setValidator( val256 ); |
500 | l = new QLabel( rEd, QColorDialog::tr("Red:"), this ); | 500 | l = new QLabel( rEd, OColorDialog::tr("Red:"), this ); |
501 | l->setAlignment( AlignRight|AlignVCenter ); | 501 | l->setAlignment( AlignRight|AlignVCenter ); |
502 | gl->addWidget( l, 0, 3 ); | 502 | gl->addWidget( l, 0, 3 ); |
503 | gl->addWidget( rEd, 0, 4 ); | 503 | gl->addWidget( rEd, 0, 4 ); |
504 | 504 | ||
505 | gEd = new QColNumLineEdit( this ); | 505 | gEd = new QColNumLineEdit( this ); |
506 | gEd->setValidator( val256 ); | 506 | gEd->setValidator( val256 ); |
507 | l = new QLabel( gEd, QColorDialog::tr("Green:"), this ); | 507 | l = new QLabel( gEd, OColorDialog::tr("Green:"), this ); |
508 | l->setAlignment( AlignRight|AlignVCenter ); | 508 | l->setAlignment( AlignRight|AlignVCenter ); |
509 | gl->addWidget( l, 1, 3 ); | 509 | gl->addWidget( l, 1, 3 ); |
510 | gl->addWidget( gEd, 1, 4 ); | 510 | gl->addWidget( gEd, 1, 4 ); |
511 | 511 | ||
512 | bEd = new QColNumLineEdit( this ); | 512 | bEd = new QColNumLineEdit( this ); |
513 | bEd->setValidator( val256 ); | 513 | bEd->setValidator( val256 ); |
514 | l = new QLabel( bEd, QColorDialog::tr("Blue:"), this ); | 514 | l = new QLabel( bEd, OColorDialog::tr("Blue:"), this ); |
515 | l->setAlignment( AlignRight|AlignVCenter ); | 515 | l->setAlignment( AlignRight|AlignVCenter ); |
516 | gl->addWidget( l, 2, 3 ); | 516 | gl->addWidget( l, 2, 3 ); |
517 | gl->addWidget( bEd, 2, 4 ); | 517 | gl->addWidget( bEd, 2, 4 ); |
518 | 518 | ||
519 | alphaEd = new QColNumLineEdit( this ); | 519 | alphaEd = new QColNumLineEdit( this ); |
520 | alphaEd->setValidator( val256 ); | 520 | alphaEd->setValidator( val256 ); |
521 | alphaLab = new QLabel( alphaEd, QColorDialog::tr("Alpha channel:"), this ); | 521 | alphaLab = new QLabel( alphaEd, OColorDialog::tr("Alpha channel:"), this ); |
522 | alphaLab->setAlignment( AlignRight|AlignVCenter ); | 522 | alphaLab->setAlignment( AlignRight|AlignVCenter ); |
523 | gl->addMultiCellWidget( alphaLab, 3, 3, 1, 3 ); | 523 | gl->addMultiCellWidget( alphaLab, 3, 3, 1, 3 ); |
524 | gl->addWidget( alphaEd, 3, 4 ); | 524 | gl->addWidget( alphaEd, 3, 4 ); |
525 | alphaEd->hide(); | 525 | alphaEd->hide(); |
@@ -606,13 +606,13 @@ void QColorShower::setHsv( int h, int s, int v ) | |||
606 | 606 | ||
607 | showCurrentColor(); | 607 | showCurrentColor(); |
608 | } | 608 | } |
609 | 609 | ||
610 | class QColorDialogPrivate : public QObject | 610 | class OColorDialogPrivate : public QObject |
611 | { | 611 | { |
612 | Q_OBJECT | 612 | Q_OBJECT |
613 | public: | 613 | public: |
614 | QColorDialogPrivate( QColorDialog *p ); | 614 | OColorDialogPrivate( OColorDialog *p ); |
615 | QRgb currentColor() const { return cs->currentColor(); } | 615 | QRgb currentColor() const { return cs->currentColor(); } |
616 | void setCurrentColor( QRgb rgb ); | 616 | void setCurrentColor( QRgb rgb ); |
617 | 617 | ||
618 | int currentAlpha() const { return cs->currentAlpha(); } | 618 | int currentAlpha() const { return cs->currentAlpha(); } |
@@ -628,32 +628,32 @@ private: | |||
628 | QColorShower *cs; | 628 | QColorShower *cs; |
629 | }; | 629 | }; |
630 | 630 | ||
631 | //sets all widgets to display h,s,v | 631 | //sets all widgets to display h,s,v |
632 | void QColorDialogPrivate::newHsv( int h, int s, int v ) | 632 | void OColorDialogPrivate::newHsv( int h, int s, int v ) |
633 | { | 633 | { |
634 | cs->setHsv( h, s, v ); | 634 | cs->setHsv( h, s, v ); |
635 | cp->setCol( h, s ); | 635 | cp->setCol( h, s ); |
636 | lp->setCol( h, s, v ); | 636 | lp->setCol( h, s, v ); |
637 | } | 637 | } |
638 | 638 | ||
639 | //sets all widgets to display rgb | 639 | //sets all widgets to display rgb |
640 | void QColorDialogPrivate::setCurrentColor( QRgb rgb ) | 640 | void OColorDialogPrivate::setCurrentColor( QRgb rgb ) |
641 | { | 641 | { |
642 | cs->setRgb( rgb ); | 642 | cs->setRgb( rgb ); |
643 | newColorTypedIn( rgb ); | 643 | newColorTypedIn( rgb ); |
644 | } | 644 | } |
645 | 645 | ||
646 | //sets all widgets exept cs to display rgb | 646 | //sets all widgets exept cs to display rgb |
647 | void QColorDialogPrivate::newColorTypedIn( QRgb rgb ) | 647 | void OColorDialogPrivate::newColorTypedIn( QRgb rgb ) |
648 | { | 648 | { |
649 | int h, s, v; | 649 | int h, s, v; |
650 | rgb2hsv(rgb, h, s, v ); | 650 | rgb2hsv(rgb, h, s, v ); |
651 | cp->setCol( h, s ); | 651 | cp->setCol( h, s ); |
652 | lp->setCol( h, s, v); | 652 | lp->setCol( h, s, v); |
653 | } | 653 | } |
654 | 654 | ||
655 | QColorDialogPrivate::QColorDialogPrivate( QColorDialog *dialog ) : | 655 | OColorDialogPrivate::OColorDialogPrivate( OColorDialog *dialog ) : |
656 | QObject(dialog) | 656 | QObject(dialog) |
657 | { | 657 | { |
658 | int border = 2; | 658 | int border = 2; |
659 | QVBoxLayout *topLay = new QVBoxLayout( dialog, border, 2 ); | 659 | QVBoxLayout *topLay = new QVBoxLayout( dialog, border, 2 ); |
@@ -684,10 +684,10 @@ QColorDialogPrivate::QColorDialogPrivate( QColorDialog *dialog ) : | |||
684 | 684 | ||
685 | 685 | ||
686 | // BEING REVISED: jo | 686 | // BEING REVISED: jo |
687 | /*! | 687 | /*! |
688 | \class QColorDialog qcolordialog.h | 688 | \class OColorDialog OColorDialog.h |
689 | \brief The QColorDialog class provides a dialog widget for specifying colors. | 689 | \brief The OColorDialog class provides a dialog widget for specifying colors. |
690 | \ingroup dialogs | 690 | \ingroup dialogs |
691 | 691 | ||
692 | The color dialog's function is to allow users to choose colors - | 692 | The color dialog's function is to allow users to choose colors - |
693 | for instance, you might use this in a drawing program to allow the | 693 | for instance, you might use this in a drawing program to allow the |
@@ -711,12 +711,12 @@ QColorDialogPrivate::QColorDialogPrivate( QColorDialog *dialog ) : | |||
711 | 711 | ||
712 | \sa getColor() | 712 | \sa getColor() |
713 | */ | 713 | */ |
714 | 714 | ||
715 | QColorDialog::QColorDialog(QWidget* parent, const char* name, bool modal) : | 715 | OColorDialog::OColorDialog(QWidget* parent, const char* name, bool modal) : |
716 | QDialog(parent, name, modal ) | 716 | QDialog(parent, name, modal ) |
717 | { | 717 | { |
718 | d = new QColorDialogPrivate( this ); | 718 | d = new OColorDialogPrivate( this ); |
719 | } | 719 | } |
720 | 720 | ||
721 | 721 | ||
722 | /*! | 722 | /*! |
@@ -725,19 +725,19 @@ QColorDialog::QColorDialog(QWidget* parent, const char* name, bool modal) : | |||
725 | the dialog. All colors allocated by the dialog will be deallocated | 725 | the dialog. All colors allocated by the dialog will be deallocated |
726 | before this function returns. | 726 | before this function returns. |
727 | */ | 727 | */ |
728 | 728 | ||
729 | QColor QColorDialog::getColor( QColor initial, QWidget *parent, | 729 | QColor OColorDialog::getColor( QColor initial, QWidget *parent, |
730 | const char *name ) | 730 | const char *name ) |
731 | { | 731 | { |
732 | int allocContext = QColor::enterAllocContext(); | 732 | int allocContext = QColor::enterAllocContext(); |
733 | QColorDialog *dlg = new QColorDialog( parent, name, TRUE ); //modal | 733 | OColorDialog *dlg = new OColorDialog( parent, name, TRUE ); //modal |
734 | if ( parent && parent->icon() && !parent->icon()->isNull() ) | 734 | if ( parent && parent->icon() && !parent->icon()->isNull() ) |
735 | dlg->setIcon( *parent->icon() ); | 735 | dlg->setIcon( *parent->icon() ); |
736 | else if ( qApp->mainWidget() && qApp->mainWidget()->icon() && !qApp->mainWidget()->icon()->isNull() ) | 736 | else if ( qApp->mainWidget() && qApp->mainWidget()->icon() && !qApp->mainWidget()->icon()->isNull() ) |
737 | dlg->setIcon( *qApp->mainWidget()->icon() ); | 737 | dlg->setIcon( *qApp->mainWidget()->icon() ); |
738 | 738 | ||
739 | dlg->setCaption( QColorDialog::tr( "Select color" ) ); | 739 | dlg->setCaption( OColorDialog::tr( "Select color" ) ); |
740 | dlg->setColor( initial ); | 740 | dlg->setColor( initial ); |
741 | dlg->showMaximized(); | 741 | dlg->showMaximized(); |
742 | int resultCode = dlg->exec(); | 742 | int resultCode = dlg->exec(); |
743 | QColor::leaveAllocContext(); | 743 | QColor::leaveAllocContext(); |
@@ -762,13 +762,13 @@ QColor QColorDialog::getColor( QColor initial, QWidget *parent, | |||
762 | 762 | ||
763 | If the user clicks Cancel the \a initial value is returned. | 763 | If the user clicks Cancel the \a initial value is returned. |
764 | */ | 764 | */ |
765 | 765 | ||
766 | QRgb QColorDialog::getRgba( QRgb initial, bool *ok, | 766 | QRgb OColorDialog::getRgba( QRgb initial, bool *ok, |
767 | QWidget *parent, const char* name ) | 767 | QWidget *parent, const char* name ) |
768 | { | 768 | { |
769 | int allocContext = QColor::enterAllocContext(); | 769 | int allocContext = QColor::enterAllocContext(); |
770 | QColorDialog *dlg = new QColorDialog( parent, name, TRUE ); //modal | 770 | OColorDialog *dlg = new OColorDialog( parent, name, TRUE ); //modal |
771 | dlg->setColor( initial ); | 771 | dlg->setColor( initial ); |
772 | dlg->setSelectedAlpha( qAlpha(initial) ); | 772 | dlg->setSelectedAlpha( qAlpha(initial) ); |
773 | dlg->showMaximized(); | 773 | dlg->showMaximized(); |
774 | int resultCode = dlg->exec(); | 774 | int resultCode = dlg->exec(); |
@@ -796,9 +796,9 @@ QRgb QColorDialog::getRgba( QRgb initial, bool *ok, | |||
796 | 796 | ||
797 | \sa setColor() | 797 | \sa setColor() |
798 | */ | 798 | */ |
799 | 799 | ||
800 | QColor QColorDialog::color() const | 800 | QColor OColorDialog::color() const |
801 | { | 801 | { |
802 | return QColor(d->currentColor()); | 802 | return QColor(d->currentColor()); |
803 | } | 803 | } |
804 | 804 | ||
@@ -806,9 +806,9 @@ QColor QColorDialog::color() const | |||
806 | /*! Destructs the dialog and frees any memory it allocated. | 806 | /*! Destructs the dialog and frees any memory it allocated. |
807 | 807 | ||
808 | */ | 808 | */ |
809 | 809 | ||
810 | QColorDialog::~QColorDialog() | 810 | OColorDialog::~OColorDialog() |
811 | { | 811 | { |
812 | //d inherits QObject, so it is deleted by Qt. | 812 | //d inherits QObject, so it is deleted by Qt. |
813 | } | 813 | } |
814 | 814 | ||
@@ -818,9 +818,9 @@ QColorDialog::~QColorDialog() | |||
818 | 818 | ||
819 | \sa color() | 819 | \sa color() |
820 | */ | 820 | */ |
821 | 821 | ||
822 | void QColorDialog::setColor( QColor c ) | 822 | void OColorDialog::setColor( QColor c ) |
823 | { | 823 | { |
824 | d->setCurrentColor( c.rgb() ); | 824 | d->setCurrentColor( c.rgb() ); |
825 | } | 825 | } |
826 | 826 | ||
@@ -831,9 +831,9 @@ void QColorDialog::setColor( QColor c ) | |||
831 | Sets the initial alpha channel value to \a a, and show the alpha channel | 831 | Sets the initial alpha channel value to \a a, and show the alpha channel |
832 | entry box. | 832 | entry box. |
833 | */ | 833 | */ |
834 | 834 | ||
835 | void QColorDialog::setSelectedAlpha( int a ) | 835 | void OColorDialog::setSelectedAlpha( int a ) |
836 | { | 836 | { |
837 | d->showAlpha( TRUE ); | 837 | d->showAlpha( TRUE ); |
838 | d->setCurrentAlpha( a ); | 838 | d->setCurrentAlpha( a ); |
839 | } | 839 | } |
@@ -842,9 +842,9 @@ void QColorDialog::setSelectedAlpha( int a ) | |||
842 | /*! | 842 | /*! |
843 | Returns the value selected for the alpha channel. | 843 | Returns the value selected for the alpha channel. |
844 | */ | 844 | */ |
845 | 845 | ||
846 | int QColorDialog::selectedAlpha() const | 846 | int OColorDialog::selectedAlpha() const |
847 | { | 847 | { |
848 | return d->currentAlpha(); | 848 | return d->currentAlpha(); |
849 | } | 849 | } |
850 | 850 | ||
diff --git a/libopie/colordialog.h b/libopie/colordialog.h index a2d4d30..474bc61 100644 --- a/libopie/colordialog.h +++ b/libopie/colordialog.h | |||
@@ -1,8 +1,8 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | ** $Id$ | 2 | ** $Id$ |
3 | ** | 3 | ** |
4 | ** Definition of QColorDialog class | 4 | ** Definition of OColorDialog class |
5 | ** | 5 | ** |
6 | ** Created : 990222 | 6 | ** Created : 990222 |
7 | ** | 7 | ** |
8 | ** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. | 8 | ** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. |
@@ -34,18 +34,18 @@ | |||
34 | ** not clear to you. | 34 | ** not clear to you. |
35 | ** | 35 | ** |
36 | **********************************************************************/ | 36 | **********************************************************************/ |
37 | 37 | ||
38 | #ifndef QCOLORDIALOG_H | 38 | #ifndef OColorDialog_H |
39 | #define QCOLORDIALOG_H | 39 | #define OColorDialog_H |
40 | 40 | ||
41 | #ifndef QT_H | 41 | #ifndef QT_H |
42 | #include <qdialog.h> | 42 | #include <qdialog.h> |
43 | #endif // QT_H | 43 | #endif // QT_H |
44 | 44 | ||
45 | class QColorDialogPrivate; | 45 | class OColorDialogPrivate; |
46 | 46 | ||
47 | class Q_EXPORT QColorDialog : public QDialog | 47 | class Q_EXPORT OColorDialog : public QDialog |
48 | { | 48 | { |
49 | Q_OBJECT | 49 | Q_OBJECT |
50 | 50 | ||
51 | public: | 51 | public: |
@@ -53,25 +53,25 @@ public: | |||
53 | static QRgb getRgba( QRgb, bool* ok = 0, | 53 | static QRgb getRgba( QRgb, bool* ok = 0, |
54 | QWidget *parent=0, const char* name=0 ); | 54 | QWidget *parent=0, const char* name=0 ); |
55 | 55 | ||
56 | private: | 56 | private: |
57 | ~QColorDialog(); | 57 | ~OColorDialog(); |
58 | 58 | ||
59 | QColorDialog( QWidget* parent=0, const char* name=0, bool modal=FALSE ); | 59 | OColorDialog( QWidget* parent=0, const char* name=0, bool modal=FALSE ); |
60 | void setColor( QColor ); // ### 3.0: make const QColor& | 60 | void setColor( QColor ); // ### 3.0: make const QColor& |
61 | QColor color() const; | 61 | QColor color() const; |
62 | 62 | ||
63 | private: | 63 | private: |
64 | void setSelectedAlpha( int ); | 64 | void setSelectedAlpha( int ); |
65 | int selectedAlpha() const; | 65 | int selectedAlpha() const; |
66 | private: | 66 | private: |
67 | QColorDialogPrivate *d; | 67 | OColorDialogPrivate *d; |
68 | friend class QColorDialogPrivate; | 68 | friend class OColorDialogPrivate; |
69 | 69 | ||
70 | private:// Disabled copy constructor and operator= | 70 | private:// Disabled copy constructor and operator= |
71 | #if defined(Q_DISABLE_COPY) | 71 | #if defined(Q_DISABLE_COPY) |
72 | QColorDialog( const QColorDialog & ); | 72 | OColorDialog( const OColorDialog & ); |
73 | QColorDialog& operator=( const QColorDialog & ); | 73 | OColorDialog& operator=( const OColorDialog & ); |
74 | #endif | 74 | #endif |
75 | }; | 75 | }; |
76 | 76 | ||
77 | #endif | 77 | #endif |
diff --git a/libopie/colorpopupmenu.cpp b/libopie/colorpopupmenu.cpp index 35e91f4..9b50a8b 100644 --- a/libopie/colorpopupmenu.cpp +++ b/libopie/colorpopupmenu.cpp | |||
@@ -157,9 +157,9 @@ void ColorPopupMenu::buttonSelected( const QColor& color ) | |||
157 | } | 157 | } |
158 | 158 | ||
159 | void ColorPopupMenu::moreColorClicked() | 159 | void ColorPopupMenu::moreColorClicked() |
160 | { | 160 | { |
161 | QColor color = QColorDialog::getColor( m_color ); | 161 | QColor color = OColorDialog::getColor( m_color ); |
162 | m_color = color; | 162 | m_color = color; |
163 | emit colorSelected( color ); | 163 | emit colorSelected( color ); |
164 | hide(); | 164 | hide(); |
165 | } | 165 | } |