Rev 10859 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
10355 | subik | 1 | /* |
2 | For general Scribus (>=1.3.2) copyright and licensing information please refer |
||
3 | to the COPYING file provided with the program. Following this notice may exist |
||
4 | a copyright and/or license notice that predates the release of Scribus 1.3.2 |
||
5 | for which a new license (GPL+exception) is in place. |
||
6 | */ |
||
10859 | cbradney | 7 | |
8 | #include <QEvent> |
||
9 | |||
10355 | subik | 10 | #include "smcstylewidget.h" |
11 | #include "util_icon.h" |
||
12 | #include "util.h" |
||
13 | #include "units.h" |
||
14 | |||
15 | |||
16 | SMCStyleWidget::SMCStyleWidget(QWidget *parent) : QWidget() |
||
17 | { |
||
18 | setupUi(this); |
||
19 | |||
10379 | subik | 20 | // fontSize_->setMinimum(1.0); |
21 | // fontSize_->setMaximum(2048.0); |
||
10355 | subik | 22 | fontSizeLabel_->setPixmap(loadIcon("Zeichen.xpm")); |
23 | |||
24 | trackingLabel_->setPixmap( loadIcon("textkern.png") ); |
||
10379 | subik | 25 | // tracking_->setMinimum(-300.0); |
26 | // tracking_->setMaximum(300.0); |
||
27 | // tracking_->setSuffix( tr( " %" ) ); |
||
10355 | subik | 28 | |
29 | baselineOffsetLabel_->setPixmap( loadIcon("textbase.png") ); |
||
10379 | subik | 30 | // baselineOffset_->setMinimum(-100.0); |
31 | // baselineOffset_->setMaximum(100.0); |
||
32 | // baselineOffset_->setSuffix( tr( " %" ) ); |
||
10355 | subik | 33 | |
34 | hscaleLabel_->setPixmap( loadIcon("textscaleh.png") ); |
||
10379 | subik | 35 | // fontHScale_->setMinimum(10.0); |
36 | // fontHScale_->setMaximum(400.0); |
||
37 | // fontHScale_->setSuffix( tr( " %" ) ); |
||
10355 | subik | 38 | |
39 | vscaleLabel_->setPixmap( loadIcon("textscalev.png") ); |
||
10379 | subik | 40 | // fontVScale_->setMinimum(10.0); |
41 | // fontVScale_->setMaximum(400.0); |
||
42 | // fontVScale_->setSuffix( tr( " %" ) ); |
||
10355 | subik | 43 | |
44 | FillIcon->setPixmap(loadIcon("16/color-fill.png")); |
||
45 | fillShadeLabel->setPixmap( loadIcon("shade.png") ); |
||
46 | StrokeIcon->setPixmap(loadIcon("16/color-stroke.png")); |
||
47 | strokeShadeLabel->setPixmap( loadIcon("shade.png") ); |
||
48 | |||
49 | fillColor_->clear(); |
||
50 | strokeColor_->clear(); |
||
51 | ColorList::Iterator it; |
||
52 | QPixmap pm = QPixmap(15, 15); |
||
10585 | fschmid | 53 | fillColor_->addItem(CommonStrings::tr_NoneColor); |
54 | strokeColor_->addItem(CommonStrings::tr_NoneColor); |
||
10355 | subik | 55 | StrokeIcon->setEnabled(false); |
56 | strokeShade_->setEnabled(false); |
||
57 | strokeColor_->setEnabled(false); |
||
58 | |||
59 | connect(effects_, SIGNAL(State(int)), this, SLOT(slotColorChange())); |
||
60 | } |
||
61 | |||
10859 | cbradney | 62 | void SMCStyleWidget::changeEvent(QEvent *e) |
63 | { |
||
64 | if (e->type() == QEvent::LanguageChange) |
||
65 | { |
||
66 | languageChange(); |
||
67 | } |
||
10903 | cbradney | 68 | else |
69 | QWidget::changeEvent(e); |
||
10859 | cbradney | 70 | } |
71 | |||
10355 | subik | 72 | void SMCStyleWidget::languageChange() |
73 | { |
||
74 | /***********************************/ |
||
75 | /* Begin Tooltips */ |
||
76 | /***********************************/ |
||
77 | // These are for the character style page |
||
78 | // as in character styles and in paragraph style's character style |
||
79 | |||
10397 | cbradney | 80 | parentCombo->setToolTip( tr("Parent style")); |
81 | fontFace_->setToolTip( tr("Font face")); |
||
82 | fontSize_->setToolTip( tr("Font size")); |
||
83 | tracking_->setToolTip( tr("Tracking")); |
||
84 | baselineOffset_->setToolTip( tr("Baseline offset")); |
||
85 | fontHScale_->setToolTip( tr("Horizontal scaling")); |
||
86 | fontVScale_->setToolTip( tr("Vertical scaling")); |
||
87 | language_->setToolTip( tr("Language")); |
||
88 | fillColor_->setToolTip( tr("Fill color")); |
||
89 | fillShade_->setToolTip( tr("Fill shade")); |
||
90 | strokeColor_->setToolTip( tr("Stroke color")); |
||
91 | strokeShade_->setToolTip( tr("Stroke shade")); |
||
10355 | subik | 92 | |
93 | /***********************************/ |
||
94 | /* End Tooltips */ |
||
95 | /***********************************/ |
||
96 | |||
97 | parentLabel->setText( tr("Based On:")); |
||
98 | languageLabel_->setText( tr("Language:")); |
||
10379 | subik | 99 | // fontVScale_->setSuffix( tr(" %")); |
100 | // fontHScale_->setSuffix( tr(" %")); |
||
101 | // baselineOffset_->setSuffix( tr(" %")); |
||
102 | // tracking_->setSuffix( tr(" %")); |
||
10355 | subik | 103 | fontSize_->setSuffix(unitGetSuffixFromIndex(0)); |
104 | } |
||
105 | |||
106 | void SMCStyleWidget::fillLangCombo(QMap<QString,QString> langMap) |
||
107 | { |
||
108 | QStringList sortList; |
||
109 | QMap<QString,QString>::Iterator it; |
||
110 | |||
111 | langMap_ = langMap; |
||
112 | |||
113 | language_->clear(); |
||
114 | |||
115 | for (it = langMap.begin(); it != langMap.end(); ++it) |
||
10516 | cbradney | 116 | sortList.push_back(it.value()); |
10355 | subik | 117 | |
10585 | fschmid | 118 | language_->addItems(sortQStringList(sortList)); |
10355 | subik | 119 | |
120 | QListView *tmpView = dynamic_cast<QListView*>(language_->view()); Q_ASSERT(tmpView); |
||
121 | int tmpWidth = tmpView->sizeHintForColumn(0); |
||
122 | if (tmpWidth > 0) |
||
123 | tmpView->setMinimumWidth(tmpWidth + 24); |
||
124 | } |
||
125 | |||
126 | void SMCStyleWidget::fillColorCombo(ColorList &colors) |
||
127 | { |
||
128 | fillColor_->clear(); |
||
129 | strokeColor_->clear(); |
||
130 | |||
10585 | fschmid | 131 | fillColor_->addItem(CommonStrings::tr_NoneColor); |
132 | strokeColor_->addItem(CommonStrings::tr_NoneColor); |
||
10355 | subik | 133 | ColorList::Iterator itend=colors.end(); |
134 | ScribusDoc* doc = colors.document(); |
||
135 | for (ColorList::Iterator it = colors.begin(); it != itend; ++it) |
||
136 | { |
||
10516 | cbradney | 137 | fillColor_->insertSmallItem(it.value(), doc, it.key()); |
138 | strokeColor_->insertSmallItem(it.value(), doc, it.key()); |
||
10355 | subik | 139 | } |
140 | fillColor_->view()->setMinimumWidth(fillColor_->view()->maximumViewportSize().width()+24); |
||
141 | strokeColor_->view()->setMinimumWidth(strokeColor_->view()->maximumViewportSize().width()+24); |
||
142 | } |
||
143 | |||
144 | void SMCStyleWidget::show(CharStyle *cstyle, QList<CharStyle> &cstyles, const QString &defLang, int unitIndex) |
||
145 | { |
||
146 | disconnect(effects_, SIGNAL(State(int)), this, SLOT(slotColorChange())); |
||
147 | parentCombo->setEnabled(true); |
||
148 | const CharStyle *parent = dynamic_cast<const CharStyle*>(cstyle->parentStyle()); |
||
149 | bool hasParent = cstyle->hasParent() && parent != 0 && parent->hasName() && cstyle->parent() != ""; |
||
150 | if (hasParent) |
||
151 | { |
||
152 | fontSize_->setValue(cstyle->fontSize() / 10.0, cstyle->isInhFontSize()); |
||
153 | fontSize_->setParentValue(parent->fontSize() / 10.0); |
||
154 | |||
155 | fontHScale_->setValue(cstyle->scaleH() / 10.0, cstyle->isInhScaleH()); |
||
156 | fontHScale_->setParentValue(parent->scaleH() / 10.0); |
||
157 | |||
158 | fontVScale_->setValue(cstyle->scaleV() / 10.0, cstyle->isInhScaleV()); |
||
159 | fontVScale_->setParentValue(parent->scaleV() / 10.0); |
||
160 | |||
161 | baselineOffset_->setValue(cstyle->baselineOffset() / 10.0, cstyle->isInhBaselineOffset()); |
||
162 | baselineOffset_->setParentValue(parent->baselineOffset() / 10.0); |
||
163 | |||
164 | tracking_->setValue(cstyle->tracking() / 10.0, cstyle->isInhTracking()); |
||
165 | tracking_->setParentValue(parent->tracking() / 10.0); |
||
166 | |||
167 | effects_->setStyle(static_cast<int>(cstyle->effects()), cstyle->isInhFeatures()); |
||
168 | effects_->setParentItem(static_cast<int>(parent->effects())); // FIXME |
||
169 | |||
170 | fillShade_->setValue(qRound(cstyle->fillShade()), cstyle->isInhFillShade()); |
||
171 | fillShade_->setParentValue(qRound(parent->fillShade())); |
||
172 | |||
173 | strokeShade_->setValue(qRound(cstyle->strokeShade()), cstyle->isInhStrokeShade()); |
||
174 | strokeShade_->setParentValue(qRound(parent->strokeShade())); |
||
175 | |||
176 | fillColor_->setCurrentText(cstyle->fillColor(), cstyle->isInhFillColor()); |
||
177 | fillColor_->setParentText(parent->fillColor()); |
||
178 | |||
179 | strokeColor_->setCurrentText(cstyle->strokeColor(), cstyle->isInhStrokeColor()); |
||
180 | strokeColor_->setParentText(parent->strokeColor()); |
||
181 | |||
182 | fontFace_->setCurrentFont(cstyle->font().scName(), cstyle->isInhFont()); |
||
183 | fontFace_->setParentFont(parent->font().scName()); |
||
184 | } |
||
185 | else |
||
186 | { |
||
187 | fontSize_->setValue(cstyle->fontSize() / 10.0); |
||
188 | fontHScale_->setValue(cstyle->scaleH() / 10.0); |
||
189 | fontVScale_->setValue(cstyle->scaleV() / 10.0); |
||
190 | baselineOffset_->setValue(cstyle->baselineOffset() / 10.0); |
||
191 | tracking_->setValue(cstyle->tracking() / 10.0); |
||
192 | effects_->setStyle(static_cast<int>(cstyle->effects())); |
||
193 | fillShade_->setValue(qRound(cstyle->fillShade())); |
||
194 | strokeShade_->setValue(qRound(cstyle->strokeShade())); |
||
195 | fillColor_->setCurrentText(cstyle->fillColor()); |
||
196 | strokeColor_->setCurrentText(cstyle->strokeColor()); |
||
197 | fontFace_->setCurrentFont(cstyle->font().scName()); |
||
198 | } |
||
199 | |||
200 | effects_->ShadowVal->Xoffset->setValue(cstyle->shadowXOffset() / 10.0); |
||
201 | effects_->ShadowVal->Yoffset->setValue(cstyle->shadowYOffset() / 10.0); |
||
202 | effects_->OutlineVal->LWidth->setValue(cstyle->outlineWidth() / 10.0); |
||
203 | effects_->StrikeVal->LPos->setValue(cstyle->strikethruOffset() / 10.0); |
||
204 | effects_->StrikeVal->LWidth->setValue(cstyle->strikethruWidth() / 10.0); |
||
205 | effects_->UnderlineVal->LPos->setValue(cstyle->underlineOffset() / 10.0); |
||
206 | effects_->UnderlineVal->LWidth->setValue(cstyle->underlineWidth() / 10.0); |
||
207 | slotColorChange(); |
||
208 | |||
209 | parentCombo->clear(); |
||
10585 | fschmid | 210 | parentCombo->addItem(""); |
10355 | subik | 211 | for (int i = 0; i < cstyles.count(); ++i) |
212 | { |
||
213 | if (cstyles[i].name() != cstyle->name()) |
||
10585 | fschmid | 214 | parentCombo->addItem(cstyles[i].name()); |
10355 | subik | 215 | } |
216 | |||
217 | if (hasParent) |
||
218 | { |
||
219 | int index = 0; |
||
220 | for (int i = 0; i < parentCombo->count(); ++i) |
||
221 | { |
||
10585 | fschmid | 222 | if (parentCombo->itemText(i) == cstyle->parentStyle()->name()) |
10355 | subik | 223 | { |
224 | index = i; |
||
225 | break; |
||
226 | } |
||
227 | } |
||
10585 | fschmid | 228 | parentCombo->setCurrentIndex(index); |
10355 | subik | 229 | } |
230 | else |
||
10585 | fschmid | 231 | parentCombo->setCurrentIndex(0); |
10355 | subik | 232 | |
233 | QString clang = cstyle->language().isNull() || cstyle->language().isEmpty() ? |
||
234 | defLang : cstyle->language(); |
||
235 | QString plang(QString::null); |
||
236 | if (hasParent) |
||
237 | plang = parent->language().isNull() || parent->language().isEmpty() ? |
||
238 | defLang : parent->language(); |
||
239 | |||
240 | int ci = -1, pi = -1, di = -1; |
||
241 | for (int i = 0; i < language_->count(); ++i) |
||
242 | { |
||
10585 | fschmid | 243 | if (language_->itemText(i) == langMap_[clang]) |
10355 | subik | 244 | ci = i; |
245 | |||
10585 | fschmid | 246 | if (hasParent && language_->itemText(i) == langMap_[plang]) |
10355 | subik | 247 | pi = i; |
248 | |||
10585 | fschmid | 249 | if (language_->itemText(i) == defLang || language_->itemText(i) == langMap_[defLang]) |
10355 | subik | 250 | di = i; |
251 | } |
||
252 | |||
253 | // qDebug(QString("SMCStyleWidget::show(): deflan='%1'->'%2'").arg(defLang).arg(langMap_[defLang])); |
||
254 | Q_ASSERT(di != -1); |
||
255 | |||
256 | if (hasParent) |
||
257 | { |
||
258 | if (ci == -1) |
||
259 | language_->setCurrentItem(di, cstyle->isInhLanguage()); |
||
260 | else |
||
261 | language_->setCurrentItem(ci, cstyle->isInhLanguage()); |
||
262 | |||
263 | language_->setParentItem(pi); |
||
264 | } |
||
265 | else |
||
266 | { |
||
267 | if (ci == -1) |
||
10585 | fschmid | 268 | language_->setCurrentIndex(di); |
10355 | subik | 269 | else |
10585 | fschmid | 270 | language_->setCurrentIndex(ci); |
10355 | subik | 271 | } |
272 | |||
273 | connect(effects_, SIGNAL(State(int)), this, SLOT(slotColorChange())); |
||
274 | } |
||
275 | |||
276 | void SMCStyleWidget::show(QList<CharStyle*> &cstyles, QList<CharStyle> &cstylesAll, const QString &defLang, int unitIndex) |
||
277 | { |
||
278 | // int decimals = unitGetDecimalsFromIndex(unitIndex); |
||
279 | // QString suffix = unitGetSuffixFromIndex(unitIndex); |
||
280 | |||
281 | if (cstyles.count() == 1) |
||
282 | show(cstyles[0], cstylesAll, defLang, unitIndex); |
||
283 | else if (cstyles.count() > 1) |
||
284 | { |
||
285 | showSizeAndPosition(cstyles); |
||
286 | showEffects(cstyles); |
||
287 | showColors(cstyles); |
||
288 | showLanguage(cstyles, defLang); |
||
289 | showParent(cstyles); |
||
290 | } |
||
291 | } |
||
292 | |||
293 | void SMCStyleWidget::showSizeAndPosition(const QList<CharStyle*> &cstyles) |
||
294 | { |
||
295 | double d = -30000; |
||
296 | for (int i = 0; i < cstyles.count(); ++i) |
||
297 | { |
||
298 | if (d != -30000 && cstyles[i]->fontSize() != d) |
||
299 | { |
||
300 | d = -30000; |
||
301 | break; |
||
302 | } |
||
303 | else |
||
304 | d = cstyles[i]->fontSize(); |
||
305 | } |
||
306 | if (d == -30000) |
||
307 | fontSize_->clear(); |
||
308 | else |
||
309 | fontSize_->setValue(d / 10.0); |
||
310 | |||
311 | d = -30000; |
||
312 | for (int i = 0; i < cstyles.count(); ++i) |
||
313 | { |
||
314 | if (d != -30000 && cstyles[i]->scaleH() != d) |
||
315 | { |
||
316 | d = -30000; |
||
317 | break; |
||
318 | } |
||
319 | else |
||
320 | d = cstyles[i]->scaleH(); |
||
321 | } |
||
322 | if (d == -30000) |
||
323 | fontHScale_->clear(); |
||
324 | else |
||
325 | fontHScale_->setValue(d / 10.0); |
||
326 | |||
327 | d = -30000; |
||
328 | for (int i = 0; i < cstyles.count(); ++i) |
||
329 | { |
||
330 | if (d != -30000 && cstyles[i]->scaleV() != d) |
||
331 | { |
||
332 | d = -30000; |
||
333 | break; |
||
334 | } |
||
335 | else |
||
336 | d = cstyles[i]->scaleV(); |
||
337 | } |
||
338 | if (d == -30000) |
||
339 | fontVScale_->clear(); |
||
340 | else |
||
341 | fontVScale_->setValue(d / 10.0); |
||
342 | |||
343 | d = -30000; |
||
344 | for (int i = 0; i < cstyles.count(); ++i) |
||
345 | { |
||
346 | if (d != -30000 && cstyles[i]->baselineOffset() != d) |
||
347 | { |
||
348 | d = -30000; |
||
349 | break; |
||
350 | } |
||
351 | else |
||
352 | d = cstyles[i]->baselineOffset(); |
||
353 | } |
||
354 | if (d == -30000) |
||
355 | baselineOffset_->clear(); |
||
356 | else |
||
357 | baselineOffset_->setValue(d / 10.0); |
||
358 | |||
359 | d = -30000; |
||
360 | for (int i = 0; i < cstyles.count(); ++i) |
||
361 | { |
||
362 | if (d != -30000 && cstyles[i]->tracking() != d) |
||
363 | { |
||
364 | d = -30000; |
||
365 | break; |
||
366 | } |
||
367 | else |
||
368 | d = cstyles[i]->tracking(); |
||
369 | } |
||
370 | if (d == -30000) |
||
371 | tracking_->clear(); |
||
372 | else |
||
373 | tracking_->setValue(d / 10.0); |
||
374 | } |
||
375 | |||
376 | void SMCStyleWidget::showEffects(const QList<CharStyle*> &cstyles) |
||
377 | { |
||
378 | int d = -30000; |
||
379 | for (int i = 0; i < cstyles.count(); ++i) |
||
380 | { |
||
381 | if (d != -30000 && static_cast<int>(cstyles[i]->effects()) != d) |
||
382 | { |
||
383 | d = -30000; |
||
384 | break; |
||
385 | } |
||
386 | else |
||
387 | d = static_cast<int>(cstyles[i]->effects()); |
||
388 | } |
||
389 | if (d == -30000) |
||
390 | effects_->setStyle(0); |
||
391 | else |
||
392 | effects_->setStyle(d); |
||
393 | |||
394 | // TODO these things still missing: |
||
395 | // effects_->ShadowVal->Xoffset->setValue(cstyle->shadowXOffset() / 10.0); |
||
396 | // effects_->ShadowVal->Yoffset->setValue(cstyle->shadowYOffset() / 10.0); |
||
397 | // effects_->OutlineVal->LWidth->setValue(cstyle->outlineWidth() / 10.0); |
||
398 | // effects_->StrikeVal->LPos->setValue(cstyle->strikethruOffset() / 10.0); |
||
399 | // effects_->StrikeVal->LWidth->setValue(cstyle->strikethruWidth() / 10.0); |
||
400 | // effects_->UnderlineVal->LPos->setValue(cstyle->underlineOffset() / 10.0); |
||
401 | // effects_->UnderlineVal->LWidth->setValue(cstyle->underlineWidth() / 10.0); |
||
402 | } |
||
403 | |||
404 | void SMCStyleWidget::showColors(const QList<CharStyle*> &cstyles) |
||
405 | { |
||
406 | strokeShade_->setEnabled(true); |
||
407 | strokeColor_->setEnabled(true); |
||
408 | |||
409 | double d = -30000; |
||
410 | for (int i = 0; i < cstyles.count(); ++i) |
||
411 | { |
||
412 | if (d != -30000 && cstyles[i]->fillShade() != d) |
||
413 | { |
||
414 | d = -30000; |
||
415 | break; |
||
416 | } |
||
417 | else |
||
418 | d = cstyles[i]->fillShade(); |
||
419 | } |
||
420 | if (d == -30000) |
||
421 | fillShade_->setText( tr("Shade")); |
||
422 | else |
||
423 | fillShade_->setValue(qRound(d)); |
||
424 | |||
425 | d = -30000; |
||
426 | for (int i = 0; i < cstyles.count(); ++i) |
||
427 | { |
||
428 | if (d != -30000 && cstyles[i]->strokeShade() != d) |
||
429 | { |
||
430 | d = -30000; |
||
431 | break; |
||
432 | } |
||
433 | else |
||
434 | d = cstyles[i]->strokeShade(); |
||
435 | } |
||
436 | if (d == -30000) |
||
437 | { |
||
438 | strokeShade_->setValue(21); |
||
439 | strokeShade_->setText( tr("Shade")); |
||
440 | } |
||
441 | else |
||
442 | strokeShade_->setValue(qRound(d)); |
||
443 | |||
444 | QString s; |
||
445 | QString emptyString; |
||
446 | for (int i = 0; i < cstyles.count(); ++i) |
||
447 | { |
||
448 | if (!s.isNull() && s != cstyles[i]->fillColor()) |
||
449 | { |
||
450 | s = emptyString; |
||
451 | break; |
||
452 | } |
||
453 | else |
||
454 | s = cstyles[i]->fillColor(); |
||
455 | } |
||
456 | if (s.isEmpty()) |
||
457 | { |
||
10585 | fschmid | 458 | if (fillColor_->itemText(fillColor_->count() - 1) != "") |
459 | fillColor_->addItem(""); |
||
460 | fillColor_->setCurrentIndex(fillColor_->count() - 1); |
||
10355 | subik | 461 | } |
462 | else |
||
463 | fillColor_->setCurrentText(s); |
||
464 | |||
465 | s = emptyString; |
||
466 | for (int i = 0; i < cstyles.count(); ++i) |
||
467 | { |
||
468 | if (!s.isNull() && s != cstyles[i]->strokeColor()) |
||
469 | { |
||
470 | s = emptyString; |
||
471 | break; |
||
472 | } |
||
473 | else |
||
474 | s = cstyles[i]->strokeColor(); |
||
475 | } |
||
476 | if (s.isEmpty()) |
||
477 | { |
||
10585 | fschmid | 478 | if (strokeColor_->itemText(strokeColor_->count() - 1) != "") |
479 | strokeColor_->addItem(""); |
||
480 | strokeColor_->setCurrentIndex(fillColor_->count() - 1); |
||
10355 | subik | 481 | } |
482 | else |
||
483 | strokeColor_->setCurrentText(s); |
||
484 | } |
||
485 | |||
486 | void SMCStyleWidget::showLanguage(const QList<CharStyle*> &cstyles, const QString &defLang) |
||
487 | { |
||
488 | QString emptyString; |
||
489 | QString s(cstyles[0]->language()); |
||
490 | for (int i = 0; i < cstyles.count(); ++i) |
||
491 | { |
||
492 | if (s != cstyles[i]->language()) |
||
493 | { |
||
494 | s = emptyString; |
||
495 | break; |
||
496 | } |
||
497 | else |
||
498 | s = cstyles[i]->language(); |
||
499 | } |
||
500 | |||
501 | if (s.isEmpty()) |
||
502 | { |
||
10585 | fschmid | 503 | if (language_->itemText(language_->count() - 1) != "") |
504 | language_->addItem(""); |
||
505 | language_->setCurrentIndex(language_->count() - 1); |
||
10355 | subik | 506 | } |
507 | else |
||
508 | { |
||
509 | Q_ASSERT(langMap_.contains(s)); |
||
10648 | fschmid | 510 | setCurrentComboItem(language_, langMap_[s]); |
10355 | subik | 511 | } |
512 | } |
||
513 | |||
514 | void SMCStyleWidget::showParent(const QList<CharStyle*> &cstyles) |
||
515 | { |
||
516 | parentCombo->setEnabled(false); |
||
517 | } |
||
518 | |||
519 | void SMCStyleWidget::clearAll() |
||
520 | { |
||
521 | |||
522 | } |
||
523 | |||
524 | void SMCStyleWidget::slotColorChange() |
||
525 | { |
||
526 | int s = effects_->getStyle(); |
||
527 | bool enabled; |
||
528 | if ((s & 4) || (s & 256)) |
||
529 | enabled = true; |
||
530 | else |
||
531 | enabled = false; |
||
532 | StrokeIcon->setEnabled(enabled); |
||
533 | strokeShade_->setEnabled(enabled); |
||
534 | strokeColor_->setEnabled(enabled); |
||
535 | } |
||
536 | |||
537 | |||
538 | SMCStyleWidget::~SMCStyleWidget() |
||
539 | { |
||
540 | |||
541 | } |