-rw-r--r-- | libopie2/opieui/oseparator.cpp | 2 | ||||
-rw-r--r-- | libopie2/qt3/opieui/oeditlistbox.h | 2 | ||||
-rw-r--r-- | libopie2/qt3/opieui/ojanuswidget.cpp | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/libopie2/opieui/oseparator.cpp b/libopie2/opieui/oseparator.cpp index bbc4381..177368b 100644 --- a/libopie2/opieui/oseparator.cpp +++ b/libopie2/opieui/oseparator.cpp | |||
@@ -63,67 +63,67 @@ void OSeparator::setOrientation(int orientation) | |||
63 | { | 63 | { |
64 | switch(orientation) | 64 | switch(orientation) |
65 | { | 65 | { |
66 | case Vertical: | 66 | case Vertical: |
67 | case VLine: | 67 | case VLine: |
68 | setFrameStyle( QFrame::VLine | QFrame::Sunken ); | 68 | setFrameStyle( QFrame::VLine | QFrame::Sunken ); |
69 | setMinimumSize(2, 0); | 69 | setMinimumSize(2, 0); |
70 | break; | 70 | break; |
71 | 71 | ||
72 | default: | 72 | default: |
73 | owarn << "OSeparator::setOrientation(): invalid orientation, using default orientation HLine" << oendl; | 73 | owarn << "OSeparator::setOrientation(): invalid orientation, using default orientation HLine" << oendl; |
74 | 74 | ||
75 | case Horizontal: | 75 | case Horizontal: |
76 | case HLine: | 76 | case HLine: |
77 | setFrameStyle( QFrame::HLine | QFrame::Sunken ); | 77 | setFrameStyle( QFrame::HLine | QFrame::Sunken ); |
78 | setMinimumSize(0, 2); | 78 | setMinimumSize(0, 2); |
79 | break; | 79 | break; |
80 | } | 80 | } |
81 | } | 81 | } |
82 | 82 | ||
83 | 83 | ||
84 | 84 | ||
85 | int OSeparator::orientation() const | 85 | int OSeparator::orientation() const |
86 | { | 86 | { |
87 | if ( frameStyle() & VLine ) | 87 | if ( frameStyle() & VLine ) |
88 | return VLine; | 88 | return VLine; |
89 | 89 | ||
90 | if ( frameStyle() & HLine ) | 90 | if ( frameStyle() & HLine ) |
91 | return HLine; | 91 | return HLine; |
92 | 92 | ||
93 | return 0; | 93 | return 0; |
94 | } | 94 | } |
95 | 95 | ||
96 | void OSeparator::drawFrame(QPainter *p) | 96 | void OSeparator::drawFrame(QPainter *p) |
97 | { | 97 | { |
98 | QPointp1, p2; | 98 | QPointp1, p2; |
99 | QRectr = frameRect(); | 99 | QRectr = frameRect(); |
100 | const QColorGroup & g = colorGroup(); | 100 | const QColorGroup & g = colorGroup(); |
101 | 101 | ||
102 | if ( frameStyle() & HLine ) { | 102 | if ( frameStyle() & HLine ) { |
103 | p1 = QPoint( r.x(), r.height()/2 ); | 103 | p1 = QPoint( r.x(), r.height()/2 ); |
104 | p2 = QPoint( r.x()+r.width(), p1.y() ); | 104 | p2 = QPoint( r.x()+r.width(), p1.y() ); |
105 | } | 105 | } |
106 | else { | 106 | else { |
107 | p1 = QPoint( r.x()+r.width()/2, 0 ); | 107 | p1 = QPoint( r.x()+r.width()/2, 0 ); |
108 | p2 = QPoint( p1.x(), r.height() ); | 108 | p2 = QPoint( p1.x(), r.height() ); |
109 | } | 109 | } |
110 | 110 | ||
111 | #if QT_VERSION < 300 | 111 | #if QT_VERSION < 0x030000 |
112 | style().drawSeparator( p, p1.x(), p1.y(), p2.x(), p2.y(), g, true, 1, midLineWidth() ); | 112 | style().drawSeparator( p, p1.x(), p1.y(), p2.x(), p2.y(), g, true, 1, midLineWidth() ); |
113 | #else | 113 | #else |
114 | QStyleOption opt( lineWidth(), midLineWidth() ); | 114 | QStyleOption opt( lineWidth(), midLineWidth() ); |
115 | style().drawPrimitive( QStyle::PE_Separator, p, QRect( p1, p2 ), g, QStyle::Style_Sunken, opt ); | 115 | style().drawPrimitive( QStyle::PE_Separator, p, QRect( p1, p2 ), g, QStyle::Style_Sunken, opt ); |
116 | #endif | 116 | #endif |
117 | } | 117 | } |
118 | 118 | ||
119 | 119 | ||
120 | QSize OSeparator::sizeHint() const | 120 | QSize OSeparator::sizeHint() const |
121 | { | 121 | { |
122 | if ( frameStyle() & VLine ) | 122 | if ( frameStyle() & VLine ) |
123 | return QSize(2, 0); | 123 | return QSize(2, 0); |
124 | 124 | ||
125 | if ( frameStyle() & HLine ) | 125 | if ( frameStyle() & HLine ) |
126 | return QSize(0, 2); | 126 | return QSize(0, 2); |
127 | 127 | ||
128 | return QSize(-1, -1); | 128 | return QSize(-1, -1); |
129 | } | 129 | } |
diff --git a/libopie2/qt3/opieui/oeditlistbox.h b/libopie2/qt3/opieui/oeditlistbox.h index 63fab11..c9c207d 100644 --- a/libopie2/qt3/opieui/oeditlistbox.h +++ b/libopie2/qt3/opieui/oeditlistbox.h | |||
@@ -1,78 +1,78 @@ | |||
1 | /* This file is part of the KDE libraries | 1 | /* This file is part of the KDE libraries |
2 | Copyright (C) 2000 David Faure <faure@kde.org>, Alexander Neundorf <neundorf@kde.org> | 2 | Copyright (C) 2000 David Faure <faure@kde.org>, Alexander Neundorf <neundorf@kde.org> |
3 | 3 | ||
4 | This library is free software; you can redistribute it and/or | 4 | This library is free software; you can redistribute it and/or |
5 | modify it under the terms of the GNU Library General Public | 5 | modify it under the terms of the GNU Library General Public |
6 | License as published by the Free Software Foundation; either | 6 | License as published by the Free Software Foundation; either |
7 | version 2 of the License, or (at your option) any later version. | 7 | version 2 of the License, or (at your option) any later version. |
8 | 8 | ||
9 | This library is distributed in the hope that it will be useful, | 9 | This library is distributed in the hope that it will be useful, |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 | Library General Public License for more details. | 12 | Library General Public License for more details. |
13 | 13 | ||
14 | You should have received a copy of the GNU Library General Public License | 14 | You should have received a copy of the GNU Library General Public License |
15 | along with this library; see the file COPYING.LIB. If not, write to | 15 | along with this library; see the file COPYING.LIB. If not, write to |
16 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 16 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
17 | Boston, MA 02111-1307, USA. | 17 | Boston, MA 02111-1307, USA. |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #ifndef OEDITLISTBOX_H | 20 | #ifndef OEDITLISTBOX_H |
21 | #define OEDITLISTBOX_H | 21 | #define OEDITLISTBOX_H |
22 | 22 | ||
23 | #include <qgroupbox.h> | 23 | #include <qgroupbox.h> |
24 | #include <qlistbox.h> | 24 | #include <qlistbox.h> |
25 | 25 | ||
26 | class OLineEdit; | 26 | class OLineEdit; |
27 | class OComboBox; | 27 | class OComboBox; |
28 | class QPushButton; | 28 | class QPushButton; |
29 | 29 | ||
30 | #if QT_VERSION < 300 | 30 | #if QT_VERSION < 0x030000 |
31 | enum StringComparisonMode { | 31 | enum StringComparisonMode { |
32 | CaseSensitive = 0x00001, // 0 0001 | 32 | CaseSensitive = 0x00001, // 0 0001 |
33 | BeginsWith = 0x00002, // 0 0010 | 33 | BeginsWith = 0x00002, // 0 0010 |
34 | EndsWith = 0x00004, // 0 0100 | 34 | EndsWith = 0x00004, // 0 0100 |
35 | Contains = 0x00008, // 0 1000 | 35 | Contains = 0x00008, // 0 1000 |
36 | ExactMatch = 0x00010 // 1 0000 | 36 | ExactMatch = 0x00010 // 1 0000 |
37 | }; | 37 | }; |
38 | #endif | 38 | #endif |
39 | 39 | ||
40 | class OEditListBoxPrivate; | 40 | class OEditListBoxPrivate; |
41 | /** | 41 | /** |
42 | * An editable listbox | 42 | * An editable listbox |
43 | * | 43 | * |
44 | * This class provides a editable listbox ;-), this means | 44 | * This class provides a editable listbox ;-), this means |
45 | * a listbox which is accompanied by a line edit to enter new | 45 | * a listbox which is accompanied by a line edit to enter new |
46 | * items into the listbox and pushbuttons to add and remove | 46 | * items into the listbox and pushbuttons to add and remove |
47 | * items from the listbox and two buttons to move items up and down. | 47 | * items from the listbox and two buttons to move items up and down. |
48 | */ | 48 | */ |
49 | class OEditListBox : public QGroupBox | 49 | class OEditListBox : public QGroupBox |
50 | { | 50 | { |
51 | Q_OBJECT | 51 | Q_OBJECT |
52 | 52 | ||
53 | public: | 53 | public: |
54 | /// @since 3.1 | 54 | /// @since 3.1 |
55 | class CustomEditor | 55 | class CustomEditor |
56 | { | 56 | { |
57 | public: | 57 | public: |
58 | CustomEditor() | 58 | CustomEditor() |
59 | : m_representationWidget( 0L ), | 59 | : m_representationWidget( 0L ), |
60 | m_lineEdit( 0L ) {} | 60 | m_lineEdit( 0L ) {} |
61 | CustomEditor( QWidget *repWidget, OLineEdit *edit ) | 61 | CustomEditor( QWidget *repWidget, OLineEdit *edit ) |
62 | : m_representationWidget( repWidget ), | 62 | : m_representationWidget( repWidget ), |
63 | m_lineEdit( edit ) {} | 63 | m_lineEdit( edit ) {} |
64 | CustomEditor( OComboBox *combo ); | 64 | CustomEditor( OComboBox *combo ); |
65 | 65 | ||
66 | void setRepresentationWidget( QWidget *repWidget ) { | 66 | void setRepresentationWidget( QWidget *repWidget ) { |
67 | m_representationWidget = repWidget; | 67 | m_representationWidget = repWidget; |
68 | } | 68 | } |
69 | void setLineEdit( OLineEdit *edit ) { | 69 | void setLineEdit( OLineEdit *edit ) { |
70 | m_lineEdit = edit; | 70 | m_lineEdit = edit; |
71 | } | 71 | } |
72 | 72 | ||
73 | virtual QWidget *representationWidget() const { | 73 | virtual QWidget *representationWidget() const { |
74 | return m_representationWidget; | 74 | return m_representationWidget; |
75 | } | 75 | } |
76 | virtual OLineEdit *lineEdit() const { | 76 | virtual OLineEdit *lineEdit() const { |
77 | return m_lineEdit; | 77 | return m_lineEdit; |
78 | } | 78 | } |
diff --git a/libopie2/qt3/opieui/ojanuswidget.cpp b/libopie2/qt3/opieui/ojanuswidget.cpp index 063e393..8bdbc03 100644 --- a/libopie2/qt3/opieui/ojanuswidget.cpp +++ b/libopie2/qt3/opieui/ojanuswidget.cpp | |||
@@ -727,97 +727,97 @@ void OJanusWidget::slotFontChanged() | |||
727 | mIconList->invalidateWidth(); | 727 | mIconList->invalidateWidth(); |
728 | } | 728 | } |
729 | } | 729 | } |
730 | 730 | ||
731 | // makes the treelist behave like the list of kcontrol | 731 | // makes the treelist behave like the list of kcontrol |
732 | void OJanusWidget::slotItemClicked(QListViewItem *it) | 732 | void OJanusWidget::slotItemClicked(QListViewItem *it) |
733 | { | 733 | { |
734 | if(it && (it->childCount()>0)) | 734 | if(it && (it->childCount()>0)) |
735 | it->setOpen(!it->isOpen()); | 735 | it->setOpen(!it->isOpen()); |
736 | } | 736 | } |
737 | 737 | ||
738 | void OJanusWidget::setFocus() | 738 | void OJanusWidget::setFocus() |
739 | { | 739 | { |
740 | if( mValid == false ) { return; } | 740 | if( mValid == false ) { return; } |
741 | if( mFace == TreeList ) | 741 | if( mFace == TreeList ) |
742 | { | 742 | { |
743 | mTreeList->setFocus(); | 743 | mTreeList->setFocus(); |
744 | } | 744 | } |
745 | if( mFace == IconList ) | 745 | if( mFace == IconList ) |
746 | { | 746 | { |
747 | mIconList->setFocus(); | 747 | mIconList->setFocus(); |
748 | } | 748 | } |
749 | else if( mFace == Tabbed ) | 749 | else if( mFace == Tabbed ) |
750 | { | 750 | { |
751 | mTabControl->setFocus(); | 751 | mTabControl->setFocus(); |
752 | } | 752 | } |
753 | else if( mFace == Swallow ) | 753 | else if( mFace == Swallow ) |
754 | { | 754 | { |
755 | mSwallowPage->setFocus(); | 755 | mSwallowPage->setFocus(); |
756 | } | 756 | } |
757 | else if( mFace == Plain ) | 757 | else if( mFace == Plain ) |
758 | { | 758 | { |
759 | mPlainPage->setFocus(); | 759 | mPlainPage->setFocus(); |
760 | } | 760 | } |
761 | } | 761 | } |
762 | 762 | ||
763 | 763 | ||
764 | QSize OJanusWidget::minimumSizeHint() const | 764 | QSize OJanusWidget::minimumSizeHint() const |
765 | { | 765 | { |
766 | if( mFace == TreeList || mFace == IconList ) | 766 | if( mFace == TreeList || mFace == IconList ) |
767 | { | 767 | { |
768 | QSize s1( ODialog::spacingHint(), ODialog::spacingHint()*2 ); | 768 | QSize s1( ODialog::spacingHint(), ODialog::spacingHint()*2 ); |
769 | QSize s2(0,0); | 769 | QSize s2(0,0); |
770 | QSize s3(0,0); | 770 | QSize s3(0,0); |
771 | QSize s4( mPageStack->sizeHint() ); | 771 | QSize s4( mPageStack->sizeHint() ); |
772 | 772 | ||
773 | if( mFace == TreeList ) | 773 | if( mFace == TreeList ) |
774 | { | 774 | { |
775 | #if QT_VERSION < 300 | 775 | #if QT_VERSION < 0x030000 |
776 | s1.rwidth() += style().splitterWidth(); | 776 | s1.rwidth() += style().splitterWidth(); |
777 | #else | 777 | #else |
778 | s1.rwidth() += style().pixelMetric( QStyle::PM_SplitterWidth ); | 778 | s1.rwidth() += style().pixelMetric( QStyle::PM_SplitterWidth ); |
779 | #endif | 779 | #endif |
780 | s2 = mTreeList->minimumSize(); | 780 | s2 = mTreeList->minimumSize(); |
781 | } | 781 | } |
782 | else | 782 | else |
783 | { | 783 | { |
784 | mIconList->updateMinimumHeight(); | 784 | mIconList->updateMinimumHeight(); |
785 | mIconList->updateWidth(); | 785 | mIconList->updateWidth(); |
786 | s2 = mIconList->minimumSize(); | 786 | s2 = mIconList->minimumSize(); |
787 | } | 787 | } |
788 | 788 | ||
789 | if( mTitleLabel->isVisible() == true ) | 789 | if( mTitleLabel->isVisible() == true ) |
790 | { | 790 | { |
791 | s3 += mTitleLabel->sizeHint(); | 791 | s3 += mTitleLabel->sizeHint(); |
792 | s3.rheight() += mTitleSep->minimumSize().height(); | 792 | s3.rheight() += mTitleSep->minimumSize().height(); |
793 | } | 793 | } |
794 | 794 | ||
795 | // | 795 | // |
796 | // Select the tallest item. It has only effect in IconList mode | 796 | // Select the tallest item. It has only effect in IconList mode |
797 | // | 797 | // |
798 | int h1 = s1.rheight() + s3.rheight() + s4.height(); | 798 | int h1 = s1.rheight() + s3.rheight() + s4.height(); |
799 | int h2 = QMAX( h1, s2.rheight() ); | 799 | int h2 = QMAX( h1, s2.rheight() ); |
800 | 800 | ||
801 | return( QSize( s1.width()+s2.width()+QMAX(s3.width(),s4.width()), h2 ) ); | 801 | return( QSize( s1.width()+s2.width()+QMAX(s3.width(),s4.width()), h2 ) ); |
802 | } | 802 | } |
803 | else if( mFace == Tabbed ) | 803 | else if( mFace == Tabbed ) |
804 | { | 804 | { |
805 | return( mTabControl->sizeHint() ); | 805 | return( mTabControl->sizeHint() ); |
806 | } | 806 | } |
807 | else if( mFace == Swallow ) | 807 | else if( mFace == Swallow ) |
808 | { | 808 | { |
809 | return( mSwallowPage->minimumSize() ); | 809 | return( mSwallowPage->minimumSize() ); |
810 | } | 810 | } |
811 | else if( mFace == Plain ) | 811 | else if( mFace == Plain ) |
812 | { | 812 | { |
813 | return( mPlainPage->sizeHint() ); | 813 | return( mPlainPage->sizeHint() ); |
814 | } | 814 | } |
815 | else | 815 | else |
816 | { | 816 | { |
817 | return( QSize( 100, 100 ) ); // Should never happen though. | 817 | return( QSize( 100, 100 ) ); // Should never happen though. |
818 | } | 818 | } |
819 | 819 | ||
820 | } | 820 | } |
821 | 821 | ||
822 | 822 | ||
823 | QSize OJanusWidget::sizeHint() const | 823 | QSize OJanusWidget::sizeHint() const |