author | hash <hash> | 2002-08-22 08:17:08 (UTC) |
---|---|---|
committer | hash <hash> | 2002-08-22 08:17:08 (UTC) |
commit | 79ab58b57c084256584fc391532e51de982a40bd (patch) (unidiff) | |
tree | 7931362a5a4bcef858a1a6a86e80162befe35f4b | |
parent | 2ff3290b552c575ff7222df29235651968f484aa (diff) | |
download | opie-79ab58b57c084256584fc391532e51de982a40bd.zip opie-79ab58b57c084256584fc391532e51de982a40bd.tar.gz opie-79ab58b57c084256584fc391532e51de982a40bd.tar.bz2 |
made color buttons more color-config-urable
-rw-r--r-- | inputmethods/multikey/configdlg.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/inputmethods/multikey/configdlg.cpp b/inputmethods/multikey/configdlg.cpp index 9ea59a4..9576579 100644 --- a/inputmethods/multikey/configdlg.cpp +++ b/inputmethods/multikey/configdlg.cpp | |||
@@ -119,120 +119,120 @@ ConfigDlg::ConfigDlg () : QTabWidget () | |||
119 | config.setGroup ("general"); | 119 | config.setGroup ("general"); |
120 | bool pick_open = config.readBoolEntry ("usePickboard", (bool)0); // default closed | 120 | bool pick_open = config.readBoolEntry ("usePickboard", (bool)0); // default closed |
121 | if (pick_open) { | 121 | if (pick_open) { |
122 | 122 | ||
123 | pick_button->setChecked(true); | 123 | pick_button->setChecked(true); |
124 | } | 124 | } |
125 | 125 | ||
126 | // by connecting it after checking it, the signal isn't emmited | 126 | // by connecting it after checking it, the signal isn't emmited |
127 | connect (pick_button, SIGNAL(clicked()), this, SLOT(pickTog())); | 127 | connect (pick_button, SIGNAL(clicked()), this, SLOT(pickTog())); |
128 | 128 | ||
129 | repeat_button = new QCheckBox(tr("Key Repeat"), other_grid); | 129 | repeat_button = new QCheckBox(tr("Key Repeat"), other_grid); |
130 | bool repeat_on = config.readBoolEntry ("useRepeat", (bool)1); | 130 | bool repeat_on = config.readBoolEntry ("useRepeat", (bool)1); |
131 | 131 | ||
132 | if (repeat_on) { | 132 | if (repeat_on) { |
133 | 133 | ||
134 | repeat_button->setChecked(true); | 134 | repeat_button->setChecked(true); |
135 | } | 135 | } |
136 | connect (repeat_button, SIGNAL(clicked()), this, SLOT(repeatTog())); | 136 | connect (repeat_button, SIGNAL(clicked()), this, SLOT(repeatTog())); |
137 | 137 | ||
138 | 138 | ||
139 | /* | 139 | /* |
140 | * 'color' tab | 140 | * 'color' tab |
141 | */ | 141 | */ |
142 | 142 | ||
143 | QGrid *color_box = new QGrid(2, this); | 143 | QGrid *color_box = new QGrid(2, this); |
144 | color_box->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); | 144 | color_box->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); |
145 | color_box->setMargin(3); | 145 | color_box->setMargin(3); |
146 | color_box->setSpacing(3); | 146 | color_box->setSpacing(3); |
147 | addTab(color_box, tr("Colors")); | 147 | addTab(color_box, tr("Colors")); |
148 | 148 | ||
149 | QLabel *label; | 149 | QLabel *label; |
150 | QStringList color; | 150 | QStringList color; |
151 | config.setGroup("colors"); | 151 | config.setGroup("colors"); |
152 | 152 | ||
153 | label = new QLabel(tr("Key Color"), color_box); | 153 | label = new QLabel(tr("Key Color"), color_box); |
154 | keycolor_button = new QPushButton(color_box); | 154 | keycolor_button = new QPushButton(color_box); |
155 | connect(keycolor_button, SIGNAL(clicked()), SLOT(keyColorClicked())); | 155 | connect(keycolor_button, SIGNAL(clicked()), SLOT(keyColorClicked())); |
156 | keycolor_button->setFlat((bool)1); | 156 | keycolor_button->setFlat((bool)1); |
157 | color = config.readListEntry("keycolor", QChar(',')); | 157 | color = config.readListEntry("keycolor", QChar(',')); |
158 | /* | 158 | /* |
159 | * hopefully not required | 159 | * hopefully not required |
160 | 160 | ||
161 | if (color.isEmpty()) { | 161 | if (color.isEmpty()) { |
162 | color = QStringList::split(",", "240,240,240"); | 162 | color = QStringList::split(",", "240,240,240"); |
163 | config.writeEntry("keycolor", color.join(",")); | 163 | config.writeEntry("keycolor", color.join(",")); |
164 | 164 | ||
165 | } | 165 | } |
166 | */ | 166 | */ |
167 | keycolor_button->setBackgroundColor(QColor(color[0].toInt(), color[1].toInt(), color[2].toInt())); | 167 | keycolor_button->setPalette(QPalette(QColor(color[0].toInt(), color[1].toInt(), color[2].toInt()))); |
168 | 168 | ||
169 | 169 | ||
170 | label = new QLabel(tr("Key Pressed Color"), color_box); | 170 | label = new QLabel(tr("Key Pressed Color"), color_box); |
171 | keycolor_pressed_button = new QPushButton(color_box); | 171 | keycolor_pressed_button = new QPushButton(color_box); |
172 | connect(keycolor_pressed_button, SIGNAL(clicked()), SLOT(keyColorPressedClicked())); | 172 | connect(keycolor_pressed_button, SIGNAL(clicked()), SLOT(keyColorPressedClicked())); |
173 | keycolor_pressed_button->setFlat((bool)1); | 173 | keycolor_pressed_button->setFlat((bool)1); |
174 | color = config.readListEntry("keycolor_pressed", QChar(',')); | 174 | color = config.readListEntry("keycolor_pressed", QChar(',')); |
175 | keycolor_pressed_button->setBackgroundColor(QColor(color[0].toInt(), color[1].toInt(), color[2].toInt())); | 175 | keycolor_pressed_button->setPalette(QPalette((QColor(color[0].toInt(), color[1].toInt(), color[2].toInt())))); |
176 | 176 | ||
177 | label = new QLabel(tr("Line Color"), color_box); | 177 | label = new QLabel(tr("Line Color"), color_box); |
178 | keycolor_lines_button = new QPushButton(color_box); | 178 | keycolor_lines_button = new QPushButton(color_box); |
179 | connect(keycolor_lines_button, SIGNAL(clicked()), SLOT(keyColorLinesClicked())); | 179 | connect(keycolor_lines_button, SIGNAL(clicked()), SLOT(keyColorLinesClicked())); |
180 | keycolor_lines_button->setFlat((bool)1); | 180 | keycolor_lines_button->setFlat((bool)1); |
181 | color = config.readListEntry("keycolor_lines", QChar(',')); | 181 | color = config.readListEntry("keycolor_lines", QChar(',')); |
182 | keycolor_lines_button->setBackgroundColor(QColor(color[0].toInt(), color[1].toInt(), color[2].toInt())); | 182 | keycolor_lines_button->setPalette(QPalette((QColor(color[0].toInt(), color[1].toInt(), color[2].toInt())))); |
183 | 183 | ||
184 | 184 | ||
185 | label = new QLabel(tr("Text Color"), color_box); | 185 | label = new QLabel(tr("Text Color"), color_box); |
186 | textcolor_button = new QPushButton(color_box); | 186 | textcolor_button = new QPushButton(color_box); |
187 | connect(textcolor_button, SIGNAL(clicked()), SLOT(textColorClicked())); | 187 | connect(textcolor_button, SIGNAL(clicked()), SLOT(textColorClicked())); |
188 | textcolor_button->setFlat((bool)1); | 188 | textcolor_button->setFlat((bool)1); |
189 | color = config.readListEntry("textcolor", QChar(',')); | 189 | color = config.readListEntry("textcolor", QChar(',')); |
190 | textcolor_button->setBackgroundColor(QColor(color[0].toInt(), color[1].toInt(), color[2].toInt())); | 190 | textcolor_button->setPalette(QPalette((QColor(color[0].toInt(), color[1].toInt(), color[2].toInt())))); |
191 | 191 | ||
192 | 192 | ||
193 | label = new QLabel("", color_box); // a spacer so the above buttons dont expand | 193 | label = new QLabel("", color_box); // a spacer so the above buttons dont expand |
194 | label->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)); | 194 | label->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)); |
195 | 195 | ||
196 | } | 196 | } |
197 | 197 | ||
198 | void ConfigDlg::pickTog() { | 198 | void ConfigDlg::pickTog() { |
199 | 199 | ||
200 | Config config ("multikey"); | 200 | Config config ("multikey"); |
201 | config.setGroup ("general"); | 201 | config.setGroup ("general"); |
202 | config.writeEntry ("usePickboard", pick_button->isChecked()); // default closed | 202 | config.writeEntry ("usePickboard", pick_button->isChecked()); // default closed |
203 | 203 | ||
204 | emit pickboardToggled(pick_button->isChecked()); | 204 | emit pickboardToggled(pick_button->isChecked()); |
205 | } | 205 | } |
206 | 206 | ||
207 | void ConfigDlg::repeatTog() { | 207 | void ConfigDlg::repeatTog() { |
208 | 208 | ||
209 | Config config ("multikey"); | 209 | Config config ("multikey"); |
210 | config.setGroup ("general"); | 210 | config.setGroup ("general"); |
211 | config.writeEntry ("useRepeat", repeat_button->isChecked()); // default closed | 211 | config.writeEntry ("useRepeat", repeat_button->isChecked()); // default closed |
212 | 212 | ||
213 | emit repeatToggled(repeat_button->isChecked()); | 213 | emit repeatToggled(repeat_button->isChecked()); |
214 | } | 214 | } |
215 | 215 | ||
216 | // ConfigDlg::setMap {{{1 | 216 | // ConfigDlg::setMap {{{1 |
217 | 217 | ||
218 | /* | 218 | /* |
219 | * the index is kinda screwy, because in the config file, index 0 is just the | 219 | * the index is kinda screwy, because in the config file, index 0 is just the |
220 | * first element in the QStringList, but here it's the "Current Language" | 220 | * first element in the QStringList, but here it's the "Current Language" |
221 | * listItem. therefor you have to minus one to the index before you access it. | 221 | * listItem. therefor you have to minus one to the index before you access it. |
222 | * | 222 | * |
223 | */ | 223 | */ |
224 | 224 | ||
225 | void ConfigDlg::setMap(int index) { | 225 | void ConfigDlg::setMap(int index) { |
226 | 226 | ||
227 | if (index == 0) { | 227 | if (index == 0) { |
228 | 228 | ||
229 | remove_button->setDisabled(true); | 229 | remove_button->setDisabled(true); |
230 | emit setMapToDefault(); | 230 | emit setMapToDefault(); |
231 | } | 231 | } |
232 | else if ((uint)index <= default_maps.count()) { | 232 | else if ((uint)index <= default_maps.count()) { |
233 | 233 | ||
234 | remove_button->setDisabled(true); | 234 | remove_button->setDisabled(true); |
235 | emit setMapToFile(keymaps->text(index)); | 235 | emit setMapToFile(keymaps->text(index)); |
236 | 236 | ||
237 | } else { | 237 | } else { |
238 | 238 | ||