Diffstat (limited to 'core/pim/addressbook/picker.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/pim/addressbook/picker.cpp | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/core/pim/addressbook/picker.cpp b/core/pim/addressbook/picker.cpp index a165451..7f4acb0 100644 --- a/core/pim/addressbook/picker.cpp +++ b/core/pim/addressbook/picker.cpp | |||
@@ -72,24 +72,33 @@ void PickerLabel::clearLetter() | |||
72 | setText(tmpStr); | 72 | setText(tmpStr); |
73 | 73 | ||
74 | currentLetter = 0; | 74 | currentLetter = 0; |
75 | 75 | ||
76 | } | 76 | } |
77 | 77 | ||
78 | void PickerLabel::mouseReleaseEvent( QMouseEvent *e ) | 78 | void PickerLabel::mousePressEvent( QMouseEvent* e ) |
79 | { | ||
80 | // If one pickerlabel is was, and an other is now selected, we | ||
81 | // have to simulate the releaseevent.. Otherwise the new label | ||
82 | // will not get a highlighted letter.. | ||
83 | // Maybe there is a more intelligent solution, but this works and I am tired.. (se) | ||
84 | if ( ( currentLetter == 0 ) && ( lastLetter != '\0' ) ) mouseReleaseEvent( e ); | ||
85 | } | ||
86 | |||
87 | void PickerLabel::mouseReleaseEvent( QMouseEvent* /* e */ ) | ||
79 | { | 88 | { |
80 | QString tmpStr; | 89 | QString tmpStr; |
81 | 90 | ||
82 | if (lastLetter != letter1 && lastLetter != letter2 && lastLetter != letter3 && lastLetter != '\0') | 91 | if (lastLetter != letter1 && lastLetter != letter2 && lastLetter != letter3 && lastLetter != '\0') |
83 | QTimer::singleShot( 0, this, SLOT(emitClearSignal()) ); | 92 | QTimer::singleShot( 0, this, SLOT(emitClearSignal()) ); |
84 | 93 | ||
85 | switch (currentLetter) { | 94 | switch (currentLetter) { |
86 | case 0: | 95 | case 0: |
87 | tmpStr = "<qt><font color=\"#7F0000\">"; | 96 | tmpStr = "<qt><u><font color=\"#7F0000\">"; |
88 | tmpStr += letter1; | 97 | tmpStr += letter1; |
89 | tmpStr += "</font>"; | 98 | tmpStr += "</font></u>"; |
90 | tmpStr += letter2; | 99 | tmpStr += letter2; |
91 | tmpStr += letter3; | 100 | tmpStr += letter3; |
92 | tmpStr += "</qt>"; | 101 | tmpStr += "</qt>"; |
93 | 102 | ||
94 | setText(tmpStr); | 103 | setText(tmpStr); |
95 | 104 | ||
@@ -98,15 +107,15 @@ void PickerLabel::mouseReleaseEvent( QMouseEvent *e ) | |||
98 | emit selectedLetter( letter1 ); | 107 | emit selectedLetter( letter1 ); |
99 | break; | 108 | break; |
100 | 109 | ||
101 | case 1: | 110 | case 1: |
102 | tmpStr = "<qt>"; | 111 | tmpStr = "<qt>"; |
103 | tmpStr += letter1; | 112 | tmpStr += letter1; |
104 | tmpStr += "<font color=\"#7F0000\">"; | 113 | tmpStr += "<u><font color=\"#7F0000\">"; |
105 | tmpStr += letter2; | 114 | tmpStr += letter2; |
106 | tmpStr += "</font>"; | 115 | tmpStr += "</font></u>"; |
107 | tmpStr += letter3; | 116 | tmpStr += letter3; |
108 | tmpStr += "</qt>"; | 117 | tmpStr += "</qt>"; |
109 | 118 | ||
110 | setText(tmpStr); | 119 | setText(tmpStr); |
111 | 120 | ||
112 | currentLetter++; | 121 | currentLetter++; |
@@ -115,15 +124,15 @@ void PickerLabel::mouseReleaseEvent( QMouseEvent *e ) | |||
115 | break; | 124 | break; |
116 | 125 | ||
117 | case 2: | 126 | case 2: |
118 | tmpStr = "<qt>"; | 127 | tmpStr = "<qt>"; |
119 | tmpStr += letter1; | 128 | tmpStr += letter1; |
120 | tmpStr += letter2; | 129 | tmpStr += letter2; |
121 | tmpStr += "<font color=\"#7F0000\">"; | 130 | tmpStr += "<u><font color=\"#7F0000\">"; |
122 | tmpStr += letter3; | 131 | tmpStr += letter3; |
123 | tmpStr += "</font></qt>"; | 132 | tmpStr += "</font></u></qt>"; |
124 | 133 | ||
125 | setText(tmpStr); | 134 | setText(tmpStr); |
126 | 135 | ||
127 | currentLetter++; | 136 | currentLetter++; |
128 | lastLetter = letter3; | 137 | lastLetter = letter3; |
129 | emit selectedLetter( letter3 ); | 138 | emit selectedLetter( letter3 ); |
@@ -221,9 +230,10 @@ void LetterPicker::clear() | |||
221 | lblVWX->clearLetter(); | 230 | lblVWX->clearLetter(); |
222 | lblYZ->clearLetter(); | 231 | lblYZ->clearLetter(); |
223 | } | 232 | } |
224 | 233 | ||
225 | void LetterPicker::newLetter( char letter ) | 234 | void LetterPicker::newLetter( char letter ) |
226 | { | 235 | { |
236 | qWarning("LetterClicked"); | ||
227 | emit letterClicked( letter ); | 237 | emit letterClicked( letter ); |
228 | 238 | ||
229 | } | 239 | } |