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