author | eilers <eilers> | 2003-09-29 07:48:22 (UTC) |
---|---|---|
committer | eilers <eilers> | 2003-09-29 07:48:22 (UTC) |
commit | 93b76e67cf954eab09091996a790301369d77a88 (patch) (unidiff) | |
tree | 07371fb611edaed9d4ef4cd5f0791657da579255 | |
parent | 5e0dd8f6328bff965878c80b9d220a535b826376 (diff) | |
download | opie-93b76e67cf954eab09091996a790301369d77a88.zip opie-93b76e67cf954eab09091996a790301369d77a88.tar.gz opie-93b76e67cf954eab09091996a790301369d77a88.tar.bz2 |
Now using default font instead smallsmooth
-rw-r--r-- | core/pim/addressbook/picker.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/pim/addressbook/picker.cpp b/core/pim/addressbook/picker.cpp index 5099d68..9e0c78a 100644 --- a/core/pim/addressbook/picker.cpp +++ b/core/pim/addressbook/picker.cpp | |||
@@ -1,116 +1,117 @@ | |||
1 | #include "picker.h" | 1 | #include "picker.h" |
2 | 2 | ||
3 | #include <qfont.h> | 3 | #include <qfont.h> |
4 | #include <qstring.h> | 4 | #include <qstring.h> |
5 | #include <qtimer.h> | 5 | #include <qtimer.h> |
6 | #include <qlayout.h> | 6 | #include <qlayout.h> |
7 | 7 | ||
8 | char PickerLabel::lastLetter = '\0'; | 8 | char PickerLabel::lastLetter = '\0'; |
9 | 9 | ||
10 | PickerLabel::PickerLabel( QWidget *parent, const char *name ) | 10 | PickerLabel::PickerLabel( QWidget *parent, const char *name ) |
11 | : QLabel ( parent, name ) | 11 | : QLabel ( parent, name ) |
12 | { | 12 | { |
13 | currentLetter = 0; | 13 | currentLetter = 0; |
14 | //lastLetter = 0; | 14 | //lastLetter = 0; |
15 | 15 | ||
16 | letter1 = '\0'; | 16 | letter1 = '\0'; |
17 | letter2 = '\0'; | 17 | letter2 = '\0'; |
18 | letter3 = '\0'; | 18 | letter3 = '\0'; |
19 | 19 | ||
20 | setFont( QFont( "smallsmooth", 9 ) ); | 20 | // setFont( QFont( "smallsmooth", 9 ) ); |
21 | setFont( QFont::defaultFont() ); | ||
21 | setTextFormat( Qt::RichText ); | 22 | setTextFormat( Qt::RichText ); |
22 | 23 | ||
23 | } | 24 | } |
24 | 25 | ||
25 | PickerLabel::~PickerLabel() | 26 | PickerLabel::~PickerLabel() |
26 | { | 27 | { |
27 | 28 | ||
28 | } | 29 | } |
29 | 30 | ||
30 | void PickerLabel::setLetters( char ch1, char ch2, char ch3 ) | 31 | void PickerLabel::setLetters( char ch1, char ch2, char ch3 ) |
31 | { | 32 | { |
32 | QString tmpStr; | 33 | QString tmpStr; |
33 | 34 | ||
34 | if (ch1 != '\0') | 35 | if (ch1 != '\0') |
35 | letter1 = ch1; | 36 | letter1 = ch1; |
36 | else | 37 | else |
37 | letter1 = ' '; | 38 | letter1 = ' '; |
38 | 39 | ||
39 | if (ch2 != '\0') | 40 | if (ch2 != '\0') |
40 | letter2 = ch2; | 41 | letter2 = ch2; |
41 | else | 42 | else |
42 | letter2 = ' '; | 43 | letter2 = ' '; |
43 | 44 | ||
44 | if (ch3 != '\0') | 45 | if (ch3 != '\0') |
45 | letter3 = ch3; | 46 | letter3 = ch3; |
46 | else | 47 | else |
47 | letter3 = ' '; | 48 | letter3 = ' '; |
48 | 49 | ||
49 | tmpStr = "<qt>"; | 50 | tmpStr = "<qt>"; |
50 | tmpStr += letter1; | 51 | tmpStr += letter1; |
51 | tmpStr += letter2; | 52 | tmpStr += letter2; |
52 | tmpStr += letter3; | 53 | tmpStr += letter3; |
53 | tmpStr += "</qt>"; | 54 | tmpStr += "</qt>"; |
54 | 55 | ||
55 | setText(tmpStr); | 56 | setText(tmpStr); |
56 | 57 | ||
57 | currentLetter = 0; | 58 | currentLetter = 0; |
58 | 59 | ||
59 | } | 60 | } |
60 | 61 | ||
61 | void PickerLabel::clearLetter() | 62 | void PickerLabel::clearLetter() |
62 | { | 63 | { |
63 | 64 | ||
64 | QString tmpStr; | 65 | QString tmpStr; |
65 | 66 | ||
66 | tmpStr = "<qt>"; | 67 | tmpStr = "<qt>"; |
67 | tmpStr += letter1; | 68 | tmpStr += letter1; |
68 | tmpStr += letter2; | 69 | tmpStr += letter2; |
69 | tmpStr += letter3; | 70 | tmpStr += letter3; |
70 | tmpStr += "</qt>"; | 71 | tmpStr += "</qt>"; |
71 | 72 | ||
72 | setText(tmpStr); | 73 | setText(tmpStr); |
73 | 74 | ||
74 | currentLetter = 0; | 75 | currentLetter = 0; |
75 | 76 | ||
76 | } | 77 | } |
77 | 78 | ||
78 | void PickerLabel::mousePressEvent( QMouseEvent* e ) | 79 | void PickerLabel::mousePressEvent( QMouseEvent* e ) |
79 | { | 80 | { |
80 | // If one pickerlabel is was, and an other is now selected, we | 81 | // If one pickerlabel is was, and an other is now selected, we |
81 | // have to simulate the releaseevent.. Otherwise the new label | 82 | // have to simulate the releaseevent.. Otherwise the new label |
82 | // will not get a highlighted letter.. | 83 | // will not get a highlighted letter.. |
83 | // Maybe there is a more intelligent solution, but this works and I am tired.. (se) | 84 | // Maybe there is a more intelligent solution, but this works and I am tired.. (se) |
84 | if ( ( currentLetter == 0 ) && ( lastLetter != '\0' ) ) mouseReleaseEvent( e ); | 85 | if ( ( currentLetter == 0 ) && ( lastLetter != '\0' ) ) mouseReleaseEvent( e ); |
85 | } | 86 | } |
86 | 87 | ||
87 | void PickerLabel::mouseReleaseEvent( QMouseEvent* /* e */ ) | 88 | void PickerLabel::mouseReleaseEvent( QMouseEvent* /* e */ ) |
88 | { | 89 | { |
89 | QString tmpStr; | 90 | QString tmpStr; |
90 | 91 | ||
91 | if (lastLetter != letter1 && lastLetter != letter2 && lastLetter != letter3 && lastLetter != '\0') | 92 | if (lastLetter != letter1 && lastLetter != letter2 && lastLetter != letter3 && lastLetter != '\0') |
92 | QTimer::singleShot( 0, this, SLOT(emitClearSignal()) ); | 93 | QTimer::singleShot( 0, this, SLOT(emitClearSignal()) ); |
93 | 94 | ||
94 | switch (currentLetter) { | 95 | switch (currentLetter) { |
95 | case 0: | 96 | case 0: |
96 | tmpStr = "<qt><u><b><font color=\"#FF00FF\">"; | 97 | tmpStr = "<qt><u><b><font color=\"#FF00FF\">"; |
97 | tmpStr += letter1; | 98 | tmpStr += letter1; |
98 | tmpStr += "</font></b></u>"; | 99 | tmpStr += "</font></b></u>"; |
99 | tmpStr += letter2; | 100 | tmpStr += letter2; |
100 | tmpStr += letter3; | 101 | tmpStr += letter3; |
101 | tmpStr += "</qt>"; | 102 | tmpStr += "</qt>"; |
102 | 103 | ||
103 | setText(tmpStr); | 104 | setText(tmpStr); |
104 | 105 | ||
105 | currentLetter++; | 106 | currentLetter++; |
106 | lastLetter = letter1; | 107 | lastLetter = letter1; |
107 | emit selectedLetter( letter1 ); | 108 | emit selectedLetter( letter1 ); |
108 | break; | 109 | break; |
109 | 110 | ||
110 | case 1: | 111 | case 1: |
111 | tmpStr = "<qt>"; | 112 | tmpStr = "<qt>"; |
112 | tmpStr += letter1; | 113 | tmpStr += letter1; |
113 | tmpStr += "<u><b><font color=\"#FF00FF\">"; | 114 | tmpStr += "<u><b><font color=\"#FF00FF\">"; |
114 | tmpStr += letter2; | 115 | tmpStr += letter2; |
115 | tmpStr += "</font></b></u>"; | 116 | tmpStr += "</font></b></u>"; |
116 | tmpStr += letter3; | 117 | tmpStr += letter3; |