1 #pragma once
2 
3 #ifndef STYLEEDITOR_H
4 #define STYLEEDITOR_H
5 
6 // TnzCore includes
7 #include "tcommon.h"
8 #include "tfilepath.h"
9 #include "tpixel.h"
10 #include "tpalette.h"
11 #include "saveloadqsettings.h"
12 
13 // TnzLib includes
14 #include "toonz/tpalettehandle.h"
15 #include "toonz/txshlevelhandle.h"
16 #include "toonz/txshlevel.h"
17 
18 // TnzQt includes
19 #include "toonzqt/checkbox.h"
20 #include "toonzqt/intfield.h"
21 #include "toonzqt/doublefield.h"
22 #include "toonzqt/colorfield.h"
23 #include "toonzqt/tabbar.h"
24 #include "toonzqt/glwidget_for_highdpi.h"
25 
26 // Qt includes
27 #include <QWidget>
28 #include <QFrame>
29 #include <QTabBar>
30 #include <QSlider>
31 #include <QToolButton>
32 #include <QScrollArea>
33 #include <QMouseEvent>
34 #include <QPointF>
35 #include <QSettings>
36 #include <QSplitter>
37 
38 #undef DVAPI
39 #undef DVVAR
40 #ifdef TOONZQT_EXPORTS
41 #define DVAPI DV_EXPORT_API
42 #define DVVAR DV_EXPORT_VAR
43 #else
44 #define DVAPI DV_IMPORT_API
45 #define DVVAR DV_IMPORT_VAR
46 #endif
47 
48 //=============================================
49 
50 //    Forward declarations
51 
52 class TColorStyle;
53 class TPalette;
54 
55 class TXshLevelHandle;
56 class PaletteController;
57 
58 class QGridLayout;
59 class QLabel;
60 class QStackedWidget;
61 class QSlider;
62 class QRadioButton;
63 class QButtonGroup;
64 class QPushButton;
65 class QTabWidget;
66 class QToolBar;
67 class QOpenGLFramebufferObject;
68 
69 class ColorSquaredWheel;
70 class TabBarContainter;
71 class StyleChooser;
72 class StyleEditor;
73 class LutCalibrator;
74 
75 //=============================================
76 
77 //=============================================================================
78 namespace StyleEditorGUI {
79 //=============================================================================
80 
81 enum ColorChannel {
82   eRed = 0,
83   eGreen,
84   eBlue,
85   eAlpha,
86   eHue,
87   eSaturation,
88   eValue
89 };
90 
91 //=============================================================================
92 /*! \brief The ColorModel provides an object to manage color change and
93                 its transformation from rgb value to hsv value and vice versa.
94 
95                 This object change color using its rgb channel or its hsv
96    channel;
97                 if you change a color channel class assure you that other
98    channel not change.
99 */
100 class DVAPI ColorModel {
101   int m_channels[7];
102   void rgb2hsv();
103   void hsv2rgb();
104 
105 public:
106   ColorModel();
107 
108   void setTPixel(const TPixel32 &color);
109   TPixel32 getTPixel() const;
110 
111   void setValue(ColorChannel channel, int value);
112   void setValues(ColorChannel channel, int u, int v);
113   int getValue(ColorChannel channel) const;
114   void getValues(ColorChannel channel, int &u, int &v);
115 
r()116   inline int r() const { return m_channels[0]; }
g()117   inline int g() const { return m_channels[1]; }
b()118   inline int b() const { return m_channels[2]; }
a()119   inline int a() const { return m_channels[3]; }
h()120   inline int h() const { return m_channels[4]; }
s()121   inline int s() const { return m_channels[5]; }
v()122   inline int v() const { return m_channels[6]; }
123 
124   bool operator==(const ColorModel &cm) {
125     int i;
126     for (i = 0; i < 7; i++)
127       if (m_channels[i] != cm.getValue(ColorChannel(i))) return false;
128     return true;
129   }
130 };
131 
132 //=============================================
133 
134 enum CurrentWheel { none, leftWheel, rightTriangle };
135 
136 class DVAPI HexagonalColorWheel final : public GLWidgetForHighDpi {
137   Q_OBJECT
138 
139   // backgoround color (R160, G160, B160)
140   QColor m_bgColor;
141   Q_PROPERTY(QColor BGColor READ getBGColor WRITE setBGColor)
142 
143   ColorModel m_color;
144   QPointF m_wheelPosition;
145   float m_triEdgeLen;
146   float m_triHeight;
147   QPointF m_wp[7], m_leftp[3];
148 
149   CurrentWheel m_currentWheel;
150 
151   // used for color calibration with 3DLUT
152   QOpenGLFramebufferObject *m_fbo = NULL;
153   LutCalibrator *m_lutCalibrator  = NULL;
154 
155   bool m_firstInitialized      = true;
156   bool m_cuedCalibrationUpdate = false;
157 
158 private:
159   void drawCurrentColorMark();
160   void clickLeftWheel(const QPoint &pos);
161   void clickRightTriangle(const QPoint &pos);
162 
163 public:
164   HexagonalColorWheel(QWidget *parent);
setColor(const ColorModel & color)165   void setColor(const ColorModel &color) { m_color = color; };
166 
167   ~HexagonalColorWheel();
168 
setBGColor(const QColor & color)169   void setBGColor(const QColor &color) { m_bgColor = color; }
getBGColor()170   QColor getBGColor() const { return m_bgColor; }
171 
172   void updateColorCalibration();
cueCalibrationUpdate()173   void cueCalibrationUpdate() { m_cuedCalibrationUpdate = true; }
174 
175 protected:
176   void initializeGL() override;
177   void resizeGL(int width, int height) override;
178   void paintGL() override;
SizeHint()179   QSize SizeHint() const { return QSize(300, 200); };
180 
181   void mousePressEvent(QMouseEvent *event) override;
182   void mouseMoveEvent(QMouseEvent *event) override;
183   void mouseReleaseEvent(QMouseEvent *event) override;
184 
185   void showEvent(QShowEvent *) override;
186 signals:
187   void colorChanged(const ColorModel &color, bool isDragging);
188 
189 public slots:
190   void onContextAboutToBeDestroyed();
191 };
192 
193 //=============================================================================
194 /*! \brief The SquaredColorWheel is a squared color to change color.
195 
196                 Inherits \b QWidget.
197 
198                 This object show a square faded from one color channel to
199    another color channel,
200                 the two channel represent x and y axis of square.
201                 It's possible to choose viewed shade using \b setChannel().
202                 Click in square change current SquaredColorWheel.
203 */
204 class DVAPI SquaredColorWheel final : public QWidget {
205   Q_OBJECT
206   ColorChannel m_channel;
207   ColorModel m_color;
208 
209 public:
210   SquaredColorWheel(QWidget *parent);
211 
212   /*! Doesn't call update(). */
213   void setColor(const ColorModel &color);
214 
215 protected:
216   void paintEvent(QPaintEvent *event) override;
217 
218   void click(const QPoint &pos);
219   void mousePressEvent(QMouseEvent *event) override;
220   void mouseMoveEvent(QMouseEvent *event) override;
221   void mouseReleaseEvent(QMouseEvent *event) override;
222 
223 public slots:
224   /*! Connect channels to the two square axes:
225                   \li eRed : connect x-axis to eGreen and y-axis to eBlue;
226                   \li eGreen : connect x-axis to eRed and y-axis to eBlue;
227                   \li eBlue : connect x-axis to eRed and y-axis to eGreen;
228                   \li eHue : connect x-axis to eSaturation and y-axis to eValue;
229                   \li eSaturation : connect x-axis to eHue and y-axis to eValue;
230                   \li eValue : connect x-axis to eHue and y-axis to eSaturation;
231      */
232   void setChannel(int channel);
233 
234 signals:
235   void colorChanged(const ColorModel &color, bool isDragging);
236 };
237 
238 //=============================================================================
239 /*! \brief The ColorSlider is used to set a color channel.
240 
241                 Inherits \b QSlider.
242 
243                 This object show a bar which colors differ from minimum to
244    maximum channel color
245                 value.
246 */
247 class DVAPI ColorSlider final : public QSlider {
248   Q_OBJECT
249 public:
250   ColorSlider(Qt::Orientation orientation, QWidget *parent = 0);
251 
252   /*! set channel and color. doesn't call update(). */
253   void setChannel(ColorChannel channel);
254   void setColor(const ColorModel &color);
255 
getChannel()256   ColorChannel getChannel() const { return m_channel; }
257 
258 protected:
259   void paintEvent(QPaintEvent *event) override;
260   void mousePressEvent(QMouseEvent *event) override;
261   void mouseReleaseEvent(QMouseEvent *event) override;
262 
263   //	QIcon getFirstArrowIcon();
264   //	QIcon getLastArrowIcon();
265   //	QRect getFirstArrowRect();
266   //	QRect getLastArrowRect();
267 
268 private:
269   ColorChannel m_channel;
270   ColorModel m_color;
271 };
272 
273 //=============================================================================
274 // ArrowButton
275 
276 class ArrowButton final : public QToolButton {
277   Q_OBJECT
278 
279   Qt::Orientation m_orientaion;
280   bool m_isFirstArrow;
281 
282   int m_timerId;
283   int m_firstTimerId;
284 
285 public:
286   ArrowButton(QWidget *parent = 0, Qt::Orientation orientation = Qt::Horizontal,
287               bool m_isFirstArrow = true);
288 
289 protected:
290   void stopTime(int timerId);
291   void timerEvent(QTimerEvent *event) override;
292   void notifyChanged();
293 
294 protected slots:
295   void onPressed();
296   void onRelease();
297 
298 signals:
299   void add();
300   void remove();
301 };
302 
303 //=============================================================================
304 /*! \brief The ColorSliderBar is a colorSlider with  two arrow to add or remove
305    one to current value.
306 
307                 Inherits \b QToolBar.
308 */
309 class DVAPI ColorSliderBar final : public QWidget {
310   Q_OBJECT
311 
312   ColorSlider *m_colorSlider;
313 
314 public:
315   ColorSliderBar(QWidget *parent             = 0,
316                  Qt::Orientation orientation = Qt::Vertical);
317 
setValue(int value)318   void setValue(int value) { m_colorSlider->setValue(value); }
setRange(int minValue,int maxValue)319   void setRange(int minValue, int maxValue) {
320     m_colorSlider->setRange(minValue, maxValue);
321   }
322 
setChannel(ColorChannel channel)323   void setChannel(ColorChannel channel) {
324     return m_colorSlider->setChannel(channel);
325   }
setColor(const ColorModel & color)326   void setColor(const ColorModel &color) {
327     return m_colorSlider->setColor(color);
328   }
329 
getChannel()330   ColorChannel getChannel() const { return m_colorSlider->getChannel(); }
331 
332 protected slots:
333   void onRemove();
334   void onAdd();
335 
336 signals:
337   void valueChanged(int);
338   void valueChanged();
339 };
340 
341 //=============================================================================
342 /*! \brief The ChannelLineEdit is a cutomized version of IntLineEdit for channel
343    value.
344     It calls selectAll() at the moment of the first click.
345 */
346 class ChannelLineEdit final : public DVGui::IntLineEdit {
347   Q_OBJECT
348 
349   bool m_isEditing;
350 
351 public:
ChannelLineEdit(QWidget * parent,int value,int minValue,int maxValue)352   ChannelLineEdit(QWidget *parent, int value, int minValue, int maxValue)
353       : IntLineEdit(parent, value, minValue, maxValue), m_isEditing(false) {}
354 
355 protected:
356   void mousePressEvent(QMouseEvent *) override;
357   void focusOutEvent(QFocusEvent *) override;
358   void paintEvent(QPaintEvent *) override;
359 };
360 
361 //=============================================================================
362 /*! \brief ColorChannelControl is the widget used to show/edit a channel
363 
364                 Inherits \b QWidget.
365 
366                 The ColorChannelControl is composed of three object: a label \b
367    QLabel
368                 to show the channel name, and an \b IntLineEdit and a
369    ColorSlider to show/edit the
370                 channel value.
371 */
372 class DVAPI ColorChannelControl final : public QWidget {
373   Q_OBJECT
374   QLabel *m_label;
375   ChannelLineEdit *m_field;
376   ColorSlider *m_slider;
377 
378   ColorChannel m_channel;
379   ColorModel m_color;
380 
381   int m_value;
382   bool m_signalEnabled;
383 
384 public:
385   ColorChannelControl(ColorChannel channel, QWidget *parent = 0);
386   void setColor(const ColorModel &color);
387 
388 protected slots:
389   void onFieldChanged();
390   void onSliderChanged(int value);
391   void onSliderReleased();
392 
393   void onAddButtonClicked();
394   void onSubButtonClicked();
395 
396 signals:
397   void colorChanged(const ColorModel &color, bool isDragging);
398 };
399 
400 //=============================================================================
401 /*! \brief The StyleEditorPage is the base class of StyleEditor pages.
402 
403                 Inherits \b QFrame.
404                 Inherited by \b PlainColorPage and \b StyleChooserPage.
405 */
406 class StyleEditorPage : public QFrame {
407 public:
408   StyleEditorPage(QWidget *parent);
409 };
410 
411 //=============================================================================
412 /*! \brief The ColorParameterSelector is used for styles having more
413     than one color parameter to select the current one.
414 
415                 Inherits \b QWidget.
416 */
417 class ColorParameterSelector final : public QWidget {
418   Q_OBJECT
419 
420   std::vector<QColor> m_colors;
421   int m_index;
422   const QSize m_chipSize;
423   const QPoint m_chipOrigin, m_chipDelta;
424 
425 public:
426   ColorParameterSelector(QWidget *parent);
getSelected()427   int getSelected() const { return m_index; }
428   void setStyle(const TColorStyle &style);
429   void clear();
430 
431 signals:
432   void colorParamChanged();
433 
434 protected:
435   void paintEvent(QPaintEvent *) override;
436   void mousePressEvent(QMouseEvent *) override;
437 
438   QSize sizeHint() const override;
439 };
440 
441 //=============================================================================
442 /*! \brief The PlainColorPage is used to control the color parameter.
443 
444                 Inherits \b StyleEditorPage.
445 
446                 The PlainColorPage is made of a \b SquaredColorWheel and a \b
447    ColorSlider,
448                 a collection of \b ColorChannelControl, and a number of radio
449    button (to control
450                 the ColorWheel behaviour).
451 */
452 class PlainColorPage final : public StyleEditorPage {
453   Q_OBJECT
454 
455   // ColorSliderBar *m_verticalSlider;
456   // QRadioButton *m_modeButtons[7];
457   ColorChannelControl *m_channelControls[7];
458   // SquaredColorWheel *m_squaredColorWheel; //iwsw not used
459 
460   HexagonalColorWheel *m_hexagonalColorWheel;
461 
462   ColorModel m_color;
463   bool m_signalEnabled;
464   bool m_isVertical = true;
465   int m_visibleParts;
466   void updateControls();
467 
468   // QGridLayout *m_mainLayout;
469   QFrame *m_slidersContainer;
470   QSplitter *m_vSplitter;
471 
472 public:
473   PlainColorPage(QWidget *parent = 0);
~PlainColorPage()474   ~PlainColorPage() {}
475 
476   QFrame *m_wheelFrame;
477   QFrame *m_hsvFrame;
478   QFrame *m_alphaFrame;
479   QFrame *m_rgbFrame;
480   void setColor(const TColorStyle &style, int colorParameterIndex);
481 
482   void setIsVertical(bool isVertical);
getIsVertical()483   bool getIsVertical() { return m_isVertical; }
484   QByteArray getSplitterState();
485   void setSplitterState(QByteArray state);
486 
487   void updateColorCalibration();
488 
489 protected:
490   void resizeEvent(QResizeEvent *) override;
491 
492 signals:
493   void colorChanged(const ColorModel &, bool isDragging);
494 
495 protected slots:
496   void onWheelChanged(const ColorModel &color, bool isDragging);
497   // void onWheelSliderChanged(int value);
498   // void onWheelSliderReleased();
499 
500 public slots:
501   // void setWheelChannel(int channel);
502   void onControlChanged(const ColorModel &color, bool isDragging);
503   void toggleOrientation();
504 };
505 
506 //=============================================================================
507 /*! \brief The StyleChooserPage is the base class of pages with texture,
508     special style and custom style. It features a collection of selectable
509    'chips'.
510 
511                 Inherits \b StyleEditorPage.
512 */
513 class StyleChooserPage : public StyleEditorPage {
514   Q_OBJECT
515 
516 protected:
517   QPoint m_chipOrigin;
518   QSize m_chipSize;
519   int m_chipPerRow;
520   static TFilePath m_rootPath;
521 
522 public:
523   StyleChooserPage(QWidget *parent = 0);
524 
getChipSize()525   QSize getChipSize() const { return m_chipSize; }
526 
527   virtual bool loadIfNeeded()      = 0;
528   virtual int getChipCount() const = 0;
529 
530   virtual void drawChip(QPainter &p, QRect rect, int index) = 0;
onSelect(int index)531   virtual void onSelect(int index) {}
532 
533   //! \see StyleEditor::setRootPath()
534   // TOGLIERE
535   static void setRootPath(const TFilePath &rootPath);
getRootPath()536   static TFilePath getRootPath() { return m_rootPath; }
537 
538 protected:
539   int m_currentIndex;
540 
541   int posToIndex(const QPoint &pos) const;
542 
543   void paintEvent(QPaintEvent *) override;
resizeEvent(QResizeEvent *)544   void resizeEvent(QResizeEvent *) override { computeSize(); }
545 
546   void mousePressEvent(QMouseEvent *event) override;
mouseMoveEvent(QMouseEvent * event)547   void mouseMoveEvent(QMouseEvent *event) override {}
548   void mouseReleaseEvent(QMouseEvent *event) override;
549 protected slots:
550   void computeSize();
551 signals:
552   void styleSelected(const TColorStyle &style);
553 };
554 
555 //=============================================================================
556 
557 /*!
558   \brief    The SettingsPage is used to show/edit style parameters.
559 
560   \details  This class stores the GUI for editing a \a copy of the
561             current color style. Updates of the actual current color
562             style are \a not performed directly by this class.
563 */
564 
565 class SettingsPage final : public QScrollArea {
566   Q_OBJECT
567 
568   QGridLayout *m_paramsLayout;
569 
570   QCheckBox *m_autoFillCheckBox;
571 
572   TColorStyleP m_editedStyle;  //!< A copy of the current style being edited by
573                                //! the Style Editor.
574 
575   bool
576       m_updating;  //!< Whether the page is copying style content to its widget,
577                    //!  to be displayed.
578 private:
579   int getParamIndex(const QWidget *widget);
580 
581 public:
582   SettingsPage(QWidget *parent);
583 
584   void setStyle(const TColorStyleP &editedStyle);
585   void updateValues();
586 
587   void enableAutopaintToggle(bool enabled);
588 
589 signals:
590 
591   void paramStyleChanged(
592       bool isDragging);  //!< Signals that the edited style has changed.
593 
594 private slots:
595 
596   void onAutofillChanged();
597   void onValueChanged(bool isDragging = false);
598   void onValueReset();
599 };
600 
601 //=============================================================================
602 }  // namespace StyleEditorGUI
603 //=============================================================================
604 
605 using namespace StyleEditorGUI;
606 
607 //=============================================================================
608 // StyleEditor
609 //-----------------------------------------------------------------------------
610 
611 class DVAPI StyleEditor final : public QWidget, public SaveLoadQSettings {
612   Q_OBJECT
613 
614   PaletteController *m_paletteController;
615   TPaletteHandle *m_paletteHandle;
616   TPaletteHandle *m_cleanupPaletteHandle;
617   QWidget *m_parent;
618   TXshLevelHandle
619       *m_levelHandle;  //!< for clearing the level cache when the color changed
620 
621   DVGui::TabBar *m_styleBar;
622   QStackedWidget *m_styleChooser;
623 
624   DVGui::StyleSample
625       *m_newColor;  //!< New style viewer (lower-right panel side).
626   DVGui::StyleSample
627       *m_oldColor;  //!< Old style viewer (lower-right panel side).
628   QAction *m_toggleOrientationAction;
629   QPushButton
630       *m_autoButton;  //!< "Auto Apply" checkbox on the right panel side.
631   QPushButton *m_applyButton;  //!< "Apply" button on the right panel side.
632 
633   QToolBar *m_toolBar;                               //!< Lower toolbar.
634   ColorParameterSelector *m_colorParameterSelector;  //!< Secondary color
635                                                      //! parameter selector in
636   //! the lower toolbar.
637 
638   TabBarContainter *m_tabBarContainer;  //!< Tabs container for style types.
639 
640   // QLabel *m_statusLabel;  //!< showing the information of the current palette
641   //! and style.
642 
643   PlainColorPage *m_plainColorPage;
644   StyleChooserPage *m_textureStylePage;
645   StyleEditorPage *m_specialStylePage;
646   StyleChooserPage *m_customStylePage;
647   StyleChooserPage *m_vectorBrushesStylePage;
648   StyleChooserPage *m_mypaintBrushesStylePage;
649   SettingsPage *m_settingsPage;
650   QScrollArea *m_vectorArea;
651   QAction *m_wheelAction;
652   QAction *m_hsvAction;
653   QAction *m_alphaAction;
654   QAction *m_rgbAction;
655 
656   TColorStyleP
657       m_oldStyle;  //!< A copy of current style \a before the last change.
658   TColorStyleP m_editedStyle;  //!< The currently edited style. Please observe
659                                //! that this is
660   //!  a \b copy of currently selected style, since style edits
661   //!  may be not <I>automatically applied</I>.
662   bool m_enabled;
663   bool m_enabledOnlyFirstTab;
664   bool m_enabledFirstAndLastTab;
665   bool m_colorPageIsVertical = true;
666 
667 public:
668   StyleEditor(PaletteController *, QWidget *parent = 0);
669   ~StyleEditor();
670 
671   void setPaletteHandle(TPaletteHandle *paletteHandle);
getPaletteHandle()672   TPaletteHandle *getPaletteHandle() const { return m_paletteHandle; }
673 
setLevelHandle(TXshLevelHandle * levelHandle)674   void setLevelHandle(TXshLevelHandle *levelHandle) {
675     m_levelHandle = levelHandle;
676   }
677 
getPalette()678   TPalette *getPalette() { return m_paletteHandle->getPalette(); }
getStyleIndex()679   int getStyleIndex() { return m_paletteHandle->getStyleIndex(); }
680 
681   /*! rootPath generally is STUFFDIR/Library. Contains directories 'textures'
682      and
683                   'custom styles' */
684   // TOGLIERE
685   void setRootPath(const TFilePath &rootPath);
686 
enableAutopaintToggle(bool enabled)687   void enableAutopaintToggle(bool enabled) {
688     m_settingsPage->enableAutopaintToggle(enabled);
689   }
690 
691   // SaveLoadQSettings
692   virtual void save(QSettings &settings) const override;
693   virtual void load(QSettings &settings) override;
694 
695   void updateColorCalibration();
696 
697 protected:
698   /*! Return false if style is linked and style must be set to null.*/
699   bool setStyle(TColorStyle *currentStyle);
700 
701   void setEditedStyleToStyle(const TColorStyle *style);  //!< Clones the
702                                                          //! supplied style and
703   //! considers that as
704   //! the edited one.
705   void setOldStyleToStyle(const TColorStyle *style);  //!< Clones the supplied
706                                                       //! style and considers
707   //! that as the previously
708   //! current one.
709   //!  \todo  Why is this not assimilated to setCurrentStyleToStyle()?
710 
711   /*! Return style parameter index selected in \b ColorParameterSelector. */
getColorParam()712   int getColorParam() const { return m_colorParameterSelector->getSelected(); }
713 
714   /*! Set StyleEditor view to \b enabled. If \b enabledOnlyFirstTab or if \b
715      enabledFirstAndLastTab
716                   is true hide other tab, pay attention \b enabled must be true
717      or StyleEditor is disabled. */
718   void enable(bool enabled, bool enabledOnlyFirstTab = false,
719               bool enabledFirstAndLastTab = false);
720 
721 protected:
722   void showEvent(QShowEvent *) override;
723   void hideEvent(QHideEvent *) override;
724 
725 protected slots:
726 
727   void onStyleSwitched();
728   void onStyleChanged(bool isDragging);
729   void onCleanupStyleChanged(bool isDragging);
730   void onOldStyleClicked(const TColorStyle &);
731   void updateOrientationButton();
732   void checkPaletteLock();
733   // called (e.g.) by PaletteController when an other StyleEditor change the
734   // toggle
735   void enableColorAutoApply(bool enabled);
736 
737   // when colorAutoApply==false this slot is called when the current color
738   // changes
739   void setColorSample(const TPixel32 &color);
740 
741   // chiamato quando viene modificato uno slider o la color wheel
742   void onColorChanged(const ColorModel &, bool isDragging);
743 
744   void selectStyle(const TColorStyle &style);
745 
746   void applyButtonClicked();
747   void autoCheckChanged(bool value);
748 
749   void setPage(int index);
750 
751   void onColorParamChanged();
752 
753   void onParamStyleChanged(bool isDragging);
754 
755   void onSpecialButtonToggled(bool on);
756   void onCustomButtonToggled(bool on);
757   void onVectorBrushButtonToggled(bool on);
758 
759 private:
760   QFrame *createBottomWidget();
761   QFrame *createVectorPage();
762   void updateTabBar();
763 
764   void copyEditedStyleToPalette(bool isDragging);
765 };
766 
767 #endif  // STYLEEDITOR_H
768