Changeset View
Changeset View
Standalone View
Standalone View
widgets/toolbars/options/kpToolWidgetFillStyle.cpp
Show First 20 Lines • Show All 58 Lines • ▼ Show 20 Line(s) | 51 | { | |||
---|---|---|---|---|---|
59 | startNewOptionRow (); | 59 | startNewOptionRow (); | ||
60 | } | 60 | } | ||
61 | 61 | | |||
62 | finishConstruction (0, 0); | 62 | finishConstruction (0, 0); | ||
63 | } | 63 | } | ||
64 | 64 | | |||
65 | //--------------------------------------------------------------------- | 65 | //--------------------------------------------------------------------- | ||
66 | 66 | | |||
67 | kpToolWidgetFillStyle::~kpToolWidgetFillStyle () | 67 | kpToolWidgetFillStyle::~kpToolWidgetFillStyle () = default; | ||
68 | { | | |||
69 | } | | |||
70 | 68 | | |||
71 | //--------------------------------------------------------------------- | 69 | //--------------------------------------------------------------------- | ||
72 | 70 | | |||
73 | // private | 71 | // private | ||
74 | QPixmap kpToolWidgetFillStyle::fillStylePixmap (FillStyle fs, int w, int h) | 72 | QPixmap kpToolWidgetFillStyle::fillStylePixmap (FillStyle fs, int w, int h) | ||
75 | { | 73 | { | ||
76 | QPixmap pixmap ((w <= 0 ? width () : w), (h <= 0 ? height () : h)); | 74 | QPixmap pixmap ((w <= 0 ? width () : w), (h <= 0 ? height () : h)); | ||
77 | pixmap.fill(palette().color(QPalette::Window)); | 75 | pixmap.fill(palette().color(QPalette::Window)); | ||
▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Line(s) | |||||
132 | 130 | | |||
133 | //--------------------------------------------------------------------- | 131 | //--------------------------------------------------------------------- | ||
134 | 132 | | |||
135 | // public | 133 | // public | ||
136 | kpToolWidgetFillStyle::FillStyle kpToolWidgetFillStyle::fillStyle () const | 134 | kpToolWidgetFillStyle::FillStyle kpToolWidgetFillStyle::fillStyle () const | ||
137 | { | 135 | { | ||
138 | #if DEBUG_KP_TOOL_WIDGET_FILL_STYLE | 136 | #if DEBUG_KP_TOOL_WIDGET_FILL_STYLE | ||
139 | qCDebug(kpLogWidgets) << "kpToolWidgetFillStyle::fillStyle() selected=" | 137 | qCDebug(kpLogWidgets) << "kpToolWidgetFillStyle::fillStyle() selected=" | ||
140 | << selectedRow () | 138 | << selectedRow (); | ||
141 | << endl; | | |||
142 | #endif | 139 | #endif | ||
143 | return static_cast<FillStyle> (selectedRow ()); | 140 | return static_cast<FillStyle> (selectedRow ()); | ||
144 | } | 141 | } | ||
145 | 142 | | |||
146 | //--------------------------------------------------------------------- | 143 | //--------------------------------------------------------------------- | ||
147 | 144 | | |||
148 | kpColor kpToolWidgetFillStyle::drawingBackgroundColor ( | 145 | kpColor kpToolWidgetFillStyle::drawingBackgroundColor ( | ||
149 | const kpColor &foregroundColor, const kpColor &backgroundColor) const | 146 | const kpColor &foregroundColor, const kpColor &backgroundColor) const | ||
Show All 13 Lines | |||||
163 | } | 160 | } | ||
164 | 161 | | |||
165 | //--------------------------------------------------------------------- | 162 | //--------------------------------------------------------------------- | ||
166 | 163 | | |||
167 | // virtual protected slot [base kpToolWidgetBase] | 164 | // virtual protected slot [base kpToolWidgetBase] | ||
168 | bool kpToolWidgetFillStyle::setSelected (int row, int col, bool saveAsDefault) | 165 | bool kpToolWidgetFillStyle::setSelected (int row, int col, bool saveAsDefault) | ||
169 | { | 166 | { | ||
170 | const bool ret = kpToolWidgetBase::setSelected (row, col, saveAsDefault); | 167 | const bool ret = kpToolWidgetBase::setSelected (row, col, saveAsDefault); | ||
171 | if (ret) | 168 | if (ret) { | ||
172 | emit fillStyleChanged (fillStyle ()); | 169 | emit fillStyleChanged (fillStyle ()); | ||
170 | } | ||||
173 | return ret; | 171 | return ret; | ||
174 | } | 172 | } | ||
175 | 173 | | |||
176 | //--------------------------------------------------------------------- | 174 | //--------------------------------------------------------------------- | ||
177 | 175 | |