Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/widgets/styles/qgtkstyle.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
4 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
5 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
6 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
7 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
8 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
9 | static GtkStateType qt_gtk_state(const QStyleOption *option) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
10 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
11 | GtkStateType state = GTK_STATE_NORMAL; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
12 | if (!(option->state & QStyle::State_Enabled)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
13 | state = GTK_STATE_INSENSITIVE; never executed: state = GTK_STATE_INSENSITIVE; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
14 | else if (option->state & QStyle::State_MouseOver
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
15 | state = GTK_STATE_PRELIGHT; never executed: state = GTK_STATE_PRELIGHT; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
16 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
17 | return never executed: state;return state; never executed: return state; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
18 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
19 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
20 | static QPixmap qt_gtk_get_icon(const char* iconName, GtkIconSize size = GTK_ICON_SIZE_BUTTON) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
21 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
22 | GtkStyle *style = QGtkStylePrivate::gtkStyle(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
23 | GtkIconSet* iconSet = QGtkStylePrivate::gtk_icon_factory_lookup_default (iconName); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
24 | GdkPixbuf* icon = QGtkStylePrivate::gtk_icon_set_render_icon(iconSet, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
25 | style, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
26 | GTK_TEXT_DIR_LTR, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
27 | GTK_STATE_NORMAL, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
28 | size, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
29 | __null, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
30 | "button"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
31 | uchar* data = (uchar*)QGtkStylePrivate::gdk_pixbuf_get_pixels(icon); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
32 | int width = QGtkStylePrivate::gdk_pixbuf_get_width(icon); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
33 | int height = QGtkStylePrivate::gdk_pixbuf_get_height(icon); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
34 | QImage converted(width, height, QImage::Format_ARGB32); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
35 | uchar* tdata = (uchar*)converted.bits(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
36 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
37 | for ( int index = 0 ; index < height * width*4
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
38 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
39 | tdata[index + 0] = data[index + 2]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
40 | tdata[index + 1] = data[index + 1]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
41 | tdata[index + 2] = data[index + 0]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
42 | tdata[index + 3] = data[index + 3]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
43 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
44 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
45 | QGtkStylePrivate::gdk_pixbuf_unref(icon); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
46 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
47 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
48 | return never executed: QPixmap::fromImage(converted);return QPixmap::fromImage(converted); never executed: return QPixmap::fromImage(converted); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
49 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
50 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
51 | static void qt_gtk_draw_mdibutton(QPainter *painter, const QStyleOptionTitleBar *option, const QRect &tmp, bool hover, bool sunken) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
52 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
53 | QColor dark; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
54 | dark.setHsv(option->palette.button().color().hue(), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
55 | qMin(255, (int)(option->palette.button().color().saturation()*1.9)), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
56 | qMin(255, (int)(option->palette.button().color().value()*0.7))); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
57 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
58 | QColor highlight = option->palette.highlight().color(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
59 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
60 | bool active = (option->titleBarState & QStyle::State_Active); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
61 | QColor titleBarHighlight(255, 255, 255, 60); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
62 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
63 | if (sunken
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
64 | painter->fillRect(tmp.adjusted(1, 1, -1, -1), option->palette.highlight().color().darker(120)); never executed: painter->fillRect(tmp.adjusted(1, 1, -1, -1), option->palette.highlight().color().darker(120)); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
65 | else if (hover
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
66 | painter->fillRect(tmp.adjusted(1, 1, -1, -1), QColor(255, 255, 255, 20)); never executed: painter->fillRect(tmp.adjusted(1, 1, -1, -1), QColor(255, 255, 255, 20)); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
67 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
68 | QColor mdiButtonGradientStartColor; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
69 | QColor mdiButtonGradientStopColor; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
70 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
71 | mdiButtonGradientStartColor = QColor(0, 0, 0, 40); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
72 | mdiButtonGradientStopColor = QColor(255, 255, 255, 60); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
73 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
74 | if (sunken
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
75 | titleBarHighlight = highlight.darker(130); never executed: titleBarHighlight = highlight.darker(130); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
76 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
77 | QLinearGradient gradient(tmp.center().x(), tmp.top(), tmp.center().x(), tmp.bottom()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
78 | gradient.setColorAt(0, mdiButtonGradientStartColor); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
79 | gradient.setColorAt(1, mdiButtonGradientStopColor); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
80 | QColor mdiButtonBorderColor(active ? option->palette.highlight().color().darker(180): dark.darker(110)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
81 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
82 | painter->setPen(QPen(mdiButtonBorderColor, 1)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
83 | const QLine lines[4] = { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
84 | QLine(tmp.left() + 2, tmp.top(), tmp.right() - 2, tmp.top()), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
85 | QLine(tmp.left() + 2, tmp.bottom(), tmp.right() - 2, tmp.bottom()), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
86 | QLine(tmp.left(), tmp.top() + 2, tmp.left(), tmp.bottom() - 2), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
87 | QLine(tmp.right(), tmp.top() + 2, tmp.right(), tmp.bottom() - 2) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
88 | }; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
89 | painter->drawLines(lines, 4); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
90 | const QPoint points[4] = { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
91 | QPoint(tmp.left() + 1, tmp.top() + 1), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
92 | QPoint(tmp.right() - 1, tmp.top() + 1), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
93 | QPoint(tmp.left() + 1, tmp.bottom() - 1), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
94 | QPoint(tmp.right() - 1, tmp.bottom() - 1) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
95 | }; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
96 | painter->drawPoints(points, 4); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
97 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
98 | painter->setPen(titleBarHighlight); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
99 | painter->drawLine(tmp.left() + 2, tmp.top() + 1, tmp.right() - 2, tmp.top() + 1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
100 | painter->drawLine(tmp.left() + 1, tmp.top() + 2, tmp.left() + 1, tmp.bottom() - 2); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
101 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
102 | painter->setPen(QPen(gradient, 1)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
103 | painter->drawLine(tmp.right() + 1, tmp.top() + 2, tmp.right() + 1, tmp.bottom() - 2); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
104 | painter->drawPoint(tmp.right() , tmp.top() + 1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
105 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
106 | painter->drawLine(tmp.left() + 2, tmp.bottom() + 1, tmp.right() - 2, tmp.bottom() + 1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
107 | painter->drawPoint(tmp.left() + 1, tmp.bottom()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
108 | painter->drawPoint(tmp.right() - 1, tmp.bottom()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
109 | painter->drawPoint(tmp.right() , tmp.bottom() - 1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
110 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
111 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
112 | static const char * const dock_widget_close_xpm[] = | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
113 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
114 | "11 13 5 1", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
115 | " c None", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
116 | ". c #D5CFCB", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
117 | "+ c #6C6A67", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
118 | "@ c #6C6A67", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
119 | "$ c #B5B0AC", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
120 | " ", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
121 | " @@@@@@@@@ ", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
122 | "@+ +@", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
123 | "@ +@ @+ @", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
124 | "@ @@@ @@@ @", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
125 | "@ @@@@@ @", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
126 | "@ @@@ @", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
127 | "@ @@@@@ @", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
128 | "@ @@@ @@@ @", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
129 | "@ +@ @+ @", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
130 | "@+ +@", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
131 | " @@@@@@@@@ ", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
132 | " " | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
133 | }; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
134 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
135 | static const char * const dock_widget_restore_xpm[] = | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
136 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
137 | "11 13 5 1", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
138 | " c None", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
139 | ". c #D5CFCB", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
140 | "+ c #6C6A67", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
141 | "@ c #6C6A67", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
142 | "# c #6C6A67", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
143 | " ", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
144 | " @@@@@@@@@ ", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
145 | "@+ +@", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
146 | "@ #@@@# @", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
147 | "@ @ @ @", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
148 | "@ #@@@# @ @", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
149 | "@ @ @ @ @", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
150 | "@ @ @@@ @", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
151 | "@ @ @ @", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
152 | "@ #@@@@ @", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
153 | "@+ +@", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
154 | " @@@@@@@@@ ", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
155 | " " | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
156 | }; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
157 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
158 | static const char * const qt_titlebar_context_help[] = { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
159 | "10 10 3 1", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
160 | " c None", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
161 | "# c #000000", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
162 | "+ c #444444", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
163 | " +####+ ", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
164 | " ### ### ", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
165 | " ## ## ", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
166 | " +##+ ", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
167 | " +## ", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
168 | " ## ", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
169 | " ## ", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
170 | " ", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
171 | " ## ", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
172 | " ## "}; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
173 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
174 | static const char * const qt_scrollbar_button_arrow_up[] = { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
175 | "7 4 2 1", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
176 | " c None", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
177 | "* c #BFBFBF", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
178 | " * ", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
179 | " *** ", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
180 | " ***** ", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
181 | "*******"}; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
182 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
183 | static const char * const qt_scrollbar_button_arrow_down[] = { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
184 | "7 4 2 1", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
185 | " c None", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
186 | "* c #BFBFBF", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
187 | "*******", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
188 | " ***** ", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
189 | " *** ", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
190 | " * "}; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
191 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
192 | static const int groupBoxBottomMargin = 2; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
193 | static const int groupBoxTitleMargin = 6; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
194 | static const int groupBoxTopMargin = 2; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
195 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
196 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
197 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
198 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
199 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
200 | QString QGtkStyle::getGConfString(const QString &value, const QString &fallback) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
201 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
202 | return never executed: QGtkStylePrivate::getGConfString(value, fallback);return QGtkStylePrivate::getGConfString(value, fallback); never executed: return QGtkStylePrivate::getGConfString(value, fallback); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
203 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
204 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
205 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
206 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
207 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
208 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
209 | bool QGtkStyle::getGConfBool(const QString &key, bool fallback) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
210 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
211 | return never executed: QGtkStylePrivate::getGConfBool(key, fallback);return QGtkStylePrivate::getGConfBool(key, fallback); never executed: return QGtkStylePrivate::getGConfBool(key, fallback); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
212 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
213 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
214 | static QColor mergedColors(const QColor &colorA, const QColor &colorB, int factor = 50) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
215 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
216 | const int maxFactor = 100; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
217 | QColor tmp = colorA; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
218 | tmp.setRed((tmp.red() * factor) / maxFactor + (colorB.red() * (maxFactor - factor)) / maxFactor); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
219 | tmp.setGreen((tmp.green() * factor) / maxFactor + (colorB.green() * (maxFactor - factor)) / maxFactor); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
220 | tmp.setBlue((tmp.blue() * factor) / maxFactor + (colorB.blue() * (maxFactor - factor)) / maxFactor); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
221 | return never executed: tmp;return tmp; never executed: return tmp; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
222 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
223 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
224 | static GdkColor fromQColor(const QColor &color) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
225 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
226 | GdkColor retval; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
227 | retval.pixel = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
228 | retval.red = color.red() * 255; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
229 | retval.green = color.green() * 255; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
230 | retval.blue = color.blue() * 255; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
231 | return never executed: retval;return retval; never executed: return retval; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
232 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
233 | QGtkStyle::QGtkStyle() | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
234 | : QCommonStyle(*new QGtkStylePrivate) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
235 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
236 | QGtkStylePrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
237 | d->init(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
238 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
239 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
240 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
241 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
242 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
243 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
244 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
245 | QGtkStyle::QGtkStyle(QGtkStylePrivate &dd) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
246 | : QCommonStyle(dd) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
247 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
248 | QGtkStylePrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
249 | d->init(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
250 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
251 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
252 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
253 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
254 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
255 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
256 | QGtkStyle::~QGtkStyle() | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
257 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
258 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
259 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
260 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
261 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
262 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
263 | QPalette QGtkStyle::standardPalette() const | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
264 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
265 | const QGtkStylePrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
266 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
267 | QPalette palette = QCommonStyle::standardPalette(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
268 | if (d->isThemeAvailable()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
269 | GtkStyle *style = d->gtkStyle(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
270 | GtkWidget *gtkButton = d->gtkWidget("GtkButton"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
271 | GtkWidget *gtkEntry = d->getTextColorWidget(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
272 | GdkColor gdkBg, gdkBase, gdkText, gdkForeground, gdkSbg, gdkSfg, gdkaSbg, gdkaSfg; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
273 | QColor bg, base, text, fg, highlight, highlightText, inactiveHighlight, inactiveHighlightedTExt; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
274 | gdkBg = style->bg[GTK_STATE_NORMAL]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
275 | gdkForeground = d->gtk_widget_get_style(gtkButton)->fg[GTK_STATE_NORMAL]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
276 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
277 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
278 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
279 | GtkStyle *gtkEntryStyle = d->gtk_widget_get_style(gtkEntry); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
280 | gdkBase = gtkEntryStyle->base[GTK_STATE_NORMAL]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
281 | gdkText = gtkEntryStyle->text[GTK_STATE_NORMAL]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
282 | gdkSbg = gtkEntryStyle->base[GTK_STATE_SELECTED]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
283 | gdkSfg = gtkEntryStyle->text[GTK_STATE_SELECTED]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
284 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
285 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
286 | gdkaSbg = gtkEntryStyle->base[GTK_STATE_ACTIVE]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
287 | gdkaSfg = gtkEntryStyle->text[GTK_STATE_ACTIVE]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
288 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
289 | bg = QColor(gdkBg.red>>8, gdkBg.green>>8, gdkBg.blue>>8); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
290 | text = QColor(gdkText.red>>8, gdkText.green>>8, gdkText.blue>>8); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
291 | fg = QColor(gdkForeground.red>>8, gdkForeground.green>>8, gdkForeground.blue>>8); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
292 | base = QColor(gdkBase.red>>8, gdkBase.green>>8, gdkBase.blue>>8); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
293 | highlight = QColor(gdkSbg.red>>8, gdkSbg.green>>8, gdkSbg.blue>>8); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
294 | highlightText = QColor(gdkSfg.red>>8, gdkSfg.green>>8, gdkSfg.blue>>8); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
295 | inactiveHighlight = QColor(gdkaSbg.red>>8, gdkaSbg.green>>8, gdkaSbg.blue>>8); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
296 | inactiveHighlightedTExt = QColor(gdkaSfg.red>>8, gdkaSfg.green>>8, gdkaSfg.blue>>8); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
297 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
298 | palette.setColor(QPalette::HighlightedText, highlightText); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
299 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
300 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
301 | palette.setColor(QPalette::Light, bg.lighter(125)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
302 | palette.setColor(QPalette::Shadow, bg.darker(130)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
303 | palette.setColor(QPalette::Dark, bg.darker(120)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
304 | palette.setColor(QPalette::Text, text); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
305 | palette.setColor(QPalette::WindowText, fg); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
306 | palette.setColor(QPalette::ButtonText, fg); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
307 | palette.setColor(QPalette::Base, base); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
308 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
309 | QColor alternateRowColor = palette.base().color().lighter(93); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
310 | GtkWidget *gtkTreeView = d->gtkWidget("GtkTreeView"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
311 | GdkColor *gtkAltBase = __null; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
312 | d->gtk_widget_style_get(gtkTreeView, "odd-row-color", >kAltBase, __null); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
313 | if (gtkAltBase
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
314 | alternateRowColor = QColor(gtkAltBase->red>>8, gtkAltBase->green>>8, gtkAltBase->blue>>8); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
315 | d->gdk_color_free(gtkAltBase); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
316 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
317 | palette.setColor(QPalette::AlternateBase, alternateRowColor); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
318 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
319 | palette.setColor(QPalette::Window, bg); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
320 | palette.setColor(QPalette::Button, bg); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
321 | palette.setColor(QPalette::Background, bg); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
322 | QColor disabled((fg.red() + bg.red()) / 2, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
323 | (fg.green() + bg.green())/ 2, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
324 | (fg.blue() + bg.blue()) / 2); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
325 | palette.setColor(QPalette::Disabled, QPalette::Text, disabled); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
326 | palette.setColor(QPalette::Disabled, QPalette::WindowText, disabled); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
327 | palette.setColor(QPalette::Disabled, QPalette::Foreground, disabled); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
328 | palette.setColor(QPalette::Disabled, QPalette::ButtonText, disabled); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
329 | palette.setColor(QPalette::Highlight, highlight); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
330 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
331 | highlight.setHsv(highlight.hue(), 0, highlight.value(), highlight.alpha()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
332 | highlightText.setHsv(highlightText.hue(), 0, highlightText.value(), highlightText.alpha()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
333 | palette.setColor(QPalette::Disabled, QPalette::Highlight, highlight); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
334 | palette.setColor(QPalette::Disabled, QPalette::HighlightedText, highlightText); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
335 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
336 | palette.setColor(QPalette::Inactive, QPalette::HighlightedText, inactiveHighlightedTExt); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
337 | palette.setColor(QPalette::Inactive, QPalette::Highlight, inactiveHighlight); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
338 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
339 | style = d->gtk_rc_get_style_by_paths(d->gtk_settings_get_default(), "gtk-tooltips", "GtkWindow", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
340 | d->gtk_window_get_type()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
341 | if (style
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
342 | gdkText = style->fg[GTK_STATE_NORMAL]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
343 | text = QColor(gdkText.red>>8, gdkText.green>>8, gdkText.blue>>8); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
344 | palette.setColor(QPalette::ToolTipText, text); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
345 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
346 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
347 | return never executed: palette;return palette; never executed: return palette; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
348 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
349 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
350 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
351 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
352 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
353 | void QGtkStyle::polish(QPalette &palette) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
354 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
355 | QGtkStylePrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
356 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
357 | if (!d->isThemeAvailable()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
358 | QCommonStyle::polish(palette); never executed: QCommonStyle::polish(palette); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
359 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
360 | palette = palette.resolve(standardPalette()); never executed: palette = palette.resolve(standardPalette()); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
361 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
362 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
363 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
364 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
365 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
366 | void QGtkStyle::polish(QApplication *app) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
367 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
368 | QGtkStylePrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
369 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
370 | QCommonStyle::polish(app); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
371 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
372 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
373 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
374 | if (app->desktopSettingsAware()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
375 | QApplicationPrivate::setSystemPalette(standardPalette()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
376 | QApplicationPrivate::setSystemFont(d->getThemeFont()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
377 | d->applyCustomPaletteHash(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
378 | if (!d->isKDE4Session()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
379 | (static_cast< never executed: QApplication *>(QCoreApplication::instance()))->installEventFilter(&d->filter);(static_cast<QApplication *>(QCoreApplication::instance()))->installEventFilter(&d->filter); never executed: (static_cast<QApplication *>(QCoreApplication::instance()))->installEventFilter(&d->filter); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
380 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
381 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
382 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
383 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
384 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
385 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
386 | void QGtkStyle::unpolish(QApplication *app) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
387 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
388 | QGtkStylePrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
389 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
390 | QCommonStyle::unpolish(app); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
391 | QPixmapCache::clear(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
392 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
393 | if (app->desktopSettingsAware()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
394 | (static_cast< never executed: QApplication *>(QCoreApplication::instance()))->removeEventFilter(&d->filter);(static_cast<QApplication *>(QCoreApplication::instance()))->removeEventFilter(&d->filter); never executed: (static_cast<QApplication *>(QCoreApplication::instance()))->removeEventFilter(&d->filter); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
395 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
396 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
397 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
398 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
399 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
400 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
401 | void QGtkStyle::polish(QWidget *widget) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
402 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
403 | QGtkStylePrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
404 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
405 | QCommonStyle::polish(widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
406 | if (!d->isThemeAvailable()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
407 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
408 | if (qobject_cast<QAbstractButton*>(widget)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
409 | || qobject_cast<QToolButton*>(widget)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
410 | || qobject_cast<QComboBox*>(widget)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
411 | || qobject_cast<QGroupBox*>(widget)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
412 | || qobject_cast<QScrollBar*>(widget)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
413 | || qobject_cast<QSlider*>(widget)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
414 | || qobject_cast<QAbstractSpinBox*>(widget)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
415 | || qobject_cast<QSpinBox*>(widget)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
416 | || qobject_cast<QHeaderView*>(widget)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
417 | widget->setAttribute(Qt::WA_Hover); never executed: widget->setAttribute(Qt::WA_Hover); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
418 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
419 | else if (QTreeView *tree = qobject_cast<QTreeView *> (widget)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
420 | tree->viewport()->setAttribute(Qt::WA_Hover); never executed: tree->viewport()->setAttribute(Qt::WA_Hover); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
421 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
422 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
423 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
424 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
425 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
426 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
427 | void QGtkStyle::unpolish(QWidget *widget) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
428 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
429 | QCommonStyle::unpolish(widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
430 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
431 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
432 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
433 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
434 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
435 | int QGtkStyle::pixelMetric(PixelMetric metric, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
436 | const QStyleOption *option, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
437 | const QWidget *widget) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
438 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
439 | const QGtkStylePrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
440 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
441 | if (!d->isThemeAvailable()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
442 | return never executed: QCommonStyle::pixelMetric(metric, option, widget);return QCommonStyle::pixelMetric(metric, option, widget); never executed: return QCommonStyle::pixelMetric(metric, option, widget); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
443 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
444 | switch (metric) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
445 | case never executed: PM_DefaultFrameWidth:case PM_DefaultFrameWidth: never executed: case PM_DefaultFrameWidth: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
446 | if (qobject_cast<const QFrame*>(widget)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
447 | if (GtkStyle *style =
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
448 | d->gtk_rc_get_style_by_paths(d->gtk_settings_get_default(),
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
449 | "*.GtkScrolledWindow",
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
450 | "*.GtkScrolledWindow",
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
451 | d->gtk_window_get_type())
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
452 | return never executed: qMax(style->xthickness, style->ythickness);return qMax(style->xthickness, style->ythickness); never executed: return qMax(style->xthickness, style->ythickness); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
453 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
454 | return never executed: 2;return 2; never executed: return 2; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
455 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
456 | case never executed: PM_MenuButtonIndicator:case PM_MenuButtonIndicator: never executed: case PM_MenuButtonIndicator: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
457 | return never executed: 20;return 20; never executed: return 20; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
458 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
459 | case never executed: PM_TabBarBaseOverlap:case PM_TabBarBaseOverlap: never executed: case PM_TabBarBaseOverlap: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
460 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
461 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
462 | case never executed: PM_ToolBarSeparatorExtent:case PM_ToolBarSeparatorExtent: never executed: case PM_ToolBarSeparatorExtent: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
463 | return never executed: 11;return 11; never executed: return 11; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
464 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
465 | case never executed: PM_ToolBarFrameWidth:case PM_ToolBarFrameWidth: never executed: case PM_ToolBarFrameWidth: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
466 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
467 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
468 | case never executed: PM_ToolBarItemSpacing:case PM_ToolBarItemSpacing: never executed: case PM_ToolBarItemSpacing: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
469 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
470 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
471 | case never executed: PM_ButtonShiftHorizontal:case PM_ButtonShiftHorizontal: never executed: {case PM_ButtonShiftHorizontal: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
472 | GtkWidget *gtkButton = d->gtkWidget("GtkButton"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
473 | guint horizontal_shift; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
474 | d->gtk_widget_style_get(gtkButton, "child-displacement-x", &horizontal_shift, __null); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
475 | return never executed: horizontal_shift;return horizontal_shift; never executed: return horizontal_shift; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
476 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
477 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
478 | case never executed: PM_ButtonShiftVertical:case PM_ButtonShiftVertical: never executed: {case PM_ButtonShiftVertical: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
479 | GtkWidget *gtkButton = d->gtkWidget("GtkButton"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
480 | guint vertical_shift; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
481 | d->gtk_widget_style_get(gtkButton, "child-displacement-y", &vertical_shift, __null); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
482 | return never executed: vertical_shift;return vertical_shift; never executed: return vertical_shift; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
483 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
484 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
485 | case never executed: PM_MenuBarPanelWidth:case PM_MenuBarPanelWidth: never executed: case PM_MenuBarPanelWidth: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
486 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
487 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
488 | case never executed: PM_MenuPanelWidth:case PM_MenuPanelWidth: never executed: {case PM_MenuPanelWidth: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
489 | GtkWidget *gtkMenu = d->gtkWidget("GtkMenu"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
490 | guint horizontal_padding = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
491 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
492 | if (!d->gtk_check_version(2, 10, 0)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
493 | d->gtk_widget_style_get(gtkMenu, "horizontal-padding", &horizontal_padding, __null); never executed: d->gtk_widget_style_get(gtkMenu, "horizontal-padding", &horizontal_padding, __null); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
494 | int padding = qMax<int>(d->gtk_widget_get_style(gtkMenu)->xthickness, horizontal_padding); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
495 | return never executed: padding;return padding; never executed: return padding; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
496 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
497 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
498 | case never executed: PM_ButtonIconSize:case PM_ButtonIconSize: never executed: {case PM_ButtonIconSize: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
499 | int retVal = 24; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
500 | GtkSettings *settings = d->gtk_settings_get_default(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
501 | gchararray icon_sizes; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
502 | g_object_get(settings, "gtk-icon-sizes", &icon_sizes, __null); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
503 | QStringList values = QString(QLatin1String(icon_sizes)).split(QLatin1Char(':')); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
504 | g_free(icon_sizes); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
505 | QChar splitChar(QLatin1Char(',')); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
506 | for (QForeachContainer<typename QtPrivate::remove_reference<decltype(values)>::type> _container_((values)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (const QString &value = *_container_.i; _container_.control; _container_.control = 0) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
507 | if (value.startsWith(QLatin1String("gtk-button="))
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
508 | QString iconSize = value.right(value.size() - 11); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
509 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
510 | if (iconSize.contains(splitChar)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
511 | retVal = iconSize.split(splitChar)[0].toInt(); never executed: retVal = iconSize.split(splitChar)[0].toInt(); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
512 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
513 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
514 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
515 | return never executed: retVal;return retVal; never executed: return retVal; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
516 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
517 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
518 | case never executed: PM_MenuVMargin:case PM_MenuVMargin: never executed: case PM_MenuVMargin: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
519 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
520 | case never executed: PM_MenuHMargin:case PM_MenuHMargin: never executed: case PM_MenuHMargin: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
521 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
522 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
523 | case never executed: PM_DockWidgetTitleMargin:case PM_DockWidgetTitleMargin: never executed: case PM_DockWidgetTitleMargin: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
524 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
525 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
526 | case never executed: PM_DockWidgetTitleBarButtonMargin:case PM_DockWidgetTitleBarButtonMargin: never executed: case PM_DockWidgetTitleBarButtonMargin: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
527 | return never executed: 5;return 5; never executed: return 5; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
528 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
529 | case never executed: PM_TabBarTabVSpace:case PM_TabBarTabVSpace: never executed: case PM_TabBarTabVSpace: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
530 | return never executed: 12;return 12; never executed: return 12; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
531 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
532 | case never executed: PM_TabBarTabHSpace:case PM_TabBarTabHSpace: never executed: case PM_TabBarTabHSpace: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
533 | return never executed: 14;return 14; never executed: return 14; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
534 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
535 | case never executed: PM_TabBarTabShiftVertical:case PM_TabBarTabShiftVertical: never executed: case PM_TabBarTabShiftVertical: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
536 | return never executed: 2;return 2; never executed: return 2; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
537 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
538 | case never executed: PM_ToolBarHandleExtent:case PM_ToolBarHandleExtent: never executed: case PM_ToolBarHandleExtent: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
539 | return never executed: 9;return 9; never executed: return 9; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
540 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
541 | case never executed: PM_SplitterWidth:case PM_SplitterWidth: never executed: case PM_SplitterWidth: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
542 | return never executed: 6;return 6; never executed: return 6; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
543 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
544 | case never executed: PM_SliderThickness:case PM_SliderThickness: never executed: case PM_SliderThickness: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
545 | case never executed: PM_SliderControlThickness:case PM_SliderControlThickness: never executed: {case PM_SliderControlThickness: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
546 | GtkWidget *gtkScale = d->gtkWidget("GtkHScale"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
547 | gint val; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
548 | d->gtk_widget_style_get(gtkScale, "slider-width", &val, __null); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
549 | if (metric == PM_SliderControlThickness
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
550 | return never executed: val + 2*d->gtk_widget_get_style(gtkScale)->ythickness;return val + 2*d->gtk_widget_get_style(gtkScale)->ythickness; never executed: return val + 2*d->gtk_widget_get_style(gtkScale)->ythickness; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
551 | return never executed: val;return val; never executed: return val; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
552 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
553 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
554 | case never executed: PM_ScrollBarExtent:case PM_ScrollBarExtent: never executed: {case PM_ScrollBarExtent: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
555 | gint sliderLength; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
556 | gint trough_border; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
557 | GtkWidget *hScrollbar = d->gtkWidget("GtkHScrollbar"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
558 | d->gtk_widget_style_get(hScrollbar, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
559 | "trough-border", &trough_border, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
560 | "slider-width", &sliderLength, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
561 | __null); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
562 | return never executed: sliderLength + trough_border*2;return sliderLength + trough_border*2; never executed: return sliderLength + trough_border*2; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
563 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
564 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
565 | case never executed: PM_ScrollBarSliderMin:case PM_ScrollBarSliderMin: never executed: case PM_ScrollBarSliderMin: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
566 | return never executed: 34;return 34; never executed: return 34; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
567 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
568 | case never executed: PM_SliderLength:case PM_SliderLength: never executed: case PM_SliderLength: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
569 | gint val; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
570 | d->gtk_widget_style_get(d->gtkWidget("GtkHScale"), "slider-length", &val, __null); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
571 | return never executed: val;return val; never executed: return val; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
572 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
573 | case never executed: PM_ExclusiveIndicatorWidth:case PM_ExclusiveIndicatorWidth: never executed: case PM_ExclusiveIndicatorWidth: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
574 | case never executed: PM_ExclusiveIndicatorHeight:case PM_ExclusiveIndicatorHeight: never executed: case PM_ExclusiveIndicatorHeight: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
575 | case never executed: PM_IndicatorWidth:case PM_IndicatorWidth: never executed: case PM_IndicatorWidth: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
576 | case never executed: PM_IndicatorHeight:case PM_IndicatorHeight: never executed: {case PM_IndicatorHeight: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
577 | GtkWidget *gtkCheckButton = d->gtkWidget("GtkCheckButton"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
578 | gint size, spacing; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
579 | d->gtk_widget_style_get(gtkCheckButton, "indicator-spacing", &spacing, "indicator-size", &size, __null); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
580 | return never executed: size + 2 * spacing;return size + 2 * spacing; never executed: return size + 2 * spacing; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
581 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
582 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
583 | case never executed: PM_MenuBarVMargin:case PM_MenuBarVMargin: never executed: {case PM_MenuBarVMargin: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
584 | GtkWidget *gtkMenubar = d->gtkWidget("GtkMenuBar"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
585 | return never executed: qMax(0, d->gtk_widget_get_style(gtkMenubar)->ythickness);return qMax(0, d->gtk_widget_get_style(gtkMenubar)->ythickness); never executed: return qMax(0, d->gtk_widget_get_style(gtkMenubar)->ythickness); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
586 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
587 | case never executed: PM_ScrollView_ScrollBarSpacing:case PM_ScrollView_ScrollBarSpacing: never executed: case PM_ScrollView_ScrollBarSpacing: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
588 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
589 | gint spacing = 3; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
590 | GtkWidget *gtkScrollWindow = d->gtkWidget("GtkScrolledWindow"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
591 | ((!(gtkScrollWindow)) ? qt_assert("gtkScrollWindow",__FILE__,680) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
592 | d->gtk_widget_style_get(gtkScrollWindow, "scrollbar-spacing", &spacing, __null); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
593 | return never executed: spacing;return spacing; never executed: return spacing; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
594 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
595 | case never executed: PM_SubMenuOverlap:case PM_SubMenuOverlap: never executed: {case PM_SubMenuOverlap: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
596 | gint offset = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
597 | GtkWidget *gtkMenu = d->gtkWidget("GtkMenu"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
598 | d->gtk_widget_style_get(gtkMenu, "horizontal-offset", &offset, __null); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
599 | return never executed: offset;return offset; never executed: return offset; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
600 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
601 | case never executed: PM_ToolTipLabelFrameWidth:case PM_ToolTipLabelFrameWidth: never executed: case PM_ToolTipLabelFrameWidth: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
602 | return never executed: 2;return 2; never executed: return 2; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
603 | case never executed: PM_ButtonDefaultIndicator:case PM_ButtonDefaultIndicator: never executed: case PM_ButtonDefaultIndicator: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
604 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
605 | case never executed: PM_ListViewIconSize:case PM_ListViewIconSize: never executed: case PM_ListViewIconSize: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
606 | return never executed: 24;return 24; never executed: return 24; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
607 | case never executed: PM_DialogButtonsSeparator:case PM_DialogButtonsSeparator: never executed: case PM_DialogButtonsSeparator: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
608 | return never executed: 6;return 6; never executed: return 6; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
609 | case never executed: PM_TitleBarHeight:case PM_TitleBarHeight: never executed: case PM_TitleBarHeight: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
610 | return never executed: 24;return 24; never executed: return 24; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
611 | case never executed: PM_SpinBoxFrameWidth:case PM_SpinBoxFrameWidth: never executed: case PM_SpinBoxFrameWidth: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
612 | return never executed: 3;return 3; never executed: return 3; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
613 | case never executed: PM_MenuBarItemSpacing:case PM_MenuBarItemSpacing: never executed: case PM_MenuBarItemSpacing: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
614 | return never executed: 6;return 6; never executed: return 6; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
615 | case never executed: PM_MenuBarHMargin:case PM_MenuBarHMargin: never executed: case PM_MenuBarHMargin: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
616 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
617 | case never executed: PM_ToolBarItemMargin:case PM_ToolBarItemMargin: never executed: case PM_ToolBarItemMargin: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
618 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
619 | case never executed: PM_SmallIconSize:case PM_SmallIconSize: never executed: case PM_SmallIconSize: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
620 | return never executed: 16;return 16; never executed: return 16; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
621 | case never executed: PM_MaximumDragDistance:case PM_MaximumDragDistance: never executed: case PM_MaximumDragDistance: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
622 | return never executed: -1;return -1; never executed: return -1; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
623 | case never executed: PM_TabCloseIndicatorWidth:case PM_TabCloseIndicatorWidth: never executed: case PM_TabCloseIndicatorWidth: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
624 | case never executed: PM_TabCloseIndicatorHeight:case PM_TabCloseIndicatorHeight: never executed: case PM_TabCloseIndicatorHeight: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
625 | return never executed: 20;return 20; never executed: return 20; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
626 | default never executed: :default: never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
627 | return never executed: QCommonStyle::pixelMetric(metric, option, widget);return QCommonStyle::pixelMetric(metric, option, widget); never executed: return QCommonStyle::pixelMetric(metric, option, widget); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
628 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
629 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
630 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
631 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
632 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
633 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
634 | int QGtkStyle::styleHint(StyleHint hint, const QStyleOption *option, const QWidget *widget, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
635 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
636 | QStyleHintReturn *returnData = 0) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
637 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
638 | const QGtkStylePrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
639 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
640 | if (!d->isThemeAvailable()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
641 | return never executed: QCommonStyle::styleHint(hint, option, widget, returnData);return QCommonStyle::styleHint(hint, option, widget, returnData); never executed: return QCommonStyle::styleHint(hint, option, widget, returnData); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
642 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
643 | switch (hint) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
644 | case never executed: SH_ItemView_ChangeHighlightOnFocus:case SH_ItemView_ChangeHighlightOnFocus: never executed: case SH_ItemView_ChangeHighlightOnFocus: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
645 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
646 | case never executed: SH_ScrollBar_MiddleClickAbsolutePosition:case SH_ScrollBar_MiddleClickAbsolutePosition: never executed: case SH_ScrollBar_MiddleClickAbsolutePosition: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
647 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
648 | case never executed: SH_Menu_AllowActiveAndDisabled:case SH_Menu_AllowActiveAndDisabled: never executed: case SH_Menu_AllowActiveAndDisabled: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
649 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
650 | case never executed: SH_MainWindow_SpaceBelowMenuBar:case SH_MainWindow_SpaceBelowMenuBar: never executed: case SH_MainWindow_SpaceBelowMenuBar: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
651 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
652 | case never executed: SH_MenuBar_MouseTracking:case SH_MenuBar_MouseTracking: never executed: case SH_MenuBar_MouseTracking: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
653 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
654 | case never executed: SH_Menu_MouseTracking:case SH_Menu_MouseTracking: never executed: case SH_Menu_MouseTracking: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
655 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
656 | case never executed: SH_TitleBar_AutoRaise:case SH_TitleBar_AutoRaise: never executed: case SH_TitleBar_AutoRaise: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
657 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
658 | case never executed: SH_TitleBar_NoBorder:case SH_TitleBar_NoBorder: never executed: case SH_TitleBar_NoBorder: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
659 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
660 | case never executed: SH_ItemView_ShowDecorationSelected:case SH_ItemView_ShowDecorationSelected: never executed: case SH_ItemView_ShowDecorationSelected: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
661 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
662 | case never executed: SH_Table_GridLineColor:case SH_Table_GridLineColor: never executed: case SH_Table_GridLineColor: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
663 | if (option
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
664 | return never executed: option->palette.background().color().darker(120).rgb();return option->palette.background().color().darker(120).rgb(); never executed: return option->palette.background().color().darker(120).rgb(); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
665 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
666 | case never executed: SH_WindowFrame_Mask:case SH_WindowFrame_Mask: never executed: case SH_WindowFrame_Mask: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
667 | if (QStyleHintReturnMask *mask = qstyleoption_cast<QStyleHintReturnMask *>(returnData)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
668 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
669 | mask->region = option->rect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
670 | mask->region -= QRect(option->rect.left(), option->rect.top(), 5, 1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
671 | mask->region -= QRect(option->rect.left(), option->rect.top() + 1, 3, 1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
672 | mask->region -= QRect(option->rect.left(), option->rect.top() + 2, 2, 1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
673 | mask->region -= QRect(option->rect.left(), option->rect.top() + 3, 1, 2); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
674 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
675 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
676 | mask->region -= QRect(option->rect.right() - 4, option->rect.top(), 5, 1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
677 | mask->region -= QRect(option->rect.right() - 2, option->rect.top() + 1, 3, 1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
678 | mask->region -= QRect(option->rect.right() - 1, option->rect.top() + 2, 2, 1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
679 | mask->region -= QRect(option->rect.right() , option->rect.top() + 3, 1, 2); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
680 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
681 | return never executed: QCommonStyle::styleHint(hint, option, widget, returnData);return QCommonStyle::styleHint(hint, option, widget, returnData); never executed: return QCommonStyle::styleHint(hint, option, widget, returnData); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
682 | case never executed: SH_MessageBox_TextInteractionFlags:case SH_MessageBox_TextInteractionFlags: never executed: case SH_MessageBox_TextInteractionFlags: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
683 | return never executed: Qt::TextSelectableByMouse | Qt::LinksAccessibleByMouse;return Qt::TextSelectableByMouse | Qt::LinksAccessibleByMouse; never executed: return Qt::TextSelectableByMouse | Qt::LinksAccessibleByMouse; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
684 | case never executed: SH_MessageBox_CenterButtons:case SH_MessageBox_CenterButtons: never executed: case SH_MessageBox_CenterButtons: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
685 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
686 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
687 | case never executed: SH_WizardStyle:case SH_WizardStyle: never executed: case SH_WizardStyle: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
688 | return never executed: QWizard::ClassicStyle;return QWizard::ClassicStyle; never executed: return QWizard::ClassicStyle; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
689 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
690 | case never executed: SH_ItemView_ArrowKeysNavigateIntoChildren:case SH_ItemView_ArrowKeysNavigateIntoChildren: never executed: case SH_ItemView_ArrowKeysNavigateIntoChildren: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
691 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
692 | case never executed: SH_DialogButtonLayout:case SH_DialogButtonLayout: never executed: {case SH_DialogButtonLayout: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
693 | int ret = QDialogButtonBox::GnomeLayout; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
694 | gboolean alternateOrder = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
695 | GtkSettings *settings = d->gtk_settings_get_default(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
696 | g_object_get(settings, "gtk-alternative-button-order", &alternateOrder, __null); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
697 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
698 | if (alternateOrder
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
699 | ret = QDialogButtonBox::WinLayout; never executed: ret = QDialogButtonBox::WinLayout; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
700 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
701 | return never executed: ret;return ret; never executed: return ret; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
702 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
703 | break; dead code: break; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
704 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
705 | case never executed: SH_ToolButtonStyle:case SH_ToolButtonStyle: never executed: case SH_ToolButtonStyle: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
706 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
707 | if (d->isKDE4Session()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
708 | return never executed: QCommonStyle::styleHint(hint, option, widget, returnData);return QCommonStyle::styleHint(hint, option, widget, returnData); never executed: return QCommonStyle::styleHint(hint, option, widget, returnData); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
709 | GtkWidget *gtkToolbar = d->gtkWidget("GtkToolbar"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
710 | GtkToolbarStyle toolbar_style = GTK_TOOLBAR_ICONS; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
711 | g_object_get(gtkToolbar, "toolbar-style", &toolbar_style, __null); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
712 | switch (toolbar_style) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
713 | case never executed: GTK_TOOLBAR_TEXT:case GTK_TOOLBAR_TEXT: never executed: case GTK_TOOLBAR_TEXT: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
714 | return never executed: Qt::ToolButtonTextOnly;return Qt::ToolButtonTextOnly; never executed: return Qt::ToolButtonTextOnly; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
715 | case never executed: GTK_TOOLBAR_BOTH:case GTK_TOOLBAR_BOTH: never executed: case GTK_TOOLBAR_BOTH: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
716 | return never executed: Qt::ToolButtonTextUnderIcon;return Qt::ToolButtonTextUnderIcon; never executed: return Qt::ToolButtonTextUnderIcon; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
717 | case never executed: GTK_TOOLBAR_BOTH_HORIZ:case GTK_TOOLBAR_BOTH_HORIZ: never executed: case GTK_TOOLBAR_BOTH_HORIZ: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
718 | return never executed: Qt::ToolButtonTextBesideIcon;return Qt::ToolButtonTextBesideIcon; never executed: return Qt::ToolButtonTextBesideIcon; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
719 | case never executed: GTK_TOOLBAR_ICONS:case GTK_TOOLBAR_ICONS: never executed: case GTK_TOOLBAR_ICONS: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
720 | default never executed: :default: never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
721 | return never executed: Qt::ToolButtonIconOnly;return Qt::ToolButtonIconOnly; never executed: return Qt::ToolButtonIconOnly; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
722 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
723 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
724 | break; dead code: break; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
725 | case never executed: SH_SpinControls_DisableOnBounds:case SH_SpinControls_DisableOnBounds: never executed: case SH_SpinControls_DisableOnBounds: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
726 | return never executed: int(true);return int(true); never executed: return int(true); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
727 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
728 | case never executed: SH_DitherDisabledText:case SH_DitherDisabledText: never executed: case SH_DitherDisabledText: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
729 | return never executed: int(false);return int(false); never executed: return int(false); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
730 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
731 | case never executed: SH_ComboBox_Popup:case SH_ComboBox_Popup: never executed: {case SH_ComboBox_Popup: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
732 | GtkWidget *gtkComboBox = d->gtkWidget("GtkComboBox"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
733 | gboolean appears_as_list; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
734 | d->gtk_widget_style_get((GtkWidget*)gtkComboBox, "appears-as-list", &appears_as_list, __null); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
735 | return never executed: appears_as_listreturn appears_as_list ? 0 : 1;
never executed: return appears_as_list ? 0 : 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
736 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
737 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
738 | case never executed: SH_MenuBar_AltKeyNavigation:case SH_MenuBar_AltKeyNavigation: never executed: case SH_MenuBar_AltKeyNavigation: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
739 | return never executed: int(false);return int(false); never executed: return int(false); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
740 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
741 | case never executed: SH_EtchDisabledText:case SH_EtchDisabledText: never executed: case SH_EtchDisabledText: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
742 | return never executed: int(false);return int(false); never executed: return int(false); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
743 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
744 | case never executed: SH_Menu_SubMenuPopupDelay:case SH_Menu_SubMenuPopupDelay: never executed: {case SH_Menu_SubMenuPopupDelay: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
745 | gint delay = 225; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
746 | GtkSettings *settings = d->gtk_settings_get_default(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
747 | g_object_get(settings, "gtk-menu-popup-delay", &delay, __null); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
748 | return never executed: delay;return delay; never executed: return delay; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
749 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
750 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
751 | case never executed: SH_ScrollView_FrameOnlyAroundContents:case SH_ScrollView_FrameOnlyAroundContents: never executed: {case SH_ScrollView_FrameOnlyAroundContents: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
752 | gboolean scrollbars_within_bevel = false; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
753 | if (widget
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
754 | scrollbars_within_bevel = true; never executed: scrollbars_within_bevel = true; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
755 | else if (!d->gtk_check_version(2, 12, 0)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
756 | GtkWidget *gtkScrollWindow = d->gtkWidget("GtkScrolledWindow"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
757 | d->gtk_widget_style_get(gtkScrollWindow, "scrollbars-within-bevel", &scrollbars_within_bevel, __null); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
758 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
759 | return never executed: !scrollbars_within_bevel;return !scrollbars_within_bevel; never executed: return !scrollbars_within_bevel; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
760 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
761 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
762 | case never executed: SH_DialogButtonBox_ButtonsHaveIcons:case SH_DialogButtonBox_ButtonsHaveIcons: never executed: {case SH_DialogButtonBox_ButtonsHaveIcons: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
763 | static bool buttonsHaveIcons = d->getGConfBool(QLatin1String("/desktop/gnome/interface/buttons_have_icons")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
764 | return never executed: buttonsHaveIcons;return buttonsHaveIcons; never executed: return buttonsHaveIcons; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
765 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
766 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
767 | case never executed: SH_UnderlineShortcut:case SH_UnderlineShortcut: never executed: {case SH_UnderlineShortcut: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
768 | gboolean underlineShortcut = true; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
769 | if (!d->gtk_check_version(2, 12, 0)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
770 | GtkSettings *settings = d->gtk_settings_get_default(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
771 | g_object_get(settings, "gtk-enable-mnemonics", &underlineShortcut, __null); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
772 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
773 | return never executed: underlineShortcut;return underlineShortcut; never executed: return underlineShortcut; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
774 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
775 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
776 | default never executed: :default: never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
777 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
778 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
779 | return never executed: QCommonStyle::styleHint(hint, option, widget, returnData);return QCommonStyle::styleHint(hint, option, widget, returnData); never executed: return QCommonStyle::styleHint(hint, option, widget, returnData); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
780 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
781 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
782 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
783 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
784 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
785 | void QGtkStyle::drawPrimitive(PrimitiveElement element, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
786 | const QStyleOption *option, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
787 | QPainter *painter, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
788 | const QWidget *widget) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
789 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
790 | const QGtkStylePrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
791 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
792 | if (!d->isThemeAvailable()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
793 | QCommonStyle::drawPrimitive(element, option, painter, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
794 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
795 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
796 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
797 | GtkStyle* style = d->gtkStyle(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
798 | QGtkPainter* gtkPainter = d->gtkPainter(painter); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
799 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
800 | switch (element) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
801 | case never executed: PE_Frame:case PE_Frame: never executed: {case PE_Frame: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
802 | if (widget
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
803 | QStyleOption copy = *option; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
804 | copy.state |= State_Raised; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
805 | proxy()->drawPrimitive(PE_PanelMenu, ©, painter, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
806 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
807 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
808 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
809 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
810 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
811 | const int pmSize = 64; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
812 | const int border = proxy()->pixelMetric(PM_DefaultFrameWidth, option, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
813 | const QString pmKey = QLatin1String("windowframe") % HexString<uint>(option->state); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
814 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
815 | QPixmap pixmap; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
816 | QRect pmRect(QPoint(0,0), QSize(pmSize, pmSize)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
817 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
818 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
819 | if (!QPixmapCache::find(pmKey, pixmap)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
820 | pixmap = QPixmap(pmSize, pmSize); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
821 | pixmap.fill(Qt::transparent); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
822 | QPainter pmPainter(&pixmap); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
823 | gtkPainter->reset(&pmPainter); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
824 | gtkPainter->setUsePixmapCache(false); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
825 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
826 | GtkShadowType shadow_type = GTK_SHADOW_NONE; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
827 | if (option->state & State_Sunken
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
828 | shadow_type = GTK_SHADOW_IN; never executed: shadow_type = GTK_SHADOW_IN; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
829 | else if (option->state & State_Raised
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
830 | shadow_type = GTK_SHADOW_OUT; never executed: shadow_type = GTK_SHADOW_OUT; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
831 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
832 | GtkStyle *style = d->gtk_rc_get_style_by_paths(d->gtk_settings_get_default(), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
833 | "*.GtkScrolledWindow", "*.GtkScrolledWindow", d->gtk_window_get_type()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
834 | if (style
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
835 | gtkPainter->paintShadow(d->gtkWidget("GtkFrame"), "viewport", pmRect, never executed: gtkPainter->paintShadow(d->gtkWidget("GtkFrame"), "viewport", pmRect, option->state & State_Enabled ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE, shadow_type, style); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
836 | option->state & State_Enabled ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE, never executed: gtkPainter->paintShadow(d->gtkWidget("GtkFrame"), "viewport", pmRect, option->state & State_Enabled ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE, shadow_type, style); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
837 | shadow_type, style); never executed: gtkPainter->paintShadow(d->gtkWidget("GtkFrame"), "viewport", pmRect, option->state & State_Enabled ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE, shadow_type, style); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
838 | QPixmapCache::insert(pmKey, pixmap); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
839 | gtkPainter->reset(painter); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
840 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
841 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
842 | QRect rect = option->rect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
843 | const int rw = rect.width() - border; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
844 | const int rh = rect.height() - border; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
845 | const int pw = pmRect.width() - border; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
846 | const int ph = pmRect.height() - border; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
847 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
848 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
849 | painter->drawPixmap(rect.adjusted(border, 0, -border, -rh), pixmap, pmRect.adjusted(border, 0, -border,-ph)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
850 | painter->drawPixmap(rect.adjusted(border, rh, -border, 0), pixmap, pmRect.adjusted(border, ph,-border,0)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
851 | painter->drawPixmap(rect.adjusted(0, border, -rw, -border), pixmap, pmRect.adjusted(0, border, -pw, -border)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
852 | painter->drawPixmap(rect.adjusted(rw, border, 0, -border), pixmap, pmRect.adjusted(pw, border, 0, -border)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
853 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
854 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
855 | painter->drawPixmap(rect.adjusted(0, 0, -rw, -rh), pixmap, pmRect.adjusted(0, 0, -pw,-ph)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
856 | painter->drawPixmap(rect.adjusted(rw, 0, 0, -rh), pixmap, pmRect.adjusted(pw, 0, 0,-ph)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
857 | painter->drawPixmap(rect.adjusted(0, rh, -rw, 0), pixmap, pmRect.adjusted(0, ph, -pw,0)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
858 | painter->drawPixmap(rect.adjusted(rw, rh, 0, 0), pixmap, pmRect.adjusted(pw, ph, 0,0)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
859 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
860 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
861 | case never executed: PE_FrameWindow:case PE_FrameWindow: never executed: case PE_FrameWindow: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
862 | painter->save(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
863 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
864 | QRect rect= option->rect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
865 | painter->setPen(QPen(option->palette.dark().color().darker(150), 0)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
866 | painter->drawRect(option->rect.adjusted(0, 0, -1, -1)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
867 | painter->setPen(QPen(option->palette.light(), 0)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
868 | painter->drawLine(QPoint(rect.left() + 1, rect.top() + 1), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
869 | QPoint(rect.left() + 1, rect.bottom() - 1)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
870 | painter->setPen(QPen(option->palette.background().color().darker(120), 0)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
871 | painter->drawLine(QPoint(rect.left() + 1, rect.bottom() - 1), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
872 | QPoint(rect.right() - 2, rect.bottom() - 1)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
873 | painter->drawLine(QPoint(rect.right() - 1, rect.top() + 1), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
874 | QPoint(rect.right() - 1, rect.bottom() - 1)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
875 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
876 | painter->restore(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
877 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
878 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
879 | case never executed: PE_PanelTipLabel:case PE_PanelTipLabel: never executed: {case PE_PanelTipLabel: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
880 | GtkWidget *gtkWindow = d->gtkWidget("GtkWindow"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
881 | style = d->gtk_rc_get_style_by_paths(d->gtk_settings_get_default(), "gtk-tooltips", "GtkWindow", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
882 | d->gtk_window_get_type()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
883 | gtkPainter->paintFlatBox(gtkWindow, "tooltip", option->rect, GTK_STATE_NORMAL, GTK_SHADOW_NONE, style); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
884 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
885 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
886 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
887 | case never executed: PE_PanelStatusBar:case PE_PanelStatusBar: never executed: {case PE_PanelStatusBar: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
888 | if (widget
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
889 | option->palette.resolve() & (1 << QPalette::Window)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
890 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
891 | painter->fillRect(option->rect, option->palette.window()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
892 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
893 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
894 | GtkShadowType shadow_type; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
895 | GtkWidget *gtkStatusbarFrame = d->gtkWidget("GtkStatusbar.GtkFrame"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
896 | d->gtk_widget_style_get(d->gtk_widget_get_parent(gtkStatusbarFrame), "shadow-type", &shadow_type, __null); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
897 | gtkPainter->paintShadow(gtkStatusbarFrame, "frame", option->rect, GTK_STATE_NORMAL, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
898 | shadow_type, d->gtk_widget_get_style(gtkStatusbarFrame)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
899 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
900 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
901 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
902 | case never executed: PE_IndicatorHeaderArrow:case PE_IndicatorHeaderArrow: never executed: case PE_IndicatorHeaderArrow: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
903 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
904 | GtkWidget *gtkTreeHeader = d->gtkWidget("GtkTreeView.GtkButton"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
905 | GtkStateType state = qt_gtk_state(option); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
906 | style = d->gtk_widget_get_style(gtkTreeHeader); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
907 | GtkArrowType type = GTK_ARROW_UP; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
908 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
909 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
910 | if (header->sortIndicator & QStyleOptionHeader::SortUp
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
911 | type = GTK_ARROW_UP; never executed: type = GTK_ARROW_UP; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
912 | else if (header->sortIndicator & QStyleOptionHeader::SortDown
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
913 | type = GTK_ARROW_DOWN; never executed: type = GTK_ARROW_DOWN; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
914 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
915 | gtkPainter->paintArrow(gtkTreeHeader, "button", option->rect.adjusted(1, 1, -1, -1), type, state, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
916 | GTK_SHADOW_NONE, false, style); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
917 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
918 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
919 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
920 | case never executed: PE_FrameDefaultButton:case PE_FrameDefaultButton: never executed: case PE_FrameDefaultButton: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
921 | case never executed: PE_FrameFocusRect:case PE_FrameFocusRect: never executed: {case PE_FrameFocusRect: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
922 | QRect frameRect = option->rect.adjusted(1, 1, -2, -2); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
923 | if (qobject_cast<const QAbstractItemView*>(widget)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
924 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
925 | } never executed: else if (qobject_cast<const QTabBar*>(widget)end of block
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
926 | GtkWidget *gtkNotebook = d->gtkWidget("GtkNotebook"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
927 | style = d->gtk_widget_get_style(gtkNotebook); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
928 | gtkPainter->paintFocus(gtkNotebook, "tab", frameRect.adjusted(-1, 1, 1, 1), GTK_STATE_ACTIVE, style); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
929 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
930 | GtkWidget *gtkRadioButton = d->gtkWidget("GtkRadioButton"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
931 | gtkPainter->paintFocus(gtkRadioButton, "radiobutton", frameRect, GTK_STATE_ACTIVE, style); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
932 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
933 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
934 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
935 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
936 | case never executed: PE_IndicatorBranch:case PE_IndicatorBranch: never executed: case PE_IndicatorBranch: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
937 | if (option->state & State_Children
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
938 | QRect rect = option->rect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
939 | rect = QRect(0, 0, 12, 12); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
940 | rect.moveCenter(option->rect.center()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
941 | rect.translate(2, 0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
942 | GtkExpanderStyle openState = GTK_EXPANDER_EXPANDED; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
943 | GtkExpanderStyle closedState = GTK_EXPANDER_COLLAPSED; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
944 | GtkWidget *gtkTreeView = d->gtkWidget("GtkTreeView"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
945 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
946 | GtkStateType state = GTK_STATE_NORMAL; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
947 | if (!(option->state & State_Enabled)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
948 | state = GTK_STATE_INSENSITIVE; never executed: state = GTK_STATE_INSENSITIVE; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
949 | else if (option->state & State_MouseOver
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
950 | state = GTK_STATE_PRELIGHT; never executed: state = GTK_STATE_PRELIGHT; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
951 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
952 | gtkPainter->paintExpander(gtkTreeView, "treeview", rect, state, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
953 | option->state & State_Open ? openState : closedState , d->gtk_widget_get_style(gtkTreeView)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
954 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
955 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
956 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
957 | case never executed: PE_PanelItemViewRow:case PE_PanelItemViewRow: never executed: case PE_PanelItemViewRow: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
958 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
959 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
960 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
961 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
962 | QCommonStyle::drawPrimitive(element, option, painter, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
963 | if (!(option->state & State_Selected)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
964 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
965 | } else { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
966 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
967 | if (!qobject_cast<QStyledItemDelegate*>(view->itemDelegate())
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
968 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
969 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
970 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
971 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
972 | case never executed: PE_PanelItemViewItem:case PE_PanelItemViewItem: never executed: case PE_PanelItemViewItem: code before this statement never executed: case PE_PanelItemViewItem: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
973 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
974 | uint resolve_mask = vopt->palette.resolve(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
975 | if (vopt->backgroundBrush.style() != Qt::NoBrush
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
976 | || (
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
977 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
978 | QPointF oldBO = painter->brushOrigin(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
979 | painter->setBrushOrigin(vopt->rect.topLeft()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
980 | painter->fillRect(vopt->rect, vopt->backgroundBrush); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
981 | painter->setBrushOrigin(oldBO); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
982 | if (!(option->state & State_Selected)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
983 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
984 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
985 | if (GtkWidget *gtkTreeView = d->gtkWidget("GtkTreeView")
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
986 | const char *detail = "cell_even_ruled"; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
987 | if (vopt
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
988 | detail = "cell_odd_ruled"; never executed: detail = "cell_odd_ruled"; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
989 | bool isActive = option->state & State_Active; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
990 | QString key; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
991 | if (isActive
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
992 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
993 | key = QLatin1String("a"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
994 | QGtkStylePrivate::gtkWidgetSetFocus(gtkTreeView, true); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
995 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
996 | bool isEnabled = (widget
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
997 | gtkPainter->paintFlatBox(gtkTreeView, detail, option->rect, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
998 | option->state & State_Selected ? GTK_STATE_SELECTED : | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
999 | isEnabled ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1000 | GTK_SHADOW_OUT, d->gtk_widget_get_style(gtkTreeView), key); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1001 | if (isActive
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1002 | QGtkStylePrivate::gtkWidgetSetFocus(gtkTreeView, false); never executed: QGtkStylePrivate::gtkWidgetSetFocus(gtkTreeView, false); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1003 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1004 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1005 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1006 | case never executed: PE_IndicatorToolBarSeparator:case PE_IndicatorToolBarSeparator: never executed: case PE_IndicatorToolBarSeparator: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1007 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1008 | const int margin = 6; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1009 | GtkWidget *gtkSeparator = d->gtkWidget("GtkToolbar.GtkSeparatorToolItem"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1010 | if (option->state & State_Horizontal
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1011 | const int offset = option->rect.width()/2; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1012 | QRect rect = option->rect.adjusted(offset, margin, 0, -margin); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1013 | painter->setPen(QPen(option->palette.background().color().darker(110))); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1014 | gtkPainter->paintVline(gtkSeparator, "vseparator", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1015 | rect, GTK_STATE_NORMAL, d->gtk_widget_get_style(gtkSeparator), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1016 | 0, rect.height(), 0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1017 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1018 | const int offset = option->rect.height()/2; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1019 | QRect rect = option->rect.adjusted(margin, offset, -margin, 0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1020 | painter->setPen(QPen(option->palette.background().color().darker(110))); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1021 | gtkPainter->paintHline(gtkSeparator, "hseparator", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1022 | rect, GTK_STATE_NORMAL, d->gtk_widget_get_style(gtkSeparator), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1023 | 0, rect.width(), 0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1024 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1025 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1026 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1027 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1028 | case never executed: PE_IndicatorToolBarHandle:case PE_IndicatorToolBarHandle: never executed: {case PE_IndicatorToolBarHandle: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1029 | GtkWidget *gtkToolbar = d->gtkWidget("GtkToolbar"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1030 | GtkShadowType shadow_type; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1031 | d->gtk_widget_style_get(gtkToolbar, "shadow-type", &shadow_type, __null); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1032 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1033 | painter->setClipRect(option->rect); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1034 | gtkPainter->paintHandle(gtkToolbar, "toolbar", option->rect.adjusted(-1, -1 ,0 ,1), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1035 | GTK_STATE_NORMAL, shadow_type, !(option->state & State_Horizontal) ? | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1036 | GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL, d->gtk_widget_get_style(gtkToolbar)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1037 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1038 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1039 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1040 | case never executed: PE_IndicatorArrowUp:case PE_IndicatorArrowUp: never executed: case PE_IndicatorArrowUp: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1041 | case never executed: PE_IndicatorArrowDown:case PE_IndicatorArrowDown: never executed: case PE_IndicatorArrowDown: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1042 | case never executed: PE_IndicatorArrowLeft:case PE_IndicatorArrowLeft: never executed: case PE_IndicatorArrowLeft: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1043 | case never executed: PE_IndicatorArrowRight:case PE_IndicatorArrowRight: never executed: {case PE_IndicatorArrowRight: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1044 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1045 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1046 | GtkArrowType type = GTK_ARROW_UP; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1047 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1048 | switch (element) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1049 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1050 | case never executed: PE_IndicatorArrowDown:case PE_IndicatorArrowDown: never executed: case PE_IndicatorArrowDown: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1051 | type = GTK_ARROW_DOWN; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1052 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1053 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1054 | case never executed: PE_IndicatorArrowLeft:case PE_IndicatorArrowLeft: never executed: case PE_IndicatorArrowLeft: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1055 | type = GTK_ARROW_LEFT; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1056 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1057 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1058 | case never executed: PE_IndicatorArrowRight:case PE_IndicatorArrowRight: never executed: case PE_IndicatorArrowRight: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1059 | type = GTK_ARROW_RIGHT; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1060 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1061 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1062 | default never executed: :default: never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1063 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1064 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1065 | int size = qMin(option->rect.height(), option->rect.width()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1066 | int border = (
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1067 | int bsx = 0, bsy = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1068 | if (option->state & State_Sunken
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1069 | bsx = proxy()->pixelMetric(PM_ButtonShiftHorizontal); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1070 | bsy = proxy()->pixelMetric(PM_ButtonShiftVertical); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1071 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1072 | QRect arrowRect = option->rect.adjusted(border + bsx, border + bsy, -border + bsx, -border + bsy); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1073 | GtkShadowType shadow = option->state & State_Sunken
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1074 | GtkStateType state = qt_gtk_state(option); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1075 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1076 | QColor arrowColor = option->palette.buttonText().color(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1077 | GtkWidget *gtkArrow = d->gtkWidget("GtkArrow"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1078 | GdkColor color = fromQColor(arrowColor); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1079 | d->gtk_widget_modify_fg (gtkArrow, state, &color); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1080 | gtkPainter->paintArrow(gtkArrow, "button", arrowRect, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1081 | type, state, shadow, false, d->gtk_widget_get_style(gtkArrow), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1082 | QString::number(arrowColor.rgba(), 16)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1083 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1084 | d->gtk_widget_modify_fg (gtkArrow, state, __null); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1085 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1086 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1087 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1088 | case never executed: PE_FrameGroupBox:case PE_FrameGroupBox: never executed: case PE_FrameGroupBox: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1089 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1090 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1091 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1092 | case never executed: PE_PanelMenu:case PE_PanelMenu: never executed: {case PE_PanelMenu: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1093 | GtkWidget *gtkMenu = d->gtkWidget("GtkMenu"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1094 | gtkPainter->setAlphaSupport(false); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1095 | gtkPainter->paintBox(gtkMenu, "menu", option->rect, GTK_STATE_NORMAL, GTK_SHADOW_OUT, d->gtk_widget_get_style(gtkMenu), QString()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1096 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1097 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1098 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1099 | case never executed: PE_FrameMenu:case PE_FrameMenu: never executed: case PE_FrameMenu: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1100 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1101 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1102 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1103 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1104 | if (qobject_cast<const QToolBar *>(widget)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1105 | GtkWidget *gtkMenubar = d->gtkWidget("GtkMenuBar"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1106 | gtkPainter->paintBox(gtkMenubar, "toolbar", option->rect, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1107 | GTK_STATE_NORMAL, GTK_SHADOW_OUT, style); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1108 | gtkPainter->paintBox(gtkMenubar, "menu", option->rect, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1109 | GTK_STATE_NORMAL, GTK_SHADOW_OUT, style); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1110 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1111 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1112 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1113 | case never executed: PE_FrameLineEdit:case PE_FrameLineEdit: never executed: {case PE_FrameLineEdit: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1114 | GtkWidget *gtkEntry = d->gtkWidget("GtkEntry"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1115 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1116 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1117 | gboolean interior_focus; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1118 | gint focus_line_width; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1119 | QRect rect = option->rect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1120 | d->gtk_widget_style_get(gtkEntry, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1121 | "interior-focus", &interior_focus, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1122 | "focus-line-width", &focus_line_width, __null); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1123 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1124 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1125 | g_object_set_data(((((GObject*) g_type_check_instance_cast ((GTypeInstance*) ((gtkEntry)), (((GType) ((20) << (2)))))))), "transparent-bg-hint", ((gpointer) (glong) (true))); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1126 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1127 | if (!interior_focus
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1128 | rect.adjust(focus_line_width, focus_line_width, -focus_line_width, -focus_line_width); never executed: rect.adjust(focus_line_width, focus_line_width, -focus_line_width, -focus_line_width); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1129 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1130 | if (option->state & State_HasFocus
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1131 | QGtkStylePrivate::gtkWidgetSetFocus(gtkEntry, true); never executed: QGtkStylePrivate::gtkWidgetSetFocus(gtkEntry, true); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1132 | gtkPainter->paintShadow(gtkEntry, "entry", rect, option->state & State_Enabled ? | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1133 | GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1134 | GTK_SHADOW_IN, d->gtk_widget_get_style(gtkEntry), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1135 | option->state & State_HasFocus ? QLatin1String("focus") : QString()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1136 | if (!interior_focus
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1137 | gtkPainter->paintShadow(gtkEntry, "entry", option->rect, option->state & State_Enabled ? never executed: gtkPainter->paintShadow(gtkEntry, "entry", option->rect, option->state & State_Enabled ? GTK_STATE_ACTIVE : GTK_STATE_INSENSITIVE, GTK_SHADOW_IN, d->gtk_widget_get_style(gtkEntry), QLatin1String("GtkEntryShadowIn")); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1138 | GTK_STATE_ACTIVE : GTK_STATE_INSENSITIVE, never executed: gtkPainter->paintShadow(gtkEntry, "entry", option->rect, option->state & State_Enabled ? GTK_STATE_ACTIVE : GTK_STATE_INSENSITIVE, GTK_SHADOW_IN, d->gtk_widget_get_style(gtkEntry), QLatin1String("GtkEntryShadowIn")); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1139 | GTK_SHADOW_IN, d->gtk_widget_get_style(gtkEntry), QLatin1String("GtkEntryShadowIn")); never executed: gtkPainter->paintShadow(gtkEntry, "entry", option->rect, option->state & State_Enabled ? GTK_STATE_ACTIVE : GTK_STATE_INSENSITIVE, GTK_SHADOW_IN, d->gtk_widget_get_style(gtkEntry), QLatin1String("GtkEntryShadowIn")); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1140 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1141 | if (option->state & State_HasFocus
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1142 | QGtkStylePrivate::gtkWidgetSetFocus(gtkEntry, false); never executed: QGtkStylePrivate::gtkWidgetSetFocus(gtkEntry, false); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1143 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1144 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1145 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1146 | case never executed: PE_PanelLineEdit:case PE_PanelLineEdit: never executed: case PE_PanelLineEdit: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1147 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1148 | GtkWidget *gtkEntry = d->gtkWidget("GtkEntry"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1149 | if (panel->lineWidth > 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1150 | proxy()->drawPrimitive(PE_FrameLineEdit, option, painter, widget); never executed: proxy()->drawPrimitive(PE_FrameLineEdit, option, painter, widget); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1151 | uint resolve_mask = option->palette.resolve(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1152 | GtkStyle *gtkEntryStyle = d->gtk_widget_get_style(gtkEntry); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1153 | QRect textRect = option->rect.adjusted(gtkEntryStyle->xthickness, gtkEntryStyle->ythickness, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1154 | -gtkEntryStyle->xthickness, -gtkEntryStyle->ythickness); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1155 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1156 | if (widget
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1157 | resolve_mask & (1 << QPalette::Base)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1158 | painter->fillRect(textRect, option->palette.base()); never executed: painter->fillRect(textRect, option->palette.base()); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1159 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1160 | gtkPainter->paintFlatBox(gtkEntry, "entry_bg", textRect, never executed: gtkPainter->paintFlatBox(gtkEntry, "entry_bg", textRect, option->state & State_Enabled ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE, GTK_SHADOW_NONE, gtkEntryStyle); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1161 | option->state & State_Enabled ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE, GTK_SHADOW_NONE, gtkEntryStyle); never executed: gtkPainter->paintFlatBox(gtkEntry, "entry_bg", textRect, option->state & State_Enabled ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE, GTK_SHADOW_NONE, gtkEntryStyle); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1162 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1163 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1164 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1165 | case never executed: PE_FrameTabWidget:case PE_FrameTabWidget: never executed: case PE_FrameTabWidget: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1166 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1167 | GtkWidget *gtkNotebook = d->gtkWidget("GtkNotebook"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1168 | style = d->gtk_widget_get_style(gtkNotebook); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1169 | gtkPainter->setAlphaSupport(false); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1170 | GtkShadowType shadow = GTK_SHADOW_OUT; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1171 | GtkStateType state = GTK_STATE_NORMAL; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1172 | bool reverse = (option->direction == Qt::RightToLeft); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1173 | QGtkStylePrivate::gtk_widget_set_direction(gtkNotebook, reverse ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1174 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1175 | GtkPositionType frameType = GTK_POS_TOP; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1176 | QTabBar::Shape shape = frame->shape; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1177 | int gapStart = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1178 | int gapSize = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1179 | if (shape == QTabBar::RoundedNorth
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1180 | frameType = (
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1181 | gapStart = tabframe->selectedTabRect.left(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1182 | gapSize = tabframe->selectedTabRect.width(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1183 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1184 | frameType = (
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1185 | gapStart = tabframe->selectedTabRect.y(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1186 | gapSize = tabframe->selectedTabRect.height(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1187 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1188 | gtkPainter->paintBoxGap(gtkNotebook, "notebook", option->rect, state, shadow, frameType, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1189 | gapStart, gapSize, style); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1190 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1191 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1192 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1193 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1194 | gtkPainter->paintBox(gtkNotebook, "notebook", option->rect, state, shadow, style); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1195 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1196 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1197 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1198 | case never executed: PE_PanelButtonCommand:case PE_PanelButtonCommand: never executed: case PE_PanelButtonCommand: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1199 | case never executed: PE_PanelButtonTool:case PE_PanelButtonTool: never executed: {case PE_PanelButtonTool: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1200 | bool isDefault = false; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1201 | bool isTool = (element == PE_PanelButtonTool); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1202 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1203 | isDefault = btn->features & QStyleOptionButton::DefaultButton; never executed: isDefault = btn->features & QStyleOptionButton::DefaultButton; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1204 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1205 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1206 | if (isTool
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1207 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1208 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1209 | if (widget
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1210 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1211 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1212 | GtkStateType state = qt_gtk_state(option); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1213 | if (option->state & State_On
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1214 | state = GTK_STATE_ACTIVE; never executed: state = GTK_STATE_ACTIVE; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1215 | GtkWidget *gtkButton = isTool
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1216 | gint focusWidth, focusPad; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1217 | gboolean interiorFocus = false; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1218 | d->gtk_widget_style_get (gtkButton, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1219 | "focus-line-width", &focusWidth, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1220 | "focus-padding", &focusPad, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1221 | "interior-focus", &interiorFocus, __null); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1222 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1223 | style = d->gtk_widget_get_style(gtkButton); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1224 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1225 | QRect buttonRect = option->rect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1226 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1227 | QString key; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1228 | if (isDefault
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1229 | key += QLatin1String("def"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1230 | QGtkStylePrivate::gtk_widget_set_can_default(gtkButton, true); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1231 | QGtkStylePrivate::gtk_window_set_default((GtkWindow*)QGtkStylePrivate::gtk_widget_get_toplevel(gtkButton), gtkButton); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1232 | gtkPainter->paintBox(gtkButton, "buttondefault", buttonRect, state, GTK_SHADOW_IN, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1233 | style, isDefault ? QLatin1String("d") : QString()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1234 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1235 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1236 | bool hasFocus = option->state & State_HasFocus; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1237 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1238 | if (hasFocus
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1239 | key += QLatin1String("def"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1240 | QGtkStylePrivate::gtkWidgetSetFocus(gtkButton, true); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1241 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1242 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1243 | if (!interiorFocus
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1244 | buttonRect = buttonRect.adjusted(focusWidth, focusWidth, -focusWidth, -focusWidth); never executed: buttonRect = buttonRect.adjusted(focusWidth, focusWidth, -focusWidth, -focusWidth); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1245 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1246 | GtkShadowType shadow = (option->state & State_Sunken
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1247 | GTK_SHADOW_IN : GTK_SHADOW_OUT; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1248 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1249 | gtkPainter->paintBox(gtkButton, "button", buttonRect, state, shadow, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1250 | style, key); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1251 | if (isDefault
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1252 | QGtkStylePrivate::gtk_window_set_default((GtkWindow*)QGtkStylePrivate::gtk_widget_get_toplevel(gtkButton), 0); never executed: QGtkStylePrivate::gtk_window_set_default((GtkWindow*)QGtkStylePrivate::gtk_widget_get_toplevel(gtkButton), 0); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1253 | if (hasFocus
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1254 | QGtkStylePrivate::gtkWidgetSetFocus(gtkButton, false); never executed: QGtkStylePrivate::gtkWidgetSetFocus(gtkButton, false); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1255 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1256 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1257 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1258 | case never executed: PE_IndicatorRadioButton:case PE_IndicatorRadioButton: never executed: {case PE_IndicatorRadioButton: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1259 | GtkShadowType shadow = GTK_SHADOW_OUT; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1260 | GtkStateType state = qt_gtk_state(option); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1261 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1262 | if (option->state & State_Sunken
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1263 | state = GTK_STATE_ACTIVE; never executed: state = GTK_STATE_ACTIVE; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1264 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1265 | if (option->state & State_NoChange
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1266 | shadow = GTK_SHADOW_ETCHED_IN; never executed: shadow = GTK_SHADOW_ETCHED_IN; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1267 | else if (option->state & State_On
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1268 | shadow = GTK_SHADOW_IN; never executed: shadow = GTK_SHADOW_IN; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1269 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1270 | shadow = GTK_SHADOW_OUT; never executed: shadow = GTK_SHADOW_OUT; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1271 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1272 | GtkWidget *gtkRadioButton = d->gtkWidget("GtkRadioButton"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1273 | gint spacing; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1274 | d->gtk_widget_style_get(gtkRadioButton, "indicator-spacing", &spacing, __null); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1275 | QRect buttonRect = option->rect.adjusted(spacing, spacing, -spacing, -spacing); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1276 | gtkPainter->setClipRect(option->rect); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1277 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1278 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1279 | GtkWidget *gtkCheckButton = d->gtkWidget("GtkCheckButton"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1280 | QString key(QLatin1String("radiobutton")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1281 | if (option->state & State_HasFocus
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1282 | key += QLatin1Char('f'); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1283 | QGtkStylePrivate::gtkWidgetSetFocus(gtkCheckButton, true); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1284 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1285 | gtkPainter->paintOption(gtkCheckButton , buttonRect, state, shadow, d->gtk_widget_get_style(gtkRadioButton), key); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1286 | if (option->state & State_HasFocus
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1287 | QGtkStylePrivate::gtkWidgetSetFocus(gtkCheckButton, false); never executed: QGtkStylePrivate::gtkWidgetSetFocus(gtkCheckButton, false); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1288 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1289 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1290 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1291 | case never executed: PE_IndicatorCheckBox:case PE_IndicatorCheckBox: never executed: {case PE_IndicatorCheckBox: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1292 | GtkShadowType shadow = GTK_SHADOW_OUT; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1293 | GtkStateType state = qt_gtk_state(option); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1294 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1295 | if (option->state & State_Sunken
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1296 | state = GTK_STATE_ACTIVE; never executed: state = GTK_STATE_ACTIVE; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1297 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1298 | if (option->state & State_NoChange
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1299 | shadow = GTK_SHADOW_ETCHED_IN; never executed: shadow = GTK_SHADOW_ETCHED_IN; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1300 | else if (option->state & State_On
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1301 | shadow = GTK_SHADOW_IN; never executed: shadow = GTK_SHADOW_IN; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1302 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1303 | shadow = GTK_SHADOW_OUT; never executed: shadow = GTK_SHADOW_OUT; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1304 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1305 | int spacing; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1306 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1307 | GtkWidget *gtkCheckButton = d->gtkWidget("GtkCheckButton"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1308 | QString key(QLatin1String("checkbutton")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1309 | if (option->state & State_HasFocus
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1310 | key += QLatin1Char('f'); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1311 | QGtkStylePrivate::gtkWidgetSetFocus(gtkCheckButton, true); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1312 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1313 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1314 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1315 | gtkPainter->setClipRect(option->rect); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1316 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1317 | d->gtk_widget_style_get(gtkCheckButton, "indicator-spacing", &spacing, __null); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1318 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1319 | QRect checkRect = option->rect.adjusted(spacing, spacing, -spacing, -spacing); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1320 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1321 | gtkPainter->paintCheckbox(gtkCheckButton, checkRect, state, shadow, d->gtk_widget_get_style(gtkCheckButton), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1322 | key); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1323 | if (option->state & State_HasFocus
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1324 | QGtkStylePrivate::gtkWidgetSetFocus(gtkCheckButton, false); never executed: QGtkStylePrivate::gtkWidgetSetFocus(gtkCheckButton, false); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1325 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1326 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1327 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1328 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1329 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1330 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1331 | case never executed: PE_FrameTabBarBase:case PE_FrameTabBarBase: never executed: case PE_FrameTabBarBase: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1332 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1333 | = qstyleoption_cast<const QStyleOptionTabBarBase *>(option)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1334 | QRect tabRect = tbb->rect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1335 | painter->save(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1336 | painter->setPen(QPen(option->palette.dark().color().dark(110), 0)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1337 | switch (tbb->shape) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1338 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1339 | case never executed: QTabBar::RoundedNorth:case QTabBar::RoundedNorth: never executed: case QTabBar::RoundedNorth: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1340 | painter->drawLine(tabRect.topLeft(), tabRect.topRight()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1341 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1342 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1343 | case never executed: QTabBar::RoundedWest:case QTabBar::RoundedWest: never executed: case QTabBar::RoundedWest: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1344 | painter->drawLine(tabRect.left(), tabRect.top(), tabRect.left(), tabRect.bottom()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1345 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1346 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1347 | case never executed: QTabBar::RoundedSouth:case QTabBar::RoundedSouth: never executed: case QTabBar::RoundedSouth: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1348 | painter->drawLine(tbb->rect.left(), tbb->rect.bottom(), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1349 | tabRect.right(), tabRect.bottom()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1350 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1351 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1352 | case never executed: QTabBar::RoundedEast:case QTabBar::RoundedEast: never executed: case QTabBar::RoundedEast: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1353 | painter->drawLine(tabRect.topRight(), tabRect.bottomRight()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1354 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1355 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1356 | case never executed: QTabBar::TriangularNorth:case QTabBar::TriangularNorth: never executed: case QTabBar::TriangularNorth: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1357 | case never executed: QTabBar::TriangularEast:case QTabBar::TriangularEast: never executed: case QTabBar::TriangularEast: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1358 | case never executed: QTabBar::TriangularWest:case QTabBar::TriangularWest: never executed: case QTabBar::TriangularWest: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1359 | case never executed: QTabBar::TriangularSouth:case QTabBar::TriangularSouth: never executed: case QTabBar::TriangularSouth: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1360 | painter->restore(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1361 | QCommonStyle::drawPrimitive(element, option, painter, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1362 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1363 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1364 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1365 | painter->restore(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1366 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1367 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1368 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1369 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1370 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1371 | case never executed: PE_Widget:case PE_Widget: never executed: case PE_Widget: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1372 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1373 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1374 | default never executed: :default: never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1375 | QCommonStyle::drawPrimitive(element, option, painter, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1376 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1377 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1378 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1379 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1380 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1381 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1382 | void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionComplex *option, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1383 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1384 | QPainter *painter, const QWidget *widget) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1385 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1386 | const QGtkStylePrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1387 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1388 | if (!d->isThemeAvailable()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1389 | QCommonStyle::drawComplexControl(control, option, painter, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1390 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1391 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1392 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1393 | GtkStyle* style = d->gtkStyle(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1394 | QGtkPainter* gtkPainter = d->gtkPainter(painter); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1395 | QColor button = option->palette.button().color(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1396 | QColor dark; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1397 | QColor grooveColor; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1398 | QColor darkOutline; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1399 | dark.setHsv(button.hue(), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1400 | qMin(255, (int)(button.saturation()*1.9)), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1401 | qMin(255, (int)(button.value()*0.7))); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1402 | grooveColor.setHsv(button.hue(), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1403 | qMin(255, (int)(button.saturation()*2.6)), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1404 | qMin(255, (int)(button.value()*0.9))); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1405 | darkOutline.setHsv(button.hue(), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1406 | qMin(255, (int)(button.saturation()*3.0)), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1407 | qMin(255, (int)(button.value()*0.6))); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1408 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1409 | QColor alphaCornerColor; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1410 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1411 | if (widget
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1412 | alphaCornerColor = mergedColors(option->palette.color(widget->backgroundRole()), darkOutline); never executed: alphaCornerColor = mergedColors(option->palette.color(widget->backgroundRole()), darkOutline); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1413 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1414 | alphaCornerColor = mergedColors(option->palette.background().color(), darkOutline); never executed: alphaCornerColor = mergedColors(option->palette.background().color(), darkOutline); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1415 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1416 | switch (control) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1417 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1418 | case never executed: CC_TitleBar:case CC_TitleBar: never executed: case CC_TitleBar: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1419 | painter->save(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1420 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1421 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1422 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1423 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1424 | GdkColor gdkBg = style->bg[GTK_STATE_SELECTED]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1425 | QColor bgColor(gdkBg.red>>8, gdkBg.green>>8, gdkBg.blue>>8); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1426 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1427 | const int buttonMargin = 5; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1428 | bool active = (titleBar->titleBarState & State_Active); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1429 | QRect fullRect = titleBar->rect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1430 | QPalette palette = option->palette; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1431 | QColor highlight = bgColor; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1432 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1433 | QColor titleBarFrameBorder(active ? highlight.darker(180): dark.darker(110)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1434 | QColor titleBarHighlight(active ? highlight.lighter(120): palette.background().color().lighter(120)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1435 | QColor textColor(active ? 0xffffff : 0xff000000); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1436 | QColor textAlphaColor(active ? 0xffffff : 0xff000000 ); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1437 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1438 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1439 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1440 | QColor titlebarColor = QColor(active ? highlight: palette.background().color()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1441 | QLinearGradient gradient(option->rect.center().x(), option->rect.top(), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1442 | option->rect.center().x(), option->rect.bottom()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1443 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1444 | gradient.setColorAt(0, titlebarColor.lighter(114)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1445 | gradient.setColorAt(0.5, titlebarColor.lighter(102)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1446 | gradient.setColorAt(0.51, titlebarColor.darker(104)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1447 | gradient.setColorAt(1, titlebarColor); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1448 | painter->fillRect(option->rect.adjusted(1, 1, -1, 0), gradient); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1449 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1450 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1451 | painter->setPen(titleBarFrameBorder); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1452 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1453 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1454 | painter->drawLine(fullRect.left() + 5, fullRect.top(), fullRect.right() - 5, fullRect.top()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1455 | painter->drawLine(fullRect.left(), fullRect.top() + 4, fullRect.left(), fullRect.bottom()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1456 | const QPoint points[5] = { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1457 | QPoint(fullRect.left() + 4, fullRect.top() + 1), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1458 | QPoint(fullRect.left() + 3, fullRect.top() + 1), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1459 | QPoint(fullRect.left() + 2, fullRect.top() + 2), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1460 | QPoint(fullRect.left() + 1, fullRect.top() + 3), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1461 | QPoint(fullRect.left() + 1, fullRect.top() + 4) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1462 | }; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1463 | painter->drawPoints(points, 5); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1464 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1465 | painter->drawLine(fullRect.right(), fullRect.top() + 4, fullRect.right(), fullRect.bottom()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1466 | const QPoint points2[5] = { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1467 | QPoint(fullRect.right() - 3, fullRect.top() + 1), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1468 | QPoint(fullRect.right() - 4, fullRect.top() + 1), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1469 | QPoint(fullRect.right() - 2, fullRect.top() + 2), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1470 | QPoint(fullRect.right() - 1, fullRect.top() + 3), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1471 | QPoint(fullRect.right() - 1, fullRect.top() + 4) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1472 | }; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1473 | painter->drawPoints(points2, 5); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1474 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1475 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1476 | painter->drawLine(fullRect.right(), fullRect.bottom(), fullRect.left(), fullRect.bottom()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1477 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1478 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1479 | painter->setPen(titleBarHighlight); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1480 | painter->drawLine(fullRect.left() + 6, fullRect.top() + 1, fullRect.right() - 6, fullRect.top() + 1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1481 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1482 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1483 | QRect textRect = proxy()->subControlRect(CC_TitleBar, titleBar, SC_TitleBarLabel, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1484 | QFont font = painter->font(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1485 | font.setBold(true); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1486 | painter->setFont(font); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1487 | painter->setPen(active? (titleBar->palette.text().color().lighter(120)) : | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1488 | titleBar->palette.text().color() ); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1489 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1490 | QString title = QFontMetrics(font).elidedText(titleBar->text, Qt::ElideRight, textRect.width() - 14); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1491 | painter->drawText(textRect.adjusted(1, 1, 1, 1), title, QTextOption(Qt::AlignHCenter | Qt::AlignVCenter)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1492 | painter->setPen(Qt::white); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1493 | if (active
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1494 | painter->drawText(textRect, title, QTextOption(Qt::AlignHCenter | Qt::AlignVCenter)); never executed: painter->drawText(textRect, title, QTextOption(Qt::AlignHCenter | Qt::AlignVCenter)); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1495 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1496 | if ((
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1497 | !(titleBar->titleBarState& Qt::WindowMinimized)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1498 | QRect minButtonRect = proxy()->subControlRect(CC_TitleBar, titleBar, SC_TitleBarMinButton, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1499 | if (minButtonRect.isValid()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1500 | bool hover = (
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1501 | bool sunken = (
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1502 | qt_gtk_draw_mdibutton(painter, titleBar, minButtonRect, hover, sunken); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1503 | QRect minButtonIconRect = minButtonRect.adjusted(buttonMargin ,buttonMargin , -buttonMargin, -buttonMargin); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1504 | painter->setPen(textColor); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1505 | painter->drawLine(minButtonIconRect.center().x() - 2, minButtonIconRect.center().y() + 3, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1506 | minButtonIconRect.center().x() + 3, minButtonIconRect.center().y() + 3); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1507 | painter->drawLine(minButtonIconRect.center().x() - 2, minButtonIconRect.center().y() + 4, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1508 | minButtonIconRect.center().x() + 3, minButtonIconRect.center().y() + 4); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1509 | painter->setPen(textAlphaColor); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1510 | painter->drawLine(minButtonIconRect.center().x() - 3, minButtonIconRect.center().y() + 3, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1511 | minButtonIconRect.center().x() - 3, minButtonIconRect.center().y() + 4); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1512 | painter->drawLine(minButtonIconRect.center().x() + 4, minButtonIconRect.center().y() + 3, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1513 | minButtonIconRect.center().x() + 4, minButtonIconRect.center().y() + 4); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1514 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1515 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1516 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1517 | if ((
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1518 | !(titleBar->titleBarState & Qt::WindowMaximized)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1519 | QRect maxButtonRect = proxy()->subControlRect(CC_TitleBar, titleBar, SC_TitleBarMaxButton, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1520 | if (maxButtonRect.isValid()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1521 | bool hover = (
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1522 | bool sunken = (
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1523 | qt_gtk_draw_mdibutton(painter, titleBar, maxButtonRect, hover, sunken); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1524 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1525 | QRect maxButtonIconRect = maxButtonRect.adjusted(buttonMargin, buttonMargin, -buttonMargin, -buttonMargin); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1526 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1527 | painter->setPen(textColor); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1528 | painter->drawRect(maxButtonIconRect.adjusted(0, 0, -1, -1)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1529 | painter->drawLine(maxButtonIconRect.left() + 1, maxButtonIconRect.top() + 1, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1530 | maxButtonIconRect.right() - 1, maxButtonIconRect.top() + 1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1531 | painter->setPen(textAlphaColor); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1532 | const QPoint points[4] = { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1533 | maxButtonIconRect.topLeft(), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1534 | maxButtonIconRect.topRight(), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1535 | maxButtonIconRect.bottomLeft(), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1536 | maxButtonIconRect.bottomRight() | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1537 | }; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1538 | painter->drawPoints(points, 4); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1539 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1540 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1541 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1542 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1543 | if ((
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1544 | QRect closeButtonRect = proxy()->subControlRect(CC_TitleBar, titleBar, SC_TitleBarCloseButton, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1545 | if (closeButtonRect.isValid()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1546 | bool hover = (
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1547 | bool sunken = (
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1548 | qt_gtk_draw_mdibutton(painter, titleBar, closeButtonRect, hover, sunken); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1549 | QRect closeIconRect = closeButtonRect.adjusted(buttonMargin, buttonMargin, -buttonMargin, -buttonMargin); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1550 | painter->setPen(textAlphaColor); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1551 | const QLine lines[4] = { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1552 | QLine(closeIconRect.left() + 1, closeIconRect.top(), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1553 | closeIconRect.right(), closeIconRect.bottom() - 1), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1554 | QLine(closeIconRect.left(), closeIconRect.top() + 1, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1555 | closeIconRect.right() - 1, closeIconRect.bottom()), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1556 | QLine(closeIconRect.right() - 1, closeIconRect.top(), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1557 | closeIconRect.left(), closeIconRect.bottom() - 1), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1558 | QLine(closeIconRect.right(), closeIconRect.top() + 1, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1559 | closeIconRect.left() + 1, closeIconRect.bottom()) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1560 | }; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1561 | painter->drawLines(lines, 4); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1562 | const QPoint points[4] = { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1563 | closeIconRect.topLeft(), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1564 | closeIconRect.topRight(), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1565 | closeIconRect.bottomLeft(), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1566 | closeIconRect.bottomRight() | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1567 | }; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1568 | painter->drawPoints(points, 4); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1569 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1570 | painter->setPen(textColor); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1571 | painter->drawLine(closeIconRect.left() + 1, closeIconRect.top() + 1, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1572 | closeIconRect.right() - 1, closeIconRect.bottom() - 1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1573 | painter->drawLine(closeIconRect.left() + 1, closeIconRect.bottom() - 1, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1574 | closeIconRect.right() - 1, closeIconRect.top() + 1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1575 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1576 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1577 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1578 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1579 | if ((
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1580 | (((
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1581 | (
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1582 | ((
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1583 | (
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1584 | QRect normalButtonRect = proxy()->subControlRect(CC_TitleBar, titleBar, SC_TitleBarNormalButton, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1585 | if (normalButtonRect.isValid()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1586 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1587 | bool hover = (
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1588 | bool sunken = (
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1589 | QRect normalButtonIconRect = normalButtonRect.adjusted(buttonMargin, buttonMargin, -buttonMargin, -buttonMargin); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1590 | qt_gtk_draw_mdibutton(painter, titleBar, normalButtonRect, hover, sunken); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1591 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1592 | QRect frontWindowRect = normalButtonIconRect.adjusted(0, 3, -3, 0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1593 | painter->setPen(textColor); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1594 | painter->drawRect(frontWindowRect.adjusted(0, 0, -1, -1)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1595 | painter->drawLine(frontWindowRect.left() + 1, frontWindowRect.top() + 1, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1596 | frontWindowRect.right() - 1, frontWindowRect.top() + 1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1597 | painter->setPen(textAlphaColor); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1598 | const QPoint points[4] = { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1599 | frontWindowRect.topLeft(), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1600 | frontWindowRect.topRight(), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1601 | frontWindowRect.bottomLeft(), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1602 | frontWindowRect.bottomRight() | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1603 | }; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1604 | painter->drawPoints(points, 4); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1605 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1606 | QRect backWindowRect = normalButtonIconRect.adjusted(3, 0, 0, -3); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1607 | QRegion clipRegion = backWindowRect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1608 | clipRegion -= frontWindowRect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1609 | painter->save(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1610 | painter->setClipRegion(clipRegion); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1611 | painter->setPen(textColor); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1612 | painter->drawRect(backWindowRect.adjusted(0, 0, -1, -1)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1613 | painter->drawLine(backWindowRect.left() + 1, backWindowRect.top() + 1, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1614 | backWindowRect.right() - 1, backWindowRect.top() + 1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1615 | painter->setPen(textAlphaColor); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1616 | const QPoint points2[4] = { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1617 | backWindowRect.topLeft(), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1618 | backWindowRect.topRight(), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1619 | backWindowRect.bottomLeft(), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1620 | backWindowRect.bottomRight() | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1621 | }; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1622 | painter->drawPoints(points2, 4); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1623 | painter->restore(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1624 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1625 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1626 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1627 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1628 | if (titleBar->subControls & SC_TitleBarContextHelpButton
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1629 | && (
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1630 | QRect contextHelpButtonRect = proxy()->subControlRect(CC_TitleBar, titleBar, SC_TitleBarContextHelpButton, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1631 | if (contextHelpButtonRect.isValid()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1632 | bool hover = (
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1633 | bool sunken = (
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1634 | qt_gtk_draw_mdibutton(painter, titleBar, contextHelpButtonRect, hover, sunken); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1635 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1636 | QColor blend; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1637 | QImage image(qt_titlebar_context_help); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1638 | QColor alpha = textColor; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1639 | alpha.setAlpha(128); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1640 | image.setColor(1, textColor.rgba()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1641 | image.setColor(2, alpha.rgba()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1642 | painter->setRenderHint(QPainter::SmoothPixmapTransform); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1643 | painter->drawImage(contextHelpButtonRect.adjusted(4, 4, -4, -4), image); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1644 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1645 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1646 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1647 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1648 | if (titleBar->subControls & SC_TitleBarShadeButton
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1649 | QRect shadeButtonRect = proxy()->subControlRect(CC_TitleBar, titleBar, SC_TitleBarShadeButton, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1650 | if (shadeButtonRect.isValid()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1651 | bool hover = (
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1652 | bool sunken = (
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1653 | qt_gtk_draw_mdibutton(painter, titleBar, shadeButtonRect, hover, sunken); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1654 | QImage image(qt_scrollbar_button_arrow_up); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1655 | image.setColor(1, textColor.rgba()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1656 | painter->drawImage(shadeButtonRect.adjusted(5, 7, -5, -7), image); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1657 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1658 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1659 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1660 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1661 | if (titleBar->subControls & SC_TitleBarUnshadeButton
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1662 | QRect unshadeButtonRect = proxy()->subControlRect(CC_TitleBar, titleBar, SC_TitleBarUnshadeButton, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1663 | if (unshadeButtonRect.isValid()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1664 | bool hover = (
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1665 | bool sunken = (
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1666 | qt_gtk_draw_mdibutton(painter, titleBar, unshadeButtonRect, hover, sunken); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1667 | QImage image(qt_scrollbar_button_arrow_down); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1668 | image.setColor(1, textColor.rgba()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1669 | painter->drawImage(unshadeButtonRect.adjusted(5, 7, -5, -7), image); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1670 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1671 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1672 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1673 | if ((
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1674 | QRect iconRect = proxy()->subControlRect(CC_TitleBar, titleBar, SC_TitleBarSysMenu, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1675 | if (iconRect.isValid()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1676 | if (!titleBar->icon.isNull()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1677 | titleBar->icon.paint(painter, iconRect); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1678 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1679 | QStyleOption tool = *titleBar; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1680 | QPixmap pm = proxy()->standardIcon(SP_TitleBarMenuButton, &tool, widget).pixmap(16, 16); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1681 | tool.rect = iconRect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1682 | painter->save(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1683 | proxy()->drawItemPixmap(painter, iconRect, Qt::AlignCenter, pm); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1684 | painter->restore(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1685 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1686 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1687 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1688 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1689 | painter->restore(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1690 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1691 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1692 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1693 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1694 | case never executed: CC_GroupBox:case CC_GroupBox: never executed: case CC_GroupBox: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1695 | painter->save(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1696 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1697 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1698 | QRect textRect = proxy()->subControlRect(CC_GroupBox, groupBox, SC_GroupBoxLabel, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1699 | QRect checkBoxRect = proxy()->subControlRect(CC_GroupBox, groupBox, SC_GroupBoxCheckBox, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1700 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1701 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1702 | if ((
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1703 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1704 | GtkWidget *gtkCheckButton = d->gtkWidget("GtkCheckButton"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1705 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1706 | if (option->state & State_MouseOver
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1707 | QRect bgRect = textRect | checkBoxRect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1708 | gtkPainter->paintFlatBox(gtkCheckButton, "checkbutton", bgRect.adjusted(0, 0, 0, -2), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1709 | GTK_STATE_PRELIGHT, GTK_SHADOW_ETCHED_OUT, d->gtk_widget_get_style(gtkCheckButton)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1710 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1711 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1712 | if (!groupBox->text.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1713 | int alignment = int(groupBox->textAlignment); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1714 | if (!proxy()->styleHint(QStyle::SH_UnderlineShortcut, option, widget)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1715 | alignment |= Qt::TextHideMnemonic; never executed: alignment |= Qt::TextHideMnemonic; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1716 | QColor textColor = groupBox->textColor; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1717 | int labelState = GTK_STATE_INSENSITIVE; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1718 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1719 | if (option->state & State_Enabled
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1720 | labelState = (
never executed: labelState = (option->state & State_MouseOver) ? GTK_STATE_PRELIGHT : GTK_STATE_NORMAL; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1721 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1722 | GdkColor gdkText = d->gtk_widget_get_style(gtkCheckButton)->fg[labelState]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1723 | textColor = QColor(gdkText.red>>8, gdkText.green>>8, gdkText.blue>>8); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1724 | painter->setPen(textColor); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1725 | QFont font = painter->font(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1726 | font.setBold(true); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1727 | painter->setFont(font); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1728 | painter->drawText(textRect, Qt::TextShowMnemonic | Qt::AlignLeft| alignment, groupBox->text); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1729 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1730 | if (option->state & State_HasFocus
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1731 | gtkPainter->paintFocus(gtkCheckButton, "checkbutton", textRect.adjusted(-4, -1, 0, -3), GTK_STATE_ACTIVE, style); never executed: gtkPainter->paintFocus(gtkCheckButton, "checkbutton", textRect.adjusted(-4, -1, 0, -3), GTK_STATE_ACTIVE, style); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1732 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1733 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1734 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1735 | if (groupBox->subControls & SC_GroupBoxCheckBox
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1736 | QStyleOptionButton box; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1737 | box.QStyleOption::operator=(*groupBox); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1738 | box.rect = checkBoxRect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1739 | proxy()->drawPrimitive(PE_IndicatorCheckBox, &box, painter, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1740 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1741 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1742 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1743 | painter->restore(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1744 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1745 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1746 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1747 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1748 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1749 | case never executed: CC_ComboBox:case CC_ComboBox: never executed: case CC_ComboBox: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1750 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1751 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1752 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1753 | bool sunken = comboBox->state & State_On; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1754 | QRect rect = option->rect; QPixmap internalPixmapCache; QImage imageCache; QPainter *p = painter; QString unique = QStyleHelper::uniqueName((QString::fromLatin1("cb-%0-%1").arg(sunken).arg(comboBox->editable)), option, option->rect.size()); int txType = painter->deviceTransform().type() | painter->worldTransform().type(); bool doPixmapCache = (
never executed: else { if (doPixmapCacheend of block
never executed: ;end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1755 | gtkPainter->reset(p); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1756 | gtkPainter->setUsePixmapCache(false); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1757 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1758 | bool isEnabled = (comboBox->state & State_Enabled); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1759 | bool focus = isEnabled
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1760 | GtkStateType state = qt_gtk_state(option); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1761 | int appears_as_list = !proxy()->styleHint(QStyle::SH_ComboBox_Popup, comboBox, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1762 | QStyleOptionComboBox comboBoxCopy = *comboBox; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1763 | comboBoxCopy.rect = option->rect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1764 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1765 | bool reverse = (option->direction == Qt::RightToLeft); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1766 | QRect rect = option->rect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1767 | QRect arrowButtonRect = proxy()->subControlRect(CC_ComboBox, &comboBoxCopy, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1768 | SC_ComboBoxArrow, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1769 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1770 | GtkShadowType shadow = (option->state & State_Sunken
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1771 | GTK_SHADOW_IN : GTK_SHADOW_OUT; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1772 | const QHashableLatin1Literal comboBoxPath = comboBox->editable
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1773 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1774 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1775 | GtkWidget *gtkCombo = d->gtkWidget(comboBoxPath); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1776 | GtkAllocation geometry = {0, 0, option->rect.width(), option->rect.height()}; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1777 | d->gtk_widget_set_direction(gtkCombo, reverse ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1778 | d->gtk_widget_size_allocate(gtkCombo, &geometry); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1779 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1780 | QHashableLatin1Literal buttonPath = comboBox->editable
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1781 | : QHashableLatin1Literal("GtkComboBox.GtkToggleButton"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1782 | GtkWidget *gtkToggleButton = d->gtkWidget(buttonPath); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1783 | d->gtk_widget_set_direction(gtkToggleButton, reverse ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1784 | if (gtkToggleButton
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1785 | if (focus
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1786 | QGtkStylePrivate::gtkWidgetSetFocus(gtkToggleButton, true); never executed: QGtkStylePrivate::gtkWidgetSetFocus(gtkToggleButton, true); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1787 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1788 | if (comboBox->editable
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1789 | GtkStateType frameState = (
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1790 | QHashableLatin1Literal entryPath = comboBox->editable
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1791 | GtkWidget *gtkEntry = d->gtkWidget(entryPath); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1792 | d->gtk_widget_set_direction(gtkEntry, reverse ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1793 | QRect frameRect = option->rect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1794 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1795 | if (reverse
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1796 | frameRect.setLeft(arrowButtonRect.right()); never executed: frameRect.setLeft(arrowButtonRect.right()); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1797 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1798 | frameRect.setRight(arrowButtonRect.left()); never executed: frameRect.setRight(arrowButtonRect.left()); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1799 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1800 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1801 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1802 | uint resolve_mask = option->palette.resolve(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1803 | GtkStyle *gtkEntryStyle = d->gtk_widget_get_style(gtkEntry); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1804 | QRect contentRect = frameRect.adjusted(gtkEntryStyle->xthickness, gtkEntryStyle->ythickness, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1805 | -gtkEntryStyle->xthickness, -gtkEntryStyle->ythickness); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1806 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1807 | if (focus
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1808 | QGtkStylePrivate::gtkWidgetSetFocus(gtkEntry, true); never executed: QGtkStylePrivate::gtkWidgetSetFocus(gtkEntry, true); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1809 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1810 | if (widget
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1811 | resolve_mask & (1 << QPalette::Base)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1812 | p->fillRect(contentRect, option->palette.base().color()); never executed: p->fillRect(contentRect, option->palette.base().color()); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1813 | else { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1814 | gtkPainter->paintFlatBox(gtkEntry, "entry_bg", contentRect, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1815 | option->state & State_Enabled ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1816 | GTK_SHADOW_NONE, gtkEntryStyle, entryPath.toString() + QString::number(focus)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1817 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1818 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1819 | gtkPainter->paintShadow(gtkEntry, comboBox->editable ? "entry" : "frame", frameRect, frameState, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1820 | GTK_SHADOW_IN, gtkEntryStyle, entryPath.toString() + | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1821 | QString::number(focus) + QString::number(comboBox->editable) + | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1822 | QString::number(option->direction)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1823 | if (focus
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1824 | QGtkStylePrivate::gtkWidgetSetFocus(gtkEntry, false); never executed: QGtkStylePrivate::gtkWidgetSetFocus(gtkEntry, false); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1825 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1826 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1827 | GtkStateType buttonState = GTK_STATE_NORMAL; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1828 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1829 | if (!(option->state & State_Enabled)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1830 | buttonState = GTK_STATE_INSENSITIVE; never executed: buttonState = GTK_STATE_INSENSITIVE; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1831 | else if (option->state & State_Sunken
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1832 | buttonState = GTK_STATE_ACTIVE; never executed: buttonState = GTK_STATE_ACTIVE; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1833 | else if (option->state & State_MouseOver
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1834 | buttonState = GTK_STATE_PRELIGHT; never executed: buttonState = GTK_STATE_PRELIGHT; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1835 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1836 | ((!(gtkToggleButton)) ? qt_assert("gtkToggleButton",__FILE__,1925) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1837 | gtkPainter->paintBox(gtkToggleButton, "button", arrowButtonRect, buttonState, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1838 | shadow, d->gtk_widget_get_style(gtkToggleButton), buttonPath.toString() + | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1839 | QString::number(focus) + QString::number(option->direction)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1840 | if (focus
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1841 | QGtkStylePrivate::gtkWidgetSetFocus(gtkToggleButton, false); never executed: QGtkStylePrivate::gtkWidgetSetFocus(gtkToggleButton, false); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1842 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1843 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1844 | QRect buttonRect = option->rect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1845 | GtkStyle *gtkToggleButtonStyle = d->gtk_widget_get_style(gtkToggleButton); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1846 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1847 | if (focus
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1848 | QGtkStylePrivate::gtkWidgetSetFocus(gtkToggleButton, true); never executed: QGtkStylePrivate::gtkWidgetSetFocus(gtkToggleButton, true); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1849 | gtkPainter->paintBox(gtkToggleButton, "button", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1850 | buttonRect, state, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1851 | shadow, gtkToggleButtonStyle, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1852 | buttonPath.toString() + QString::number(focus)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1853 | if (focus
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1854 | QGtkStylePrivate::gtkWidgetSetFocus(gtkToggleButton, false); never executed: QGtkStylePrivate::gtkWidgetSetFocus(gtkToggleButton, false); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1855 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1856 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1857 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1858 | QHashableLatin1Literal vSeparatorPath = comboBox->editable
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1859 | ? QHashableLatin1Literal("GtkComboBoxEntry.GtkToggleButton.GtkHBox.GtkVSeparator") | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1860 | : QHashableLatin1Literal("GtkComboBox.GtkToggleButton.GtkHBox.GtkVSeparator"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1861 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1862 | if (GtkWidget *gtkVSeparator = d->gtkWidget(vSeparatorPath)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1863 | GtkAllocation allocation; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1864 | d->gtk_widget_get_allocation(gtkVSeparator, &allocation); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1865 | QRect vLineRect(allocation.x, allocation.y, allocation.width, allocation.height); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1866 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1867 | gtkPainter->paintVline(gtkVSeparator, "vseparator", | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1868 | vLineRect, state, d->gtk_widget_get_style(gtkVSeparator), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1869 | 0, vLineRect.height(), 0, vSeparatorPath.toString()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1870 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1871 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1872 | gint interiorFocus = true; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1873 | d->gtk_widget_style_get(gtkToggleButton, "interior-focus", &interiorFocus, __null); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1874 | int xt = interiorFocus
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1875 | int yt = interiorFocus
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1876 | if (focus
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1877 | gtkPainter->paintFocus(gtkToggleButton, "button", never executed: gtkPainter->paintFocus(gtkToggleButton, "button", option->rect.adjusted(xt, yt, -xt, -yt), option->state & State_Sunken ? GTK_STATE_ACTIVE : GTK_STATE_NORMAL, gtkToggleButtonStyle); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1878 | option->rect.adjusted(xt, yt, -xt, -yt), never executed: gtkPainter->paintFocus(gtkToggleButton, "button", option->rect.adjusted(xt, yt, -xt, -yt), option->state & State_Sunken ? GTK_STATE_ACTIVE : GTK_STATE_NORMAL, gtkToggleButtonStyle); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1879 | option->state & State_Sunken ? GTK_STATE_ACTIVE : GTK_STATE_NORMAL, never executed: gtkPainter->paintFocus(gtkToggleButton, "button", option->rect.adjusted(xt, yt, -xt, -yt), option->state & State_Sunken ? GTK_STATE_ACTIVE : GTK_STATE_NORMAL, gtkToggleButtonStyle); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1880 | gtkToggleButtonStyle); never executed: gtkPainter->paintFocus(gtkToggleButton, "button", option->rect.adjusted(xt, yt, -xt, -yt), option->state & State_Sunken ? GTK_STATE_ACTIVE : GTK_STATE_NORMAL, gtkToggleButtonStyle); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1881 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1882 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1883 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1884 | if (comboBox->subControls & SC_ComboBoxArrow
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1885 | if (!isEnabled
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1886 | state = GTK_STATE_INSENSITIVE; never executed: state = GTK_STATE_INSENSITIVE; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1887 | else if (sunken
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1888 | state = GTK_STATE_ACTIVE; never executed: state = GTK_STATE_ACTIVE; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1889 | else if (option->state & State_MouseOver
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1890 | state = GTK_STATE_PRELIGHT; never executed: state = GTK_STATE_PRELIGHT; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1891 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1892 | state = GTK_STATE_NORMAL; never executed: state = GTK_STATE_NORMAL; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1893 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1894 | QHashableLatin1Literal arrowPath(""); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1895 | if (comboBox->editable
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1896 | if (appears_as_list
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1897 | arrowPath = QHashableLatin1Literal("GtkComboBoxEntry.GtkToggleButton.GtkArrow"); never executed: arrowPath = QHashableLatin1Literal("GtkComboBoxEntry.GtkToggleButton.GtkArrow"); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1898 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1899 | arrowPath = QHashableLatin1Literal("GtkComboBoxEntry.GtkToggleButton.GtkHBox.GtkArrow"); never executed: arrowPath = QHashableLatin1Literal("GtkComboBoxEntry.GtkToggleButton.GtkHBox.GtkArrow"); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1900 | } else { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1901 | if (appears_as_list
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1902 | arrowPath = QHashableLatin1Literal("GtkComboBox.GtkToggleButton.GtkArrow"); never executed: arrowPath = QHashableLatin1Literal("GtkComboBox.GtkToggleButton.GtkArrow"); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1903 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1904 | arrowPath = QHashableLatin1Literal("GtkComboBox.GtkToggleButton.GtkHBox.GtkArrow"); never executed: arrowPath = QHashableLatin1Literal("GtkComboBox.GtkToggleButton.GtkHBox.GtkArrow"); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1905 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1906 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1907 | GtkWidget *gtkArrow = d->gtkWidget(arrowPath); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1908 | gfloat scale = 0.7; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1909 | gint minSize = 15; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1910 | QRect arrowWidgetRect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1911 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1912 | if (gtkArrow
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1913 | d->gtk_widget_style_get(gtkArrow, "arrow-scaling", &scale, __null); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1914 | d->gtk_widget_style_get(gtkCombo, "arrow-size", &minSize, __null); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1915 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1916 | if (gtkArrow
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1917 | GtkAllocation allocation; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1918 | d->gtk_widget_get_allocation(gtkArrow, &allocation); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1919 | arrowWidgetRect = QRect(allocation.x, allocation.y, allocation.width, allocation.height); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1920 | style = d->gtk_widget_get_style(gtkArrow); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1921 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1922 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1923 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1924 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1925 | int arrowSize = qMax(qMin(rect.height() - d->gtk_widget_get_style(gtkCombo)->ythickness * 2, minSize), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1926 | qMin(arrowWidgetRect.width(), arrowWidgetRect.height())); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1927 | QRect arrowRect(0, 0, static_cast<int>(arrowSize * scale), static_cast<int>(arrowSize * scale)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1928 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1929 | arrowRect.moveCenter(arrowWidgetRect.center()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1930 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1931 | if (sunken
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1932 | int xoff, yoff; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1933 | const QHashableLatin1Literal toggleButtonPath = comboBox->editable
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1934 | ? QHashableLatin1Literal("GtkComboBoxEntry.GtkToggleButton") | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1935 | : QHashableLatin1Literal("GtkComboBox.GtkToggleButton"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1936 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1937 | GtkWidget *gtkButton = d->gtkWidget(toggleButtonPath); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1938 | d->gtk_widget_style_get(gtkButton, "child-displacement-x", &xoff, __null); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1939 | d->gtk_widget_style_get(gtkButton, "child-displacement-y", &yoff, __null); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1940 | arrowRect = arrowRect.adjusted(xoff, yoff, xoff, yoff); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1941 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1942 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1943 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1944 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1945 | if (gtkArrow
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1946 | gtkPainter->setClipRect(option->rect); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1947 | gtkPainter->paintArrow(gtkArrow, "arrow", arrowRect, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1948 | GTK_ARROW_DOWN, state, GTK_SHADOW_NONE, true, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1949 | style, arrowPath.toString() + QString::number(option->direction)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1950 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1951 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1952 | if (doPixmapCache
never executed: }end of block never executed: ;end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1953 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1954 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1955 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1956 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1957 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1958 | case never executed: CC_ToolButton:case CC_ToolButton: never executed: case CC_ToolButton: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1959 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1960 | = qstyleoption_cast<const QStyleOptionToolButton *>(option)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1961 | QRect button, menuarea; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1962 | button = proxy()->subControlRect(control, toolbutton, SC_ToolButton, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1963 | menuarea = proxy()->subControlRect(control, toolbutton, SC_ToolButtonMenu, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1964 | State bflags = toolbutton->state & ~(State_Sunken | State_MouseOver); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1965 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1966 | if (bflags & State_AutoRaise
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1967 | if (!(bflags & State_MouseOver)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1968 | bflags &= ~State_Raised; never executed: bflags &= ~State_Raised; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1969 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1970 | State mflags = bflags; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1971 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1972 | if (toolbutton->state & State_Sunken
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1973 | if (toolbutton->activeSubControls & SC_ToolButton
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1974 | bflags |= State_Sunken; never executed: bflags |= State_Sunken; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1975 | if (toolbutton->activeSubControls & SC_ToolButtonMenu
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1976 | mflags |= State_Sunken; never executed: mflags |= State_Sunken; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1977 | } never executed: else if (toolbutton->state & State_MouseOverend of block
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1978 | if (toolbutton->activeSubControls & SC_ToolButton
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1979 | bflags |= State_MouseOver; never executed: bflags |= State_MouseOver; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1980 | if (toolbutton->activeSubControls & SC_ToolButtonMenu
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1981 | mflags |= State_MouseOver; never executed: mflags |= State_MouseOver; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1982 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1983 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1984 | QStyleOption tool = *toolbutton; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1985 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1986 | if (toolbutton->subControls & SC_ToolButton
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1987 | if (bflags & (State_Sunken | State_On | State_Raised | State_MouseOver)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1988 | tool.rect = button; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1989 | tool.state = bflags; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1990 | proxy()->drawPrimitive(PE_PanelButtonTool, &tool, painter, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1991 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1992 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1993 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1994 | bool drawMenuArrow = toolbutton->features & QStyleOptionToolButton::HasMenu
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1995 | !(toolbutton->features & QStyleOptionToolButton::MenuButtonPopup)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1996 | int popupArrowSize = drawMenuArrow
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1997 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
1998 | if (toolbutton->state & State_HasFocus
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
1999 | QStyleOptionFocusRect fr; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2000 | fr.QStyleOption::operator=(*toolbutton); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2001 | fr.rect = proxy()->subControlRect(CC_ToolButton, toolbutton, SC_ToolButton, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2002 | fr.rect.adjust(1, 1, -1, -1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2003 | proxy()->drawPrimitive(PE_FrameFocusRect, &fr, painter, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2004 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2005 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2006 | QStyleOptionToolButton label = *toolbutton; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2007 | label.state = bflags; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2008 | GtkWidget *gtkButton = d->gtkWidget("GtkToolButton.GtkButton"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2009 | QPalette pal = toolbutton->palette; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2010 | if (option->state & State_Enabled
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2011 | option->state & State_MouseOver
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2012 | GdkColor gdkText = d->gtk_widget_get_style(gtkButton)->fg[GTK_STATE_PRELIGHT]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2013 | QColor textColor = QColor(gdkText.red>>8, gdkText.green>>8, gdkText.blue>>8); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2014 | pal.setBrush(QPalette::All, QPalette::ButtonText, textColor); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2015 | label.palette = pal; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2016 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2017 | label.rect = button.adjusted(style->xthickness, style->ythickness, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2018 | -style->xthickness - popupArrowSize, -style->ythickness); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2019 | proxy()->drawControl(CE_ToolButtonLabel, &label, painter, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2020 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2021 | if (toolbutton->subControls & SC_ToolButtonMenu
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2022 | tool.rect = menuarea; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2023 | tool.state = mflags; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2024 | if ((mflags & State_Enabled
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2025 | proxy()->drawPrimitive(PE_IndicatorButtonDropDown, &tool, painter, widget); never executed: proxy()->drawPrimitive(PE_IndicatorButtonDropDown, &tool, painter, widget); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2026 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2027 | proxy()->drawPrimitive(PE_IndicatorArrowDown, &tool, painter, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2028 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2029 | } never executed: else if (drawMenuArrowend of block
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2030 | QRect ir = toolbutton->rect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2031 | QStyleOptionToolButton newBtn = *toolbutton; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2032 | newBtn.rect = QRect(ir.right() - popupArrowSize - style->xthickness - 3, ir.height()/2 - 1, popupArrowSize, popupArrowSize); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2033 | proxy()->drawPrimitive(PE_IndicatorArrowDown, &newBtn, painter, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2034 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2035 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2036 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2037 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2038 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2039 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2040 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2041 | case never executed: CC_ScrollBar:case CC_ScrollBar: never executed: case CC_ScrollBar: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2042 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2043 | GtkWidget *gtkHScrollBar = d->gtkWidget("GtkHScrollbar"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2044 | GtkWidget *gtkVScrollBar = d->gtkWidget("GtkVScrollbar"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2045 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2046 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2047 | painter->fillRect(option->rect, option->palette.background()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2048 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2049 | QRect rect = scrollBar->rect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2050 | QRect scrollBarSubLine = proxy()->subControlRect(control, scrollBar, SC_ScrollBarSubLine, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2051 | QRect scrollBarAddLine = proxy()->subControlRect(control, scrollBar, SC_ScrollBarAddLine, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2052 | QRect scrollBarSlider = proxy()->subControlRect(control, scrollBar, SC_ScrollBarSlider, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2053 | QRect grooveRect = proxy()->subControlRect(control, scrollBar, SC_ScrollBarGroove, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2054 | bool horizontal = scrollBar->orientation == Qt::Horizontal; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2055 | GtkWidget * scrollbarWidget = horizontal
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2056 | style = d->gtk_widget_get_style(scrollbarWidget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2057 | gboolean trough_under_steppers = true; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2058 | gboolean trough_side_details = false; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2059 | gboolean activate_slider = false; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2060 | gboolean stepper_size = 14; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2061 | gint trough_border = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2062 | if (!d->gtk_check_version(2, 10, 0)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2063 | d->gtk_widget_style_get((GtkWidget*)(scrollbarWidget), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2064 | "trough-border", &trough_border, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2065 | "trough-side-details", &trough_side_details, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2066 | "trough-under-steppers", &trough_under_steppers, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2067 | "activate-slider", &activate_slider, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2068 | "stepper-size", &stepper_size, __null); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2069 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2070 | if (trough_under_steppers
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2071 | scrollBarAddLine.adjust(trough_border, trough_border, -trough_border, -trough_border); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2072 | scrollBarSubLine.adjust(trough_border, trough_border, -trough_border, -trough_border); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2073 | scrollBarSlider.adjust(horizontal ? -trough_border : 0, horizontal ? 0 : -trough_border, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2074 | horizontal ? trough_border : 0, horizontal ? 0 : trough_border); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2075 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2076 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2077 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2078 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2079 | int maximum = 2; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2080 | int fakePos = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2081 | bool reverse = (option->direction == Qt::RightToLeft); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2082 | if (scrollBar->minimum == scrollBar->maximum
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2083 | maximum = 0; never executed: maximum = 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2084 | if (scrollBar->sliderPosition == scrollBar->maximum
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2085 | fakePos = maximum; never executed: fakePos = maximum; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2086 | else if (scrollBar->sliderPosition > scrollBar->minimum
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2087 | fakePos = maximum - 1; never executed: fakePos = maximum - 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2088 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2089 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2090 | GtkRange *range = (GtkRange*)(horizontal
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2091 | GtkAdjustment *adjustment = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2092 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2093 | if (d->gtk_adjustment_configure
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2094 | adjustment = d->gtk_range_get_adjustment(range); never executed: adjustment = d->gtk_range_get_adjustment(range); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2095 | if (adjustment
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2096 | d->gtk_adjustment_configure(adjustment, fakePos, 0, maximum, 0, 0, 0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2097 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2098 | adjustment = (GtkAdjustment*)d->gtk_adjustment_new(fakePos, 0, maximum, 0, 0, 0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2099 | d->gtk_range_set_adjustment(range, adjustment); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2100 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2101 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2102 | if (scrollBar->subControls & SC_ScrollBarGroove
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2103 | GtkStateType state = GTK_STATE_ACTIVE; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2104 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2105 | if (!(option->state & State_Enabled)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2106 | state = GTK_STATE_INSENSITIVE; never executed: state = GTK_STATE_INSENSITIVE; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2107 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2108 | if (trough_under_steppers
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2109 | grooveRect = option->rect; never executed: grooveRect = option->rect; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2110 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2111 | gtkPainter->paintBox(scrollbarWidget, "trough", grooveRect, state, GTK_SHADOW_IN, style); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2112 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2113 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2114 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2115 | if (scrollBar->subControls & SC_ScrollBarSlider
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2116 | GtkStateType state = GTK_STATE_NORMAL; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2117 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2118 | if (!(option->state & State_Enabled)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2119 | state = GTK_STATE_INSENSITIVE; never executed: state = GTK_STATE_INSENSITIVE; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2120 | else if (activate_slider
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2121 | option->state & State_Sunken
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2122 | state = GTK_STATE_ACTIVE; never executed: state = GTK_STATE_ACTIVE; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2123 | else if (option->state & State_MouseOver
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2124 | state = GTK_STATE_PRELIGHT; never executed: state = GTK_STATE_PRELIGHT; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2125 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2126 | GtkShadowType shadow = GTK_SHADOW_OUT; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2127 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2128 | if (trough_under_steppers
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2129 | if (!horizontal
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2130 | scrollBarSlider.adjust(trough_border, 0, -trough_border, 0); never executed: scrollBarSlider.adjust(trough_border, 0, -trough_border, 0); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2131 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2132 | scrollBarSlider.adjust(0, trough_border, 0, -trough_border); never executed: scrollBarSlider.adjust(0, trough_border, 0, -trough_border); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2133 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2134 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2135 | gtkPainter->paintSlider(scrollbarWidget, "slider", scrollBarSlider, state, shadow, style, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2136 | horizontal ? GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL, QString(QLatin1String("%0%1")).arg(fakePos).arg(maximum)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2137 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2138 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2139 | if (scrollBar->subControls & SC_ScrollBarAddLine
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2140 | GtkAllocation vAllocation; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2141 | vAllocation.y = scrollBarAddLine.top(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2142 | vAllocation.height = scrollBarAddLine.height() - rect.height() + 6; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2143 | d->gtk_widget_set_allocation(gtkVScrollBar, &vAllocation); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2144 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2145 | GtkAllocation hAllocation; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2146 | hAllocation.x = scrollBarAddLine.right(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2147 | hAllocation.width = scrollBarAddLine.width() - rect.width(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2148 | d->gtk_widget_set_allocation(gtkHScrollBar, &hAllocation); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2149 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2150 | GtkShadowType shadow = GTK_SHADOW_OUT; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2151 | GtkStateType state = GTK_STATE_NORMAL; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2152 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2153 | if (!(option->state & State_Enabled)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2154 | state = GTK_STATE_INSENSITIVE; never executed: state = GTK_STATE_INSENSITIVE; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2155 | else if (option->state & State_Sunken
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2156 | state = GTK_STATE_ACTIVE; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2157 | shadow = GTK_SHADOW_IN; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2158 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2159 | } never executed: else if (option->state & State_MouseOverend of block
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2160 | state = GTK_STATE_PRELIGHT; never executed: state = GTK_STATE_PRELIGHT; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2161 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2162 | gtkPainter->paintBox(scrollbarWidget, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2163 | horizontal ? "hscrollbar" : "vscrollbar", scrollBarAddLine, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2164 | state, shadow, style, QLatin1String("add")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2165 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2166 | gtkPainter->paintArrow(scrollbarWidget, horizontal ? "hscrollbar" : "vscrollbar", scrollBarAddLine.adjusted(4, 4, -4, -4), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2167 | horizontal ? (reverse ? GTK_ARROW_LEFT : GTK_ARROW_RIGHT) : | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2168 | GTK_ARROW_DOWN, state, GTK_SHADOW_NONE, false, style); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2169 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2170 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2171 | if (scrollBar->subControls & SC_ScrollBarSubLine
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2172 | GtkAllocation vAllocation; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2173 | vAllocation.y = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2174 | vAllocation.height = scrollBarSubLine.height(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2175 | d->gtk_widget_set_allocation(gtkVScrollBar, &vAllocation); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2176 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2177 | GtkAllocation hAllocation; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2178 | hAllocation.x = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2179 | hAllocation.width = scrollBarSubLine.width(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2180 | d->gtk_widget_set_allocation(gtkHScrollBar, &hAllocation); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2181 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2182 | GtkShadowType shadow = GTK_SHADOW_OUT; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2183 | GtkStateType state = GTK_STATE_NORMAL; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2184 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2185 | if (!(option->state & State_Enabled)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2186 | state = GTK_STATE_INSENSITIVE; never executed: state = GTK_STATE_INSENSITIVE; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2187 | else if (option->state & State_Sunken
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2188 | shadow = GTK_SHADOW_IN; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2189 | state = GTK_STATE_ACTIVE; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2190 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2191 | } never executed: else if (option->state & State_MouseOverend of block
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2192 | state = GTK_STATE_PRELIGHT; never executed: state = GTK_STATE_PRELIGHT; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2193 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2194 | gtkPainter->paintBox(scrollbarWidget, horizontal ? "hscrollbar" : "vscrollbar", scrollBarSubLine, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2195 | state, shadow, style, QLatin1String("sub")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2196 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2197 | gtkPainter->paintArrow(scrollbarWidget, horizontal ? "hscrollbar" : "vscrollbar", scrollBarSubLine.adjusted(4, 4, -4, -4), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2198 | horizontal ? (reverse ? GTK_ARROW_RIGHT : GTK_ARROW_LEFT) : | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2199 | GTK_ARROW_UP, state, GTK_SHADOW_NONE, false, style); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2200 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2201 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2202 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2203 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2204 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2205 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2206 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2207 | case never executed: CC_SpinBox:case CC_SpinBox: never executed: case CC_SpinBox: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2208 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2209 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2210 | GtkWidget *gtkSpinButton = spinBox->buttonSymbols == QAbstractSpinBox::NoButtons
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2211 | ? d->gtkWidget("GtkEntry") | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2212 | : d->gtkWidget("GtkSpinButton"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2213 | bool isEnabled = (spinBox->state & State_Enabled); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2214 | bool hover = isEnabled
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2215 | bool sunken = (spinBox->state & State_Sunken); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2216 | bool upIsActive = (spinBox->activeSubControls == SC_SpinBoxUp); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2217 | bool downIsActive = (spinBox->activeSubControls == SC_SpinBoxDown); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2218 | bool reverse = (spinBox->direction == Qt::RightToLeft); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2219 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2220 | QRect editArea = option->rect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2221 | QRect editRect = proxy()->subControlRect(CC_SpinBox, option, SC_SpinBoxEditField, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2222 | QRect upRect, downRect, buttonRect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2223 | if (spinBox->buttonSymbols != QAbstractSpinBox::NoButtons
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2224 | upRect = proxy()->subControlRect(CC_SpinBox, option, SC_SpinBoxUp, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2225 | downRect = proxy()->subControlRect(CC_SpinBox, option, SC_SpinBoxDown, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2226 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2227 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2228 | upRect.setTop(option->rect.top()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2229 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2230 | if (reverse
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2231 | upRect.setLeft(option->rect.left()); never executed: upRect.setLeft(option->rect.left()); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2232 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2233 | upRect.setRight(option->rect.right()); never executed: upRect.setRight(option->rect.right()); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2234 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2235 | downRect.setBottom(option->rect.bottom()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2236 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2237 | if (reverse
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2238 | downRect.setLeft(option->rect.left()); never executed: downRect.setLeft(option->rect.left()); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2239 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2240 | downRect.setRight(option->rect.right()); never executed: downRect.setRight(option->rect.right()); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2241 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2242 | buttonRect = upRect | downRect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2243 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2244 | if (reverse
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2245 | editArea.setLeft(upRect.right()); never executed: editArea.setLeft(upRect.right()); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2246 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2247 | editArea.setRight(upRect.left()); never executed: editArea.setRight(upRect.left()); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2248 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2249 | if (spinBox->frame
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2250 | GtkStateType state = qt_gtk_state(option); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2251 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2252 | if (!(option->state & State_Enabled)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2253 | state = GTK_STATE_INSENSITIVE; never executed: state = GTK_STATE_INSENSITIVE; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2254 | else if (option->state & State_HasFocus
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2255 | state = GTK_STATE_NORMAL; never executed: state = GTK_STATE_NORMAL; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2256 | else if (state == GTK_STATE_PRELIGHT
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2257 | state = GTK_STATE_NORMAL; never executed: state = GTK_STATE_NORMAL; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2258 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2259 | style = d->gtk_widget_get_style(gtkSpinButton); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2260 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2261 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2262 | QString key; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2263 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2264 | if (option->state & State_HasFocus
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2265 | key += QLatin1Char('f'); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2266 | QGtkStylePrivate::gtkWidgetSetFocus(gtkSpinButton, true); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2267 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2268 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2269 | uint resolve_mask = option->palette.resolve(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2270 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2271 | if (resolve_mask & (1 << QPalette::Base)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2272 | painter->fillRect(editRect, option->palette.base().color()); never executed: painter->fillRect(editRect, option->palette.base().color()); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2273 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2274 | gtkPainter->paintFlatBox(gtkSpinButton, "entry_bg", editArea.adjusted(style->xthickness, style->ythickness, never executed: gtkPainter->paintFlatBox(gtkSpinButton, "entry_bg", editArea.adjusted(style->xthickness, style->ythickness, -style->xthickness, -style->ythickness), option->state & State_Enabled ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE, GTK_SHADOW_NONE, style, key); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2275 | -style->xthickness, -style->ythickness), never executed: gtkPainter->paintFlatBox(gtkSpinButton, "entry_bg", editArea.adjusted(style->xthickness, style->ythickness, -style->xthickness, -style->ythickness), option->state & State_Enabled ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE, GTK_SHADOW_NONE, style, key); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2276 | option->state & State_Enabled ? never executed: gtkPainter->paintFlatBox(gtkSpinButton, "entry_bg", editArea.adjusted(style->xthickness, style->ythickness, -style->xthickness, -style->ythickness), option->state & State_Enabled ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE, GTK_SHADOW_NONE, style, key); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2277 | GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE, GTK_SHADOW_NONE, style, key); never executed: gtkPainter->paintFlatBox(gtkSpinButton, "entry_bg", editArea.adjusted(style->xthickness, style->ythickness, -style->xthickness, -style->ythickness), option->state & State_Enabled ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE, GTK_SHADOW_NONE, style, key); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2278 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2279 | gtkPainter->paintShadow(gtkSpinButton, "entry", editArea, state, GTK_SHADOW_IN, d->gtk_widget_get_style(gtkSpinButton), key); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2280 | if (spinBox->buttonSymbols != QAbstractSpinBox::NoButtons
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2281 | gtkPainter->paintBox(gtkSpinButton, "spinbutton", buttonRect, state, GTK_SHADOW_IN, style, key); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2282 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2283 | upRect.setSize(downRect.size()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2284 | if (!(option->state & State_Enabled)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2285 | gtkPainter->paintBox(gtkSpinButton, "spinbutton_up", upRect, GTK_STATE_INSENSITIVE, GTK_SHADOW_IN, style, key); never executed: gtkPainter->paintBox(gtkSpinButton, "spinbutton_up", upRect, GTK_STATE_INSENSITIVE, GTK_SHADOW_IN, style, key); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2286 | else if (upIsActive
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2287 | gtkPainter->paintBox(gtkSpinButton, "spinbutton_up", upRect, GTK_STATE_ACTIVE, GTK_SHADOW_IN, style, key); never executed: gtkPainter->paintBox(gtkSpinButton, "spinbutton_up", upRect, GTK_STATE_ACTIVE, GTK_SHADOW_IN, style, key); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2288 | else if (upIsActive
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2289 | gtkPainter->paintBox(gtkSpinButton, "spinbutton_up", upRect, GTK_STATE_PRELIGHT, GTK_SHADOW_OUT, style, key); never executed: gtkPainter->paintBox(gtkSpinButton, "spinbutton_up", upRect, GTK_STATE_PRELIGHT, GTK_SHADOW_OUT, style, key); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2290 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2291 | gtkPainter->paintBox(gtkSpinButton, "spinbutton_up", upRect, GTK_STATE_NORMAL, GTK_SHADOW_OUT, style, key); never executed: gtkPainter->paintBox(gtkSpinButton, "spinbutton_up", upRect, GTK_STATE_NORMAL, GTK_SHADOW_OUT, style, key); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2292 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2293 | if (!(option->state & State_Enabled)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2294 | gtkPainter->paintBox(gtkSpinButton, "spinbutton_down", downRect, GTK_STATE_INSENSITIVE, GTK_SHADOW_IN, style, key); never executed: gtkPainter->paintBox(gtkSpinButton, "spinbutton_down", downRect, GTK_STATE_INSENSITIVE, GTK_SHADOW_IN, style, key); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2295 | else if (downIsActive
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2296 | gtkPainter->paintBox(gtkSpinButton, "spinbutton_down", downRect, GTK_STATE_ACTIVE, GTK_SHADOW_IN, style, key); never executed: gtkPainter->paintBox(gtkSpinButton, "spinbutton_down", downRect, GTK_STATE_ACTIVE, GTK_SHADOW_IN, style, key); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2297 | else if (downIsActive
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2298 | gtkPainter->paintBox(gtkSpinButton, "spinbutton_down", downRect, GTK_STATE_PRELIGHT, GTK_SHADOW_OUT, style, key); never executed: gtkPainter->paintBox(gtkSpinButton, "spinbutton_down", downRect, GTK_STATE_PRELIGHT, GTK_SHADOW_OUT, style, key); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2299 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2300 | gtkPainter->paintBox(gtkSpinButton, "spinbutton_down", downRect, GTK_STATE_NORMAL, GTK_SHADOW_OUT, style, key); never executed: gtkPainter->paintBox(gtkSpinButton, "spinbutton_down", downRect, GTK_STATE_NORMAL, GTK_SHADOW_OUT, style, key); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2301 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2302 | if (option->state & State_HasFocus
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2303 | QGtkStylePrivate::gtkWidgetSetFocus(gtkSpinButton, false); never executed: QGtkStylePrivate::gtkWidgetSetFocus(gtkSpinButton, false); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2304 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2305 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2306 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2307 | if (spinBox->buttonSymbols == QAbstractSpinBox::PlusMinus
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2308 | int centerX = upRect.center().x(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2309 | int centerY = upRect.center().y(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2310 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2311 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2312 | if (spinBox->activeSubControls == SC_SpinBoxUp
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2313 | painter->drawLine(1 + centerX - 2, 1 + centerY, 1 + centerX + 2, 1 + centerY); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2314 | painter->drawLine(1 + centerX, 1 + centerY - 2, 1 + centerX, 1 + centerY + 2); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2315 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2316 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2317 | painter->drawLine(centerX - 2, centerY, centerX + 2, centerY); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2318 | painter->drawLine(centerX, centerY - 2, centerX, centerY + 2); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2319 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2320 | centerX = downRect.center().x(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2321 | centerY = downRect.center().y(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2322 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2323 | if (spinBox->activeSubControls == SC_SpinBoxDown
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2324 | painter->drawLine(1 + centerX - 2, 1 + centerY, 1 + centerX + 2, 1 + centerY); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2325 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2326 | painter->drawLine(centerX - 2, centerY, centerX + 2, centerY); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2327 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2328 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2329 | } else if (spinBox->buttonSymbols == QAbstractSpinBox::UpDownArrows
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2330 | int size = d->getSpinboxArrowSize(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2331 | int w = size / 2 - 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2332 | w -= w % 2 - 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2333 | int h = (w + 1)/2; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2334 | QRect arrowRect(0, 0, w, h); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2335 | arrowRect.moveCenter(upRect.center()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2336 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2337 | GtkStateType state = GTK_STATE_NORMAL; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2338 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2339 | if (!(option->state & State_Enabled)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2340 | state = GTK_STATE_INSENSITIVE; never executed: state = GTK_STATE_INSENSITIVE; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2341 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2342 | gtkPainter->paintArrow(gtkSpinButton, "spinbutton", arrowRect, GTK_ARROW_UP, state, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2343 | GTK_SHADOW_NONE, false, style); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2344 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2345 | arrowRect.moveCenter(downRect.center()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2346 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2347 | if (!(option->state & State_Enabled)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2348 | state = GTK_STATE_INSENSITIVE; never executed: state = GTK_STATE_INSENSITIVE; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2349 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2350 | gtkPainter->paintArrow(gtkSpinButton, "spinbutton", arrowRect, GTK_ARROW_DOWN, state, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2351 | GTK_SHADOW_NONE, false, style); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2352 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2353 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2354 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2355 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2356 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2357 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2358 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2359 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2360 | case never executed: CC_Slider:case CC_Slider: never executed: case CC_Slider: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2361 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2362 | GtkWidget *hScaleWidget = d->gtkWidget("GtkHScale"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2363 | GtkWidget *vScaleWidget = d->gtkWidget("GtkVScale"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2364 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2365 | QRect groove = proxy()->subControlRect(CC_Slider, option, SC_SliderGroove, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2366 | QRect handle = proxy()->subControlRect(CC_Slider, option, SC_SliderHandle, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2367 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2368 | bool horizontal = slider->orientation == Qt::Horizontal; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2369 | bool ticksAbove = slider->tickPosition & QSlider::TicksAbove; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2370 | bool ticksBelow = slider->tickPosition & QSlider::TicksBelow; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2371 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2372 | QBrush oldBrush = painter->brush(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2373 | QPen oldPen = painter->pen(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2374 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2375 | QColor shadowAlpha(Qt::black); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2376 | shadowAlpha.setAlpha(10); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2377 | QColor highlightAlpha(Qt::white); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2378 | highlightAlpha.setAlpha(80); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2379 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2380 | QGtkStylePrivate::gtk_widget_set_direction(hScaleWidget, slider->upsideDown ? | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2381 | GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2382 | GtkWidget *scaleWidget = horizontal
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2383 | style = d->gtk_widget_get_style(scaleWidget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2384 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2385 | if ((
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2386 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2387 | GtkRange *range = (GtkRange*)scaleWidget; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2388 | GtkAdjustment *adjustment = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2389 | if (d->gtk_adjustment_configure
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2390 | adjustment = d->gtk_range_get_adjustment(range); never executed: adjustment = d->gtk_range_get_adjustment(range); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2391 | if (adjustment
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2392 | d->gtk_adjustment_configure(adjustment, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2393 | slider->sliderPosition, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2394 | slider->minimum, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2395 | slider->maximum, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2396 | slider->singleStep, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2397 | slider->singleStep, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2398 | slider->pageStep); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2399 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2400 | adjustment = (GtkAdjustment*)d->gtk_adjustment_new(slider->sliderPosition, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2401 | slider->minimum, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2402 | slider->maximum, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2403 | slider->singleStep, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2404 | slider->singleStep, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2405 | slider->pageStep); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2406 | d->gtk_range_set_adjustment(range, adjustment); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2407 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2408 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2409 | int outerSize; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2410 | d->gtk_range_set_inverted(range, !horizontal); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2411 | d->gtk_widget_style_get(scaleWidget, "trough-border", &outerSize, __null); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2412 | outerSize++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2413 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2414 | GtkStateType state = qt_gtk_state(option); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2415 | int focusFrameMargin = 2; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2416 | QRect grooveRect = option->rect.adjusted(focusFrameMargin, outerSize + focusFrameMargin, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2417 | -focusFrameMargin, -outerSize - focusFrameMargin); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2418 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2419 | gboolean trough_side_details = false; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2420 | if (!d->gtk_check_version(2, 10, 0)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2421 | d->gtk_widget_style_get((GtkWidget*)(scaleWidget), "trough-side-details", &trough_side_details, __null); never executed: d->gtk_widget_style_get((GtkWidget*)(scaleWidget), "trough-side-details", &trough_side_details, __null); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2422 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2423 | if (!trough_side_details
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2424 | gtkPainter->paintBox(scaleWidget, "trough", grooveRect, state, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2425 | GTK_SHADOW_IN, style, QString(QLatin1String("p%0")).arg(slider->sliderPosition)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2426 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2427 | QRect upperGroove = grooveRect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2428 | QRect lowerGroove = grooveRect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2429 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2430 | if (horizontal
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2431 | if (slider->upsideDown
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2432 | lowerGroove.setLeft(handle.center().x()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2433 | upperGroove.setRight(handle.center().x()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2434 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2435 | upperGroove.setLeft(handle.center().x()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2436 | lowerGroove.setRight(handle.center().x()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2437 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2438 | } else { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2439 | if (!slider->upsideDown
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2440 | lowerGroove.setBottom(handle.center().y()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2441 | upperGroove.setTop(handle.center().y()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2442 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2443 | upperGroove.setBottom(handle.center().y()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2444 | lowerGroove.setTop(handle.center().y()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2445 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2446 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2447 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2448 | gtkPainter->paintBox(scaleWidget, "trough-upper", upperGroove, state, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2449 | GTK_SHADOW_IN, style, QString(QLatin1String("p%0")).arg(slider->sliderPosition)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2450 | gtkPainter->paintBox(scaleWidget, "trough-lower", lowerGroove, state, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2451 | GTK_SHADOW_IN, style, QString(QLatin1String("p%0")).arg(slider->sliderPosition)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2452 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2453 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2454 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2455 | if (option->subControls & SC_SliderTickmarks
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2456 | painter->setPen(darkOutline); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2457 | int tickSize = proxy()->pixelMetric(PM_SliderTickmarkOffset, option, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2458 | int available = proxy()->pixelMetric(PM_SliderSpaceAvailable, slider, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2459 | int interval = slider->tickInterval; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2460 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2461 | if (interval <= 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2462 | interval = slider->singleStep; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2463 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2464 | if (QStyle::sliderPositionFromValue(slider->minimum, slider->maximum, interval,
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2465 | available)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2466 | - QStyle::sliderPositionFromValue(slider->minimum, slider->maximum,
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2467 | 0, available) < 3
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2468 | interval = slider->pageStep; never executed: interval = slider->pageStep; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2469 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2470 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2471 | if (interval <= 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2472 | interval = 1; never executed: interval = 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2473 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2474 | int v = slider->minimum; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2475 | int len = proxy()->pixelMetric(PM_SliderLength, slider, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2476 | while (v <= slider->maximum + 1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2477 | if (v == slider->maximum + 1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2478 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2479 | const int v_ = qMin(v, slider->maximum); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2480 | int pos = sliderPositionFromValue(slider->minimum, slider->maximum, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2481 | v_, (horizontal | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2482 | ? slider->rect.width() | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2483 | : slider->rect.height()) - len, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2484 | slider->upsideDown) + len / 2; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2485 | int extra = 2 - ((v_ == slider->minimum
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2486 | if (horizontal
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2487 | if (ticksAbove
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2488 | painter->drawLine(pos, slider->rect.top() + extra, never executed: painter->drawLine(pos, slider->rect.top() + extra, pos, slider->rect.top() + tickSize); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2489 | pos, slider->rect.top() + tickSize); never executed: painter->drawLine(pos, slider->rect.top() + extra, pos, slider->rect.top() + tickSize); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2490 | if (ticksBelow
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2491 | painter->drawLine(pos, slider->rect.bottom() - extra, never executed: painter->drawLine(pos, slider->rect.bottom() - extra, pos, slider->rect.bottom() - tickSize); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2492 | pos, slider->rect.bottom() - tickSize); never executed: painter->drawLine(pos, slider->rect.bottom() - extra, pos, slider->rect.bottom() - tickSize); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2493 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2494 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2495 | if (ticksAbove
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2496 | painter->drawLine(slider->rect.left() + extra, pos, never executed: painter->drawLine(slider->rect.left() + extra, pos, slider->rect.left() + tickSize, pos); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2497 | slider->rect.left() + tickSize, pos); never executed: painter->drawLine(slider->rect.left() + extra, pos, slider->rect.left() + tickSize, pos); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2498 | if (ticksBelow
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2499 | painter->drawLine(slider->rect.right() - extra, pos, never executed: painter->drawLine(slider->rect.right() - extra, pos, slider->rect.right() - tickSize, pos); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2500 | slider->rect.right() - tickSize, pos); never executed: painter->drawLine(slider->rect.right() - extra, pos, slider->rect.right() - tickSize, pos); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2501 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2502 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2503 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2504 | int nextInterval = v + interval; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2505 | if (nextInterval < v
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2506 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2507 | v = nextInterval; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2508 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2509 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2510 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2511 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2512 | if (option->subControls & SC_SliderHandle
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2513 | GtkShadowType shadow = GTK_SHADOW_OUT; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2514 | GtkStateType state = GTK_STATE_NORMAL; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2515 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2516 | if (!(option->state & State_Enabled)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2517 | state = GTK_STATE_INSENSITIVE; never executed: state = GTK_STATE_INSENSITIVE; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2518 | else if (option->state & State_MouseOver
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2519 | state = GTK_STATE_PRELIGHT; never executed: state = GTK_STATE_PRELIGHT; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2520 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2521 | bool horizontal = option->state & State_Horizontal; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2522 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2523 | if (slider->state & State_HasFocus
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2524 | QStyleOptionFocusRect fropt; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2525 | fropt.QStyleOption::operator=(*slider); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2526 | fropt.rect = slider->rect.adjusted(-1, -1 ,1, 1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2527 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2528 | if (horizontal
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2529 | fropt.rect.setTop(handle.top() - 3); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2530 | fropt.rect.setBottom(handle.bottom() + 4); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2531 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2532 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2533 | fropt.rect.setLeft(handle.left() - 3); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2534 | fropt.rect.setRight(handle.right() + 3); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2535 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2536 | proxy()->drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2537 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2538 | gtkPainter->paintSlider(scaleWidget, horizontal ? "hscale" : "vscale", handle, state, shadow, style, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2539 | horizontal ? GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2540 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2541 | painter->setBrush(oldBrush); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2542 | painter->setPen(oldPen); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2543 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2544 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2545 | case never executed: CC_Dial:case CC_Dial: never executed: case CC_Dial: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2546 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2547 | QStyleHelper::drawDial(dial, painter); never executed: QStyleHelper::drawDial(dial, painter); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2548 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2549 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2550 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2551 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2552 | default never executed: :default: never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2553 | QCommonStyle::drawComplexControl(control, option, painter, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2554 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2555 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2556 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2557 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2558 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2559 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2560 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2561 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2562 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2563 | void QGtkStyle::drawControl(ControlElement element, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2564 | const QStyleOption *option, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2565 | QPainter *painter, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2566 | const QWidget *widget) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2567 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2568 | const QGtkStylePrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2569 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2570 | if (!d->isThemeAvailable()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2571 | QCommonStyle::drawControl(element, option, painter, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2572 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2573 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2574 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2575 | GtkStyle* style = d->gtkStyle(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2576 | QGtkPainter* gtkPainter = d->gtkPainter(painter); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2577 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2578 | switch (element) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2579 | case never executed: CE_ProgressBarLabel:case CE_ProgressBarLabel: never executed: case CE_ProgressBarLabel: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2580 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2581 | GtkWidget *gtkProgressBar = d->gtkWidget("GtkProgressBar"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2582 | if (!gtkProgressBar
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2583 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2584 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2585 | QRect leftRect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2586 | QRect rect = bar->rect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2587 | GtkStyle *gtkProgressBarStyle = d->gtk_widget_get_style(gtkProgressBar); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2588 | GdkColor gdkText = gtkProgressBarStyle->fg[GTK_STATE_NORMAL]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2589 | QColor textColor = QColor(gdkText.red>>8, gdkText.green>>8, gdkText.blue>>8); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2590 | gdkText = gtkProgressBarStyle->fg[GTK_STATE_PRELIGHT]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2591 | QColor alternateTextColor= QColor(gdkText.red>>8, gdkText.green>>8, gdkText.blue>>8); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2592 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2593 | painter->save(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2594 | bool vertical = false, inverted = false; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2595 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2596 | vertical = (bar2->orientation == Qt::Vertical); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2597 | inverted = bar2->invertedAppearance; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2598 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2599 | if (vertical
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2600 | rect = QRect(rect.left(), rect.top(), rect.height(), rect.width()); never executed: rect = QRect(rect.left(), rect.top(), rect.height(), rect.width()); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2601 | const int progressIndicatorPos = (bar->progress - qreal(bar->minimum)) * rect.width() / | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2602 | qMax(qreal(1.0), qreal(bar->maximum) - bar->minimum); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2603 | if (progressIndicatorPos >= 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2604 | leftRect = QRect(rect.left(), rect.top(), progressIndicatorPos, rect.height()); never executed: leftRect = QRect(rect.left(), rect.top(), progressIndicatorPos, rect.height()); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2605 | if (vertical
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2606 | leftRect.translate(rect.width() - progressIndicatorPos, 0); never executed: leftRect.translate(rect.width() - progressIndicatorPos, 0); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2607 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2608 | bool flip = (!vertical
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2609 | ((
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2610 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2611 | QRegion rightRect = rect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2612 | rightRect = rightRect.subtracted(leftRect); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2613 | painter->setClipRegion(rightRect); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2614 | painter->setPen(flip ? alternateTextColor : textColor); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2615 | painter->drawText(rect, bar->text, QTextOption(Qt::AlignAbsolute | Qt::AlignHCenter | Qt::AlignVCenter)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2616 | if (!leftRect.isNull()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2617 | painter->setPen(flip ? textColor : alternateTextColor); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2618 | painter->setClipRect(leftRect); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2619 | painter->drawText(rect, bar->text, QTextOption(Qt::AlignAbsolute | Qt::AlignHCenter | Qt::AlignVCenter)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2620 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2621 | painter->restore(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2622 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2623 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2624 | case never executed: CE_PushButtonLabel:case CE_PushButtonLabel: never executed: case CE_PushButtonLabel: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2625 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2626 | QRect ir = button->rect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2627 | uint tf = Qt::AlignVCenter | Qt::TextShowMnemonic; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2628 | QPoint buttonShift; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2629 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2630 | if (option->state & State_Sunken
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2631 | buttonShift = QPoint(pixelMetric(PM_ButtonShiftHorizontal, option, widget), never executed: buttonShift = QPoint(pixelMetric(PM_ButtonShiftHorizontal, option, widget), proxy()->pixelMetric(PM_ButtonShiftVertical, option, widget)); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2632 | proxy()->pixelMetric(PM_ButtonShiftVertical, option, widget)); never executed: buttonShift = QPoint(pixelMetric(PM_ButtonShiftHorizontal, option, widget), proxy()->pixelMetric(PM_ButtonShiftVertical, option, widget)); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2633 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2634 | if (proxy()->styleHint(SH_UnderlineShortcut, button, widget)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2635 | tf |= Qt::TextShowMnemonic; never executed: tf |= Qt::TextShowMnemonic; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2636 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2637 | tf |= Qt::TextHideMnemonic; never executed: tf |= Qt::TextHideMnemonic; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2638 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2639 | if (!button->icon.isNull()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2640 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2641 | QPoint point; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2642 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2643 | QIcon::Mode mode = button->state & State_Enabled
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2644 | if (mode == QIcon::Normal
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2645 | mode = QIcon::Active; never executed: mode = QIcon::Active; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2646 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2647 | QIcon::State state = QIcon::Off; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2648 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2649 | if (button->state & State_On
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2650 | state = QIcon::On; never executed: state = QIcon::On; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2651 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2652 | QPixmap pixmap = button->icon.pixmap(button->iconSize, mode, state); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2653 | int w = pixmap.width(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2654 | int h = pixmap.height(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2655 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2656 | if (!button->text.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2657 | w += button->fontMetrics.boundingRect(option->rect, tf, button->text).width() + 4; never executed: w += button->fontMetrics.boundingRect(option->rect, tf, button->text).width() + 4; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2658 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2659 | point = QPoint(ir.x() + ir.width() / 2 - w / 2, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2660 | ir.y() + ir.height() / 2 - h / 2); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2661 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2662 | if (button->direction == Qt::RightToLeft
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2663 | point.rx() += pixmap.width(); never executed: point.rx() += pixmap.width(); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2664 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2665 | painter->drawPixmap(visualPos(button->direction, button->rect, point + buttonShift), pixmap); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2666 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2667 | if (button->direction == Qt::RightToLeft
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2668 | ir.translate(-point.x() - 2, 0); never executed: ir.translate(-point.x() - 2, 0); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2669 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2670 | ir.translate(point.x() + pixmap.width() + 2, 0); never executed: ir.translate(point.x() + pixmap.width() + 2, 0); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2671 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2672 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2673 | if (!button->text.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2674 | tf |= Qt::AlignLeft; never executed: tf |= Qt::AlignLeft; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2675 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2676 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2677 | tf |= Qt::AlignHCenter; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2678 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2679 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2680 | ir.translate(buttonShift); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2681 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2682 | if (button->features & QStyleOptionButton::HasMenu
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2683 | ir = ir.adjusted(0, 0, -pixelMetric(PM_MenuButtonIndicator, button, widget), 0); never executed: ir = ir.adjusted(0, 0, -pixelMetric(PM_MenuButtonIndicator, button, widget), 0); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2684 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2685 | GtkWidget *gtkButton = d->gtkWidget("GtkButton"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2686 | QPalette pal = button->palette; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2687 | int labelState = GTK_STATE_INSENSITIVE; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2688 | if (option->state & State_Enabled
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2689 | labelState = (option->state & State_MouseOver
never executed: labelState = (option->state & State_MouseOver && !(option->state & State_Sunken)) ? GTK_STATE_PRELIGHT : GTK_STATE_NORMAL; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2690 | GTK_STATE_PRELIGHT : GTK_STATE_NORMAL; never executed: labelState = (option->state & State_MouseOver && !(option->state & State_Sunken)) ? GTK_STATE_PRELIGHT : GTK_STATE_NORMAL; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2691 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2692 | GdkColor gdkText = d->gtk_widget_get_style(gtkButton)->fg[labelState]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2693 | QColor textColor = QColor(gdkText.red>>8, gdkText.green>>8, gdkText.blue>>8); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2694 | pal.setBrush(QPalette::ButtonText, textColor); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2695 | proxy()->drawItemText(painter, ir, tf, pal, (button->state & State_Enabled), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2696 | button->text, QPalette::ButtonText); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2697 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2698 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2699 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2700 | case never executed: CE_RadioButton:case CE_RadioButton: never executed: case CE_RadioButton: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2701 | case never executed: CE_CheckBox:case CE_CheckBox: never executed: case CE_CheckBox: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2702 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2703 | bool isRadio = (element == CE_RadioButton); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2704 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2705 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2706 | GtkWidget *gtkRadioButton = d->gtkWidget("GtkRadioButton"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2707 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2708 | if (option->state & State_MouseOver
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2709 | gtkPainter->paintFlatBox(gtkRadioButton, "checkbutton", option->rect, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2710 | GTK_STATE_PRELIGHT, GTK_SHADOW_ETCHED_OUT, d->gtk_widget_get_style(gtkRadioButton)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2711 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2712 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2713 | QStyleOptionButton subopt = *btn; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2714 | subopt.rect = subElementRect(isRadio ? SE_RadioButtonIndicator | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2715 | : SE_CheckBoxIndicator, btn, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2716 | proxy()->drawPrimitive(isRadio ? PE_IndicatorRadioButton : PE_IndicatorCheckBox, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2717 | &subopt, painter, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2718 | subopt.rect = subElementRect(isRadio ? SE_RadioButtonContents | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2719 | : SE_CheckBoxContents, btn, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2720 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2721 | QPalette pal = subopt.palette; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2722 | int labelState = GTK_STATE_INSENSITIVE; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2723 | if (option->state & State_Enabled
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2724 | labelState = (
never executed: labelState = (option->state & State_MouseOver) ? GTK_STATE_PRELIGHT : GTK_STATE_NORMAL; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2725 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2726 | GdkColor gdkText = d->gtk_widget_get_style(gtkRadioButton)->fg[labelState]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2727 | QColor textColor = QColor(gdkText.red>>8, gdkText.green>>8, gdkText.blue>>8); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2728 | pal.setBrush(QPalette::WindowText, textColor); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2729 | subopt.palette = pal; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2730 | proxy()->drawControl(isRadio ? CE_RadioButtonLabel : CE_CheckBoxLabel, &subopt, painter, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2731 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2732 | if (btn->state & State_HasFocus
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2733 | QStyleOptionFocusRect fropt; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2734 | fropt.QStyleOption::operator=(*btn); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2735 | fropt.rect = subElementRect(isRadio ? SE_RadioButtonFocusRect | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2736 | : SE_CheckBoxFocusRect, btn, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2737 | proxy()->drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2738 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2739 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2740 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2741 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2742 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2743 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2744 | case never executed: CE_ComboBoxLabel:case CE_ComboBoxLabel: never executed: case CE_ComboBoxLabel: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2745 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2746 | QRect editRect = proxy()->subControlRect(CC_ComboBox, cb, SC_ComboBoxEditField, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2747 | bool appearsAsList = !proxy()->styleHint(QStyle::SH_ComboBox_Popup, cb, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2748 | painter->save(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2749 | painter->setClipRect(editRect); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2750 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2751 | if (!cb->currentIcon.isNull()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2752 | QIcon::Mode mode = cb->state & State_Enabled
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2753 | : QIcon::Disabled; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2754 | QPixmap pixmap = cb->currentIcon.pixmap(cb->iconSize, mode); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2755 | QRect iconRect(editRect); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2756 | iconRect.setWidth(cb->iconSize.width() + 4); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2757 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2758 | iconRect = alignedRect(cb->direction, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2759 | Qt::AlignLeft | Qt::AlignVCenter, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2760 | iconRect.size(), editRect); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2761 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2762 | if (cb->editable
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2763 | painter->fillRect(iconRect, option->palette.brush(QPalette::Base)); never executed: painter->fillRect(iconRect, option->palette.brush(QPalette::Base)); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2764 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2765 | proxy()->drawItemPixmap(painter, iconRect, Qt::AlignCenter, pixmap); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2766 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2767 | if (cb->direction == Qt::RightToLeft
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2768 | editRect.translate(-4 - cb->iconSize.width(), 0); never executed: editRect.translate(-4 - cb->iconSize.width(), 0); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2769 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2770 | editRect.translate(cb->iconSize.width() + 4, 0); never executed: editRect.translate(cb->iconSize.width() + 4, 0); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2771 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2772 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2773 | if (!cb->currentText.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2774 | GtkWidget *gtkCombo = d->gtkWidget("GtkComboBox"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2775 | QPalette pal = cb->palette; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2776 | int labelState = GTK_STATE_INSENSITIVE; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2777 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2778 | if (option->state & State_Enabled
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2779 | labelState = (option->state & State_MouseOver
never executed: labelState = (option->state & State_MouseOver && !appearsAsList) ? GTK_STATE_PRELIGHT : GTK_STATE_NORMAL; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2780 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2781 | GdkColor gdkText = d->gtk_widget_get_style(gtkCombo)->fg[labelState]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2782 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2783 | QColor textColor = QColor(gdkText.red>>8, gdkText.green>>8, gdkText.blue>>8); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2784 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2785 | pal.setBrush(QPalette::ButtonText, textColor); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2786 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2787 | proxy()->drawItemText(painter, editRect.adjusted(1, 0, -1, 0), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2788 | visualAlignment(cb->direction, Qt::AlignLeft | Qt::AlignVCenter), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2789 | pal, cb->state & State_Enabled, cb->currentText, QPalette::ButtonText); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2790 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2791 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2792 | painter->restore(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2793 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2794 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2795 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2796 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2797 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2798 | case never executed: CE_DockWidgetTitle:case CE_DockWidgetTitle: never executed: case CE_DockWidgetTitle: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2799 | painter->save(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2800 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2801 | const QStyleOptionDockWidgetV2 *v2 | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2802 | = qstyleoption_cast<const QStyleOptionDockWidgetV2*>(dwOpt); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2803 | bool verticalTitleBar = v2 == 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2804 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2805 | QRect rect = dwOpt->rect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2806 | QRect titleRect = subElementRect(SE_DockWidgetTitleBarText, option, widget).adjusted(-2, 0, -2, 0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2807 | QRect r = rect.adjusted(0, 0, -1, -1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2808 | if (verticalTitleBar
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2809 | r.adjust(0, 0, 0, -1); never executed: r.adjust(0, 0, 0, -1); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2810 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2811 | if (verticalTitleBar
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2812 | QRect r = rect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2813 | r.setSize(r.size().transposed()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2814 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2815 | titleRect = QRect(r.left() + rect.bottom() | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2816 | - titleRect.bottom(), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2817 | r.top() + titleRect.left() - rect.left(), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2818 | titleRect.height(), titleRect.width()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2819 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2820 | painter->translate(r.left(), r.top() + r.width()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2821 | painter->rotate(-90); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2822 | painter->translate(-r.left(), -r.top()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2823 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2824 | rect = r; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2825 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2826 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2827 | if (!dwOpt->title.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2828 | QString titleText | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2829 | = painter->fontMetrics().elidedText(dwOpt->title, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2830 | Qt::ElideRight, titleRect.width()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2831 | proxy()->drawItemText(painter, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2832 | titleRect, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2833 | Qt::AlignLeft | Qt::AlignVCenter | Qt::TextShowMnemonic, dwOpt->palette, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2834 | dwOpt->state & State_Enabled, titleText, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2835 | QPalette::WindowText); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2836 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2837 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2838 | painter->restore(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2839 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2840 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2841 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2842 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2843 | case never executed: CE_HeaderSection:case CE_HeaderSection: never executed: case CE_HeaderSection: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2844 | painter->save(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2845 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2846 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2847 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2848 | (void)header;; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2849 | GtkWidget *gtkTreeView = d->gtkWidget("GtkTreeView"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2850 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2851 | GtkTreeViewColumn *column = d->gtk_tree_view_get_column((GtkTreeView*)gtkTreeView, 1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2852 | ((!(column)) ? qt_assert("column",__FILE__,2941) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2853 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2854 | GtkWidget *gtkTreeHeader = column->button; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2855 | GtkStateType state = qt_gtk_state(option); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2856 | GtkShadowType shadow = GTK_SHADOW_OUT; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2857 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2858 | if (option->state & State_Sunken
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2859 | shadow = GTK_SHADOW_IN; never executed: shadow = GTK_SHADOW_IN; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2860 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2861 | gtkPainter->paintBox(gtkTreeHeader, "button", option->rect.adjusted(-1, 0, 0, 0), state, shadow, d->gtk_widget_get_style(gtkTreeHeader)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2862 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2863 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2864 | painter->restore(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2865 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2866 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2867 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2868 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2869 | case never executed: CE_SizeGrip:case CE_SizeGrip: never executed: {case CE_SizeGrip: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2870 | GtkWidget *gtkStatusbar = d->gtkWidget("GtkStatusbar.GtkFrame"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2871 | GtkStyle *gtkStatusbarStyle = d->gtk_widget_get_style(gtkStatusbar); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2872 | QRect gripRect = option->rect.adjusted(0, 0, -gtkStatusbarStyle->xthickness, -gtkStatusbarStyle->ythickness); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2873 | gtkPainter->paintResizeGrip(gtkStatusbar, "statusbar", gripRect, GTK_STATE_NORMAL, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2874 | GTK_SHADOW_OUT, option->direction == Qt::RightToLeft ? | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2875 | GDK_WINDOW_EDGE_SOUTH_WEST : GDK_WINDOW_EDGE_SOUTH_EAST, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2876 | gtkStatusbarStyle); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2877 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2878 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2879 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2880 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2881 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2882 | case never executed: CE_MenuBarEmptyArea:case CE_MenuBarEmptyArea: never executed: {case CE_MenuBarEmptyArea: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2883 | GtkWidget *gtkMenubar = d->gtkWidget("GtkMenuBar"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2884 | GdkColor gdkBg = d->gtk_widget_get_style(gtkMenubar)->bg[GTK_STATE_NORMAL]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2885 | painter->fillRect(option->rect, QColor(gdkBg.red>>8, gdkBg.green>>8, gdkBg.blue>>8)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2886 | if (widget
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2887 | QRect menuBarRect = widget->rect(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2888 | QPixmap pixmap(menuBarRect.size()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2889 | pixmap.fill(Qt::transparent); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2890 | QPainter pmPainter(&pixmap); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2891 | gtkPainter->reset(&pmPainter); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2892 | GtkShadowType shadow_type; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2893 | d->gtk_widget_style_get(gtkMenubar, "shadow-type", &shadow_type, __null); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2894 | gtkPainter->paintBox(gtkMenubar, "menubar", menuBarRect, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2895 | GTK_STATE_NORMAL, shadow_type, d->gtk_widget_get_style(gtkMenubar)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2896 | pmPainter.end(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2897 | painter->drawPixmap(option->rect, pixmap, option->rect); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2898 | gtkPainter->reset(painter); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2899 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2900 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2901 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2902 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2903 | case never executed: CE_MenuBarItem:case CE_MenuBarItem: never executed: case CE_MenuBarItem: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2904 | painter->save(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2905 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2906 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2907 | GtkWidget *gtkMenubarItem = d->gtkWidget("GtkMenuBar.GtkMenuItem"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2908 | GtkWidget *gtkMenubar = d->gtkWidget("GtkMenuBar"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2909 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2910 | style = d->gtk_widget_get_style(gtkMenubarItem); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2911 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2912 | if (widget
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2913 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2914 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2915 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2916 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2917 | QRect menuBarRect = widget->rect(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2918 | QPixmap pixmap(menuBarRect.size()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2919 | pixmap.fill(Qt::transparent); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2920 | QPainter pmPainter(&pixmap); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2921 | gtkPainter->reset(&pmPainter); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2922 | GtkShadowType shadow_type; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2923 | d->gtk_widget_style_get(gtkMenubar, "shadow-type", &shadow_type, __null); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2924 | GdkColor gdkBg = d->gtk_widget_get_style(gtkMenubar)->bg[GTK_STATE_NORMAL]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2925 | painter->fillRect(option->rect, QColor(gdkBg.red>>8, gdkBg.green>>8, gdkBg.blue>>8)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2926 | gtkPainter->paintBox(gtkMenubar, "menubar", menuBarRect, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2927 | GTK_STATE_NORMAL, shadow_type, d->gtk_widget_get_style(gtkMenubar)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2928 | pmPainter.end(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2929 | painter->drawPixmap(option->rect, pixmap, option->rect); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2930 | gtkPainter->reset(painter); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2931 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2932 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2933 | QStyleOptionMenuItem item = *mbi; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2934 | bool act = mbi->state & State_Selected
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2935 | bool dis = !(mbi->state & State_Enabled); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2936 | item.rect = mbi->rect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2937 | GdkColor gdkText = style->fg[dis ? GTK_STATE_INSENSITIVE : GTK_STATE_NORMAL]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2938 | GdkColor gdkHText = style->fg[GTK_STATE_PRELIGHT]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2939 | QColor normalTextColor = QColor(gdkText.red>>8, gdkText.green>>8, gdkText.blue>>8); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2940 | QColor highlightedTextColor = QColor(gdkHText.red>>8, gdkHText.green>>8, gdkHText.blue>>8); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2941 | item.palette.setBrush(QPalette::HighlightedText, highlightedTextColor); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2942 | item.palette.setBrush(QPalette::Text, normalTextColor); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2943 | item.palette.setBrush(QPalette::ButtonText, normalTextColor); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2944 | QCommonStyle::drawControl(element, &item, painter, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2945 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2946 | if (act
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2947 | GtkShadowType shadowType = GTK_SHADOW_NONE; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2948 | d->gtk_widget_style_get (gtkMenubarItem, "selected-shadow-type", &shadowType, __null); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2949 | gtkPainter->paintBox(gtkMenubarItem, "menuitem", option->rect.adjusted(0, 0, 0, 3), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2950 | GTK_STATE_PRELIGHT, shadowType, style); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2951 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2952 | QPalette::ColorRole textRole = dis
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2953 | uint alignment = Qt::AlignCenter | Qt::TextShowMnemonic | Qt::TextDontClip | Qt::TextSingleLine; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2954 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2955 | if (!proxy()->styleHint(SH_UnderlineShortcut, mbi, widget)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2956 | alignment |= Qt::TextHideMnemonic; never executed: alignment |= Qt::TextHideMnemonic; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2957 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2958 | proxy()->drawItemText(painter, item.rect, alignment, item.palette, mbi->state & State_Enabled, mbi->text, textRole); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2959 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2960 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2961 | painter->restore(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2962 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2963 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2964 | case never executed: CE_Splitter:case CE_Splitter: never executed: {case CE_Splitter: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2965 | GtkWidget *gtkWindow = d->gtkWidget("GtkWindow"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2966 | gtkPainter->paintHandle(gtkWindow, "splitter", option->rect, qt_gtk_state(option), GTK_SHADOW_NONE, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2967 | !(option->state & State_Horizontal) ? GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2968 | style); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2969 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2970 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2971 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2972 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2973 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2974 | case never executed: CE_ToolBar:case CE_ToolBar: never executed: case CE_ToolBar: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2975 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2976 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2977 | if (!(widget
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2978 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2979 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2980 | QRect rect = option->rect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2981 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2982 | if (toolbar->positionWithinLine != QStyleOptionToolBar::End
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2983 | rect.adjust(0, 0, 1, 0); never executed: rect.adjust(0, 0, 1, 0); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2984 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2985 | GtkWidget *gtkToolbar = d->gtkWidget("GtkToolbar"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2986 | GtkShadowType shadow_type = GTK_SHADOW_NONE; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2987 | d->gtk_widget_style_get(gtkToolbar, "shadow-type", &shadow_type, __null); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2988 | gtkPainter->paintBox(gtkToolbar, "toolbar", rect, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2989 | GTK_STATE_NORMAL, shadow_type, d->gtk_widget_get_style(gtkToolbar)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2990 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2991 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2992 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2993 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2994 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2995 | case never executed: CE_MenuItem:case CE_MenuItem: never executed: case CE_MenuItem: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2996 | painter->save(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
2997 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2998 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
2999 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3000 | const int windowsItemHMargin = 3; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3001 | const int windowsItemVMargin = 26; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3002 | GtkWidget *gtkMenuItem = menuItem->checked
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3003 | d->gtkWidget("GtkMenu.GtkMenuItem"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3004 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3005 | style = d->gtk_widget_get_style(gtkMenuItem); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3006 | QColor shadow = option->palette.dark().color(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3007 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3008 | if (menuItem->menuItemType == QStyleOptionMenuItem::Separator
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3009 | GtkWidget *gtkMenuSeparator = d->gtkWidget("GtkMenu.GtkSeparatorMenuItem"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3010 | painter->setPen(shadow.lighter(106)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3011 | gboolean wide_separators = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3012 | gint separator_height = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3013 | guint horizontal_padding = 3; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3014 | QRect separatorRect = option->rect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3015 | if (!d->gtk_check_version(2, 10, 0)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3016 | d->gtk_widget_style_get(gtkMenuSeparator, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3017 | "wide-separators", &wide_separators, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3018 | "separator-height", &separator_height, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3019 | "horizontal-padding", &horizontal_padding, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3020 | __null); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3021 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3022 | GtkStyle *gtkMenuSeparatorStyle = d->gtk_widget_get_style(gtkMenuSeparator); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3023 | separatorRect.setHeight(option->rect.height() - 2 * gtkMenuSeparatorStyle->ythickness); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3024 | separatorRect.setWidth(option->rect.width() - 2 * (horizontal_padding + gtkMenuSeparatorStyle->xthickness)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3025 | separatorRect.moveCenter(option->rect.center()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3026 | if (wide_separators
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3027 | gtkPainter->paintBox(gtkMenuSeparator, "hseparator", never executed: gtkPainter->paintBox(gtkMenuSeparator, "hseparator", separatorRect, GTK_STATE_NORMAL, GTK_SHADOW_NONE, gtkMenuSeparatorStyle); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3028 | separatorRect, GTK_STATE_NORMAL, GTK_SHADOW_NONE, gtkMenuSeparatorStyle); never executed: gtkPainter->paintBox(gtkMenuSeparator, "hseparator", separatorRect, GTK_STATE_NORMAL, GTK_SHADOW_NONE, gtkMenuSeparatorStyle); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3029 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3030 | gtkPainter->paintHline(gtkMenuSeparator, "hseparator", never executed: gtkPainter->paintHline(gtkMenuSeparator, "hseparator", separatorRect, GTK_STATE_NORMAL, gtkMenuSeparatorStyle, 0, option->rect.right() - 1, 1); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3031 | separatorRect, GTK_STATE_NORMAL, gtkMenuSeparatorStyle, never executed: gtkPainter->paintHline(gtkMenuSeparator, "hseparator", separatorRect, GTK_STATE_NORMAL, gtkMenuSeparatorStyle, 0, option->rect.right() - 1, 1); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3032 | 0, option->rect.right() - 1, 1); never executed: gtkPainter->paintHline(gtkMenuSeparator, "hseparator", separatorRect, GTK_STATE_NORMAL, gtkMenuSeparatorStyle, 0, option->rect.right() - 1, 1); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3033 | painter->restore(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3034 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3035 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3036 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3037 | bool selected = menuItem->state & State_Selected
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3038 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3039 | if (selected
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3040 | QRect rect = option->rect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3041 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3042 | if (qobject_cast<const QComboBox*>(widget)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3043 | rect = option->rect; never executed: rect = option->rect; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3044 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3045 | gtkPainter->paintBox(gtkMenuItem, "menuitem", rect, GTK_STATE_PRELIGHT, GTK_SHADOW_OUT, style); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3046 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3047 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3048 | bool checkable = menuItem->checkType != QStyleOptionMenuItem::NotCheckable; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3049 | bool checked = menuItem->checked; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3050 | bool enabled = menuItem->state & State_Enabled; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3051 | bool ignoreCheckMark = false; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3052 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3053 | gint checkSize; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3054 | d->gtk_widget_style_get(d->gtkWidget("GtkMenu.GtkCheckMenuItem"), "indicator-size", &checkSize, __null); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3055 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3056 | int checkcol = qMax(menuItem->maxIconWidth, qMax(20, checkSize)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3057 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3058 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3059 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3060 | if (qobject_cast<const QComboBox*>(widget)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3061 | (option->styleObject
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3062 | ignoreCheckMark = true; never executed: ignoreCheckMark = true; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3063 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3064 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3065 | if (!ignoreCheckMark
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3066 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3067 | QRect checkRect(option->rect.left() + 7, option->rect.center().y() - checkSize/2 + 1, checkSize, checkSize); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3068 | checkRect = visualRect(menuItem->direction, menuItem->rect, checkRect); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3069 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3070 | if (checkable
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3071 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3072 | int spacing = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3073 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3074 | if (menuItem->checkType & QStyleOptionMenuItem::Exclusive
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3075 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3076 | GtkShadowType shadow = GTK_SHADOW_OUT; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3077 | GtkStateType state = qt_gtk_state(option); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3078 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3079 | if (selected
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3080 | state = GTK_STATE_PRELIGHT; never executed: state = GTK_STATE_PRELIGHT; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3081 | if (checked
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3082 | shadow = GTK_SHADOW_IN; never executed: shadow = GTK_SHADOW_IN; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3083 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3084 | gtkPainter->setClipRect(checkRect.adjusted(-spacing, -spacing, spacing, spacing)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3085 | gtkPainter->paintOption(gtkMenuItem, checkRect.translated(-spacing, -spacing), state, shadow, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3086 | style, QLatin1String("option")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3087 | gtkPainter->setClipRect(QRect()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3088 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3089 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3090 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3091 | if (menuItem->icon.isNull()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3092 | GtkShadowType shadow = GTK_SHADOW_OUT; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3093 | GtkStateType state = qt_gtk_state(option); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3094 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3095 | if (selected
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3096 | state = GTK_STATE_PRELIGHT; never executed: state = GTK_STATE_PRELIGHT; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3097 | if (checked
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3098 | shadow = GTK_SHADOW_IN; never executed: shadow = GTK_SHADOW_IN; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3099 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3100 | gtkPainter->setClipRect(checkRect.adjusted(-spacing, -spacing, -spacing, -spacing)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3101 | gtkPainter->paintCheckbox(gtkMenuItem, checkRect.translated(-spacing, -spacing), state, shadow, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3102 | style, QLatin1String("check")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3103 | gtkPainter->setClipRect(QRect()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3104 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3105 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3106 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3107 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3108 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3109 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3110 | if (menuItem->icon.isNull()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3111 | checkcol = 0; never executed: checkcol = 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3112 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3113 | checkcol = menuItem->maxIconWidth; never executed: checkcol = menuItem->maxIconWidth; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3114 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3115 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3116 | bool dis = !(menuItem->state & State_Enabled); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3117 | bool act = menuItem->state & State_Selected; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3118 | const QStyleOption *opt = option; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3119 | const QStyleOptionMenuItem *menuitem = menuItem; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3120 | QPainter *p = painter; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3121 | QRect vCheckRect = visualRect(opt->direction, menuitem->rect, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3122 | QRect(menuitem->rect.x() + 3, menuitem->rect.y(), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3123 | checkcol, menuitem->rect.height())); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3124 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3125 | if (!menuItem->icon.isNull()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3126 | QIcon::Mode mode = dis
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3127 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3128 | if (act
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3129 | mode = QIcon::Active; never executed: mode = QIcon::Active; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3130 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3131 | QPixmap pixmap; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3132 | int smallIconSize = proxy()->pixelMetric(PM_SmallIconSize, option, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3133 | QSize iconSize(smallIconSize, smallIconSize); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3134 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3135 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3136 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3137 | iconSize = combo->iconSize(); never executed: iconSize = combo->iconSize(); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3138 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3139 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3140 | if (checked
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3141 | pixmap = menuItem->icon.pixmap(iconSize, mode, QIcon::On); never executed: pixmap = menuItem->icon.pixmap(iconSize, mode, QIcon::On); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3142 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3143 | pixmap = menuItem->icon.pixmap(iconSize, mode); never executed: pixmap = menuItem->icon.pixmap(iconSize, mode); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3144 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3145 | const int pixw = pixmap.width() / pixmap.devicePixelRatio(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3146 | const int pixh = pixmap.height() / pixmap.devicePixelRatio(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3147 | QRect pmr(0, 0, pixw, pixh); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3148 | pmr.moveCenter(vCheckRect.center() - QPoint(0, 1)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3149 | painter->setPen(menuItem->palette.text().color()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3150 | if (!ignoreCheckMark
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3151 | QStyleOption opt = *option; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3152 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3153 | if (act
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3154 | QColor activeColor = mergedColors(option->palette.background().color(), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3155 | option->palette.highlight().color()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3156 | opt.palette.setBrush(QPalette::Button, activeColor); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3157 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3158 | opt.state |= State_Sunken; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3159 | opt.rect = vCheckRect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3160 | proxy()->drawPrimitive(PE_PanelButtonCommand, &opt, painter, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3161 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3162 | painter->drawPixmap(pmr.topLeft(), pixmap); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3163 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3164 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3165 | GdkColor gdkText = style->fg[GTK_STATE_NORMAL]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3166 | GdkColor gdkDText = style->fg[GTK_STATE_INSENSITIVE]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3167 | GdkColor gdkHText = style->fg[GTK_STATE_PRELIGHT]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3168 | uint resolve_mask = option->palette.resolve(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3169 | QColor textColor = QColor(gdkText.red>>8, gdkText.green>>8, gdkText.blue>>8); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3170 | QColor disabledTextColor = QColor(gdkDText.red>>8, gdkDText.green>>8, gdkDText.blue>>8); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3171 | if (resolve_mask & (1 << QPalette::ButtonText)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3172 | textColor = option->palette.buttonText().color(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3173 | disabledTextColor = option->palette.brush(QPalette::Disabled, QPalette::ButtonText).color(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3174 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3175 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3176 | QColor highlightedTextColor = QColor(gdkHText.red>>8, gdkHText.green>>8, gdkHText.blue>>8); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3177 | if (resolve_mask & (1 << QPalette::HighlightedText)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3178 | highlightedTextColor = option->palette.highlightedText().color(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3179 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3180 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3181 | if (selected
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3182 | painter->setPen(highlightedTextColor); never executed: painter->setPen(highlightedTextColor); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3183 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3184 | painter->setPen(textColor); never executed: painter->setPen(textColor); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3185 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3186 | int x, y, w, h; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3187 | menuitem->rect.getRect(&x, &y, &w, &h); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3188 | int tab = menuitem->tabWidth; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3189 | int xm = QGtkStylePrivate::menuItemFrame + checkcol + windowsItemHMargin; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3190 | int xpos = menuitem->rect.x() + xm + 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3191 | QRect textRect(xpos, y + windowsItemVMargin, w - xm - QGtkStylePrivate::menuRightBorder - tab + 1, h - 2 * windowsItemVMargin); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3192 | QRect vTextRect = visualRect(opt->direction, menuitem->rect, textRect); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3193 | QString s = menuitem->text; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3194 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3195 | if (!s.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3196 | p->save(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3197 | int t = s.indexOf(QLatin1Char('\t')); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3198 | int text_flags = Qt::AlignVCenter | Qt::TextShowMnemonic | Qt::TextDontClip | Qt::TextSingleLine; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3199 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3200 | if (!proxy()->styleHint(SH_UnderlineShortcut, menuitem, widget)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3201 | text_flags |= Qt::TextHideMnemonic; never executed: text_flags |= Qt::TextHideMnemonic; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3202 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3203 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3204 | text_flags |= Qt::AlignRight; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3205 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3206 | if (t >= 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3207 | int rightMargin = 12; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3208 | QRect vShortcutRect = visualRect(opt->direction, menuitem->rect, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3209 | QRect(textRect.topRight(), QPoint(menuitem->rect.right() - rightMargin, textRect.bottom()))); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3210 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3211 | if (dis
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3212 | p->setPen(disabledTextColor); never executed: p->setPen(disabledTextColor); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3213 | p->drawText(vShortcutRect, text_flags , s.mid(t + 1)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3214 | s = s.left(t); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3215 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3216 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3217 | text_flags &= ~Qt::AlignRight; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3218 | text_flags |= Qt::AlignLeft; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3219 | QFont font = menuitem->font; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3220 | if (menuitem->menuItemType == QStyleOptionMenuItem::DefaultItem
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3221 | font.setBold(true); never executed: font.setBold(true); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3222 | p->setFont(font); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3223 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3224 | if (dis
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3225 | p->setPen(disabledTextColor); never executed: p->setPen(disabledTextColor); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3226 | p->drawText(vTextRect, text_flags, s.left(t)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3227 | p->restore(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3228 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3229 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3230 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3231 | if (menuItem->menuItemType == QStyleOptionMenuItem::SubMenu
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3232 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3233 | QFontMetrics fm(menuitem->font); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3234 | int arrow_size = fm.ascent() + fm.descent() - 2 * style->ythickness; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3235 | gfloat arrow_scaling = 0.8; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3236 | int extra = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3237 | if (!d->gtk_check_version(2, 16, 0)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3238 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3239 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3240 | d->gtk_widget_style_get(gtkMenuItem, "arrow-scaling", &arrow_scaling, __null); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3241 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3242 | extra = 2 * style->ythickness; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3243 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3244 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3245 | int horizontal_padding; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3246 | d->gtk_widget_style_get(gtkMenuItem, "horizontal-padding", &horizontal_padding, __null); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3247 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3248 | const int dim = static_cast<int>(arrow_size * arrow_scaling) + extra; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3249 | int xpos = menuItem->rect.left() + menuItem->rect.width() - horizontal_padding - dim; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3250 | QRect vSubMenuRect = visualRect(option->direction, menuItem->rect, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3251 | QRect(xpos, menuItem->rect.top() + | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3252 | menuItem->rect.height() / 2 - dim / 2, dim, dim)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3253 | GtkStateType state = enabled
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3254 | GtkShadowType shadowType = (
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3255 | gtkPainter->paintArrow(gtkMenuItem, "menuitem", vSubMenuRect, option->direction == Qt::RightToLeft ? GTK_ARROW_LEFT : GTK_ARROW_RIGHT, state, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3256 | shadowType, false, style); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3257 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3258 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3259 | painter->restore(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3260 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3261 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3262 | case never executed: CE_PushButton:case CE_PushButton: never executed: case CE_PushButton: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3263 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3264 | GtkWidget *gtkButton = d->gtkWidget("GtkButton"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3265 | proxy()->drawControl(CE_PushButtonBevel, btn, painter, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3266 | QStyleOptionButton subopt = *btn; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3267 | subopt.rect = subElementRect(SE_PushButtonContents, btn, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3268 | gint interiorFocus = true; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3269 | d->gtk_widget_style_get(gtkButton, "interior-focus", &interiorFocus, __null); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3270 | GtkStyle *gtkButtonStyle = d->gtk_widget_get_style(gtkButton); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3271 | int xt = interiorFocus
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3272 | int yt = interiorFocus
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3273 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3274 | if (btn->features & QStyleOptionButton::Flat
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3275 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3276 | proxy()->drawPrimitive(PE_FrameFocusRect, option, painter, widget); never executed: proxy()->drawPrimitive(PE_FrameFocusRect, option, painter, widget); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3277 | else if (btn->state & State_HasFocus
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3278 | gtkPainter->paintFocus(gtkButton, "button", never executed: gtkPainter->paintFocus(gtkButton, "button", option->rect.adjusted(xt, yt, -xt, -yt), btn->state & State_Sunken ? GTK_STATE_ACTIVE : GTK_STATE_NORMAL, gtkButtonStyle); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3279 | option->rect.adjusted(xt, yt, -xt, -yt), never executed: gtkPainter->paintFocus(gtkButton, "button", option->rect.adjusted(xt, yt, -xt, -yt), btn->state & State_Sunken ? GTK_STATE_ACTIVE : GTK_STATE_NORMAL, gtkButtonStyle); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3280 | btn->state & State_Sunken ? GTK_STATE_ACTIVE : GTK_STATE_NORMAL, never executed: gtkPainter->paintFocus(gtkButton, "button", option->rect.adjusted(xt, yt, -xt, -yt), btn->state & State_Sunken ? GTK_STATE_ACTIVE : GTK_STATE_NORMAL, gtkButtonStyle); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3281 | gtkButtonStyle); never executed: gtkPainter->paintFocus(gtkButton, "button", option->rect.adjusted(xt, yt, -xt, -yt), btn->state & State_Sunken ? GTK_STATE_ACTIVE : GTK_STATE_NORMAL, gtkButtonStyle); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3282 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3283 | proxy()->drawControl(CE_PushButtonLabel, &subopt, painter, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3284 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3285 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3286 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3287 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3288 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3289 | case never executed: CE_TabBarTabShape:case CE_TabBarTabShape: never executed: case CE_TabBarTabShape: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3290 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3291 | GtkWidget *gtkNotebook = d->gtkWidget("GtkNotebook"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3292 | style = d->gtk_widget_get_style(gtkNotebook); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3293 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3294 | QRect rect = option->rect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3295 | GtkShadowType shadow = GTK_SHADOW_OUT; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3296 | GtkStateType state = GTK_STATE_ACTIVE; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3297 | if (tab->state & State_Selected
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3298 | state = GTK_STATE_NORMAL; never executed: state = GTK_STATE_NORMAL; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3299 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3300 | bool selected = (tab->state & State_Selected); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3301 | bool first = false, last = false; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3302 | if (widget
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3303 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3304 | first = tab->rect.left() == widget->rect().left(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3305 | last = tab->rect.right() == widget->rect().right(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3306 | } never executed: else if (option->direction == Qt::RightToLeftend of block
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3307 | bool tmp = first; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3308 | first = last; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3309 | last = tmp; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3310 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3311 | int topIndent = 3; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3312 | int bottomIndent = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3313 | int tabOverlap = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3314 | painter->save(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3315 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3316 | switch (tab->shape) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3317 | case never executed: QTabBar::RoundedNorth:case QTabBar::RoundedNorth: never executed: case QTabBar::RoundedNorth: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3318 | if (!selected
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3319 | rect.adjust(first ? 0 : -tabOverlap, topIndent, last ? 0 : tabOverlap, -bottomIndent); never executed: rect.adjust(first ? 0 : -tabOverlap, topIndent, last ? 0 : tabOverlap, -bottomIndent); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3320 | gtkPainter->paintExtention(gtkNotebook, "tab", rect, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3321 | state, shadow, GTK_POS_BOTTOM, style); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3322 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3323 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3324 | case never executed: QTabBar::RoundedSouth:case QTabBar::RoundedSouth: never executed: case QTabBar::RoundedSouth: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3325 | if (!selected
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3326 | rect.adjust(first ? 0 : -tabOverlap, 0, last ? 0 : tabOverlap, -topIndent); never executed: rect.adjust(first ? 0 : -tabOverlap, 0, last ? 0 : tabOverlap, -topIndent); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3327 | gtkPainter->paintExtention(gtkNotebook, "tab", rect.adjusted(0, 1, 0, 0), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3328 | state, shadow, GTK_POS_TOP, style); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3329 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3330 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3331 | case never executed: QTabBar::RoundedWest:case QTabBar::RoundedWest: never executed: case QTabBar::RoundedWest: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3332 | if (!selected
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3333 | rect.adjust(topIndent, 0, -bottomIndent, 0); never executed: rect.adjust(topIndent, 0, -bottomIndent, 0); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3334 | gtkPainter->paintExtention(gtkNotebook, "tab", rect, state, shadow, GTK_POS_RIGHT, style); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3335 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3336 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3337 | case never executed: QTabBar::RoundedEast:case QTabBar::RoundedEast: never executed: case QTabBar::RoundedEast: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3338 | if (!selected
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3339 | rect.adjust(bottomIndent, 0, -topIndent, 0); never executed: rect.adjust(bottomIndent, 0, -topIndent, 0); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3340 | gtkPainter->paintExtention(gtkNotebook, "tab", rect, state, shadow, GTK_POS_LEFT, style); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3341 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3342 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3343 | default never executed: :default: never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3344 | QCommonStyle::drawControl(element, option, painter, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3345 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3346 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3347 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3348 | painter->restore(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3349 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3350 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3351 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3352 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3353 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3354 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3355 | case never executed: CE_ProgressBarGroove:case CE_ProgressBarGroove: never executed: case CE_ProgressBarGroove: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3356 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3357 | (void)bar;; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3358 | GtkWidget *gtkProgressBar = d->gtkWidget("GtkProgressBar"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3359 | GtkStateType state = qt_gtk_state(option); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3360 | gtkPainter->paintBox(gtkProgressBar, "trough", option->rect, state, GTK_SHADOW_IN, d->gtk_widget_get_style(gtkProgressBar)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3361 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3362 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3363 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3364 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3365 | case never executed: CE_ProgressBarContents:case CE_ProgressBarContents: never executed: case CE_ProgressBarContents: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3366 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3367 | GtkStateType state = option->state & State_Enabled
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3368 | GtkWidget *gtkProgressBar = d->gtkWidget("GtkProgressBar"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3369 | style = d->gtk_widget_get_style(gtkProgressBar); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3370 | gtkPainter->paintBox(gtkProgressBar, "trough", option->rect, state, GTK_SHADOW_IN, style); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3371 | int xt = style->xthickness; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3372 | int yt = style->ythickness; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3373 | QRect rect = bar->rect.adjusted(xt, yt, -xt, -yt); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3374 | bool vertical = false; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3375 | bool inverted = false; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3376 | bool indeterminate = (bar->minimum == 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3377 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3378 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3379 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3380 | vertical = (bar2->orientation == Qt::Vertical); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3381 | inverted = bar2->invertedAppearance; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3382 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3383 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3384 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3385 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3386 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3387 | if (vertical
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3388 | rect.translate(xt, -yt * 2); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3389 | rect = QRect(rect.left(), rect.top(), rect.height(), rect.width()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3390 | QTransform m = QTransform::fromTranslate(rect.height(), 0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3391 | m.rotate(90.0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3392 | painter->setTransform(m); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3393 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3394 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3395 | int maxWidth = rect.width(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3396 | int minWidth = 4; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3397 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3398 | qint64 progress = (qint64)qMax(bar->progress, bar->minimum); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3399 | double vc6_workaround = ((progress - qint64(bar->minimum)) / double(qint64(bar->maximum) - qint64(bar->minimum))) * maxWidth; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3400 | int progressBarWidth = (
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3401 | int width = indeterminate
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3402 | bool reverse = (!vertical
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3403 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3404 | if (inverted
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3405 | reverse = !reverse; never executed: reverse = !reverse; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3406 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3407 | int maximum = 2; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3408 | int fakePos = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3409 | if (bar->minimum == bar->maximum
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3410 | maximum = 0; never executed: maximum = 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3411 | if (bar->progress == bar->maximum
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3412 | fakePos = maximum; never executed: fakePos = maximum; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3413 | else if (bar->progress > bar->minimum
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3414 | fakePos = maximum - 1; never executed: fakePos = maximum - 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3415 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3416 | QRect progressBar; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3417 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3418 | if (!indeterminate
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3419 | if (!reverse
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3420 | progressBar.setRect(rect.left(), rect.top(), width, rect.height()); never executed: progressBar.setRect(rect.left(), rect.top(), width, rect.height()); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3421 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3422 | progressBar.setRect(rect.right() - width, rect.top(), width, rect.height()); never executed: progressBar.setRect(rect.right() - width, rect.top(), width, rect.height()); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3423 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3424 | d->stopAnimation(option->styleObject); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3425 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3426 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3427 | const QGtkStylePrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3428 | int slideWidth = ((rect.width() - 4) * 2) / 3; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3429 | int step = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3430 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3431 | if (QProgressStyleAnimation *animation = qobject_cast<QProgressStyleAnimation*>(d->animation(option->styleObject))
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3432 | step = animation->progressStep(slideWidth); never executed: step = animation->progressStep(slideWidth); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3433 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3434 | d->startAnimation(new QProgressStyleAnimation(d->animationFps, option->styleObject)); never executed: d->startAnimation(new QProgressStyleAnimation(d->animationFps, option->styleObject)); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3435 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3436 | progressBar.setRect(rect.left() + step, rect.top(), slideWidth / 2, rect.height()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3437 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3438 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3439 | QString key = QString(QLatin1String("%0")).arg(fakePos); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3440 | if (inverted
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3441 | key += QLatin1String("inv"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3442 | gtkPainter->setFlipHorizontal(true); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3443 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3444 | gtkPainter->paintBox(gtkProgressBar, "bar", progressBar, GTK_STATE_SELECTED, GTK_SHADOW_OUT, style, key); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3445 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3446 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3447 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3448 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3449 | default never executed: :default: never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3450 | QCommonStyle::drawControl(element, option, painter, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3451 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3452 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3453 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3454 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3455 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3456 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3457 | QRect QGtkStyle::subControlRect(ComplexControl control, const QStyleOptionComplex *option, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3458 | SubControl subControl, const QWidget *widget) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3459 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3460 | const QGtkStylePrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3461 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3462 | QRect rect = QCommonStyle::subControlRect(control, option, subControl, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3463 | if (!d->isThemeAvailable()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3464 | return never executed: QCommonStyle::subControlRect(control, option, subControl, widget);return QCommonStyle::subControlRect(control, option, subControl, widget); never executed: return QCommonStyle::subControlRect(control, option, subControl, widget); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3465 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3466 | switch (control) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3467 | case never executed: CC_ScrollBar:case CC_ScrollBar: never executed: case CC_ScrollBar: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3468 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3469 | case never executed: CC_Slider:case CC_Slider: never executed: case CC_Slider: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3470 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3471 | int tickSize = proxy()->pixelMetric(PM_SliderTickmarkOffset, option, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3472 | switch (subControl) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3473 | case never executed: SC_SliderHandle:case SC_SliderHandle: never executed: {case SC_SliderHandle: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3474 | if (slider->orientation == Qt::Horizontal
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3475 | rect.setHeight(proxy()->pixelMetric(PM_SliderThickness)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3476 | rect.setWidth(proxy()->pixelMetric(PM_SliderLength)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3477 | int centerY = slider->rect.center().y() - rect.height() / 2; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3478 | if (slider->tickPosition & QSlider::TicksAbove
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3479 | centerY += tickSize; never executed: centerY += tickSize; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3480 | if (slider->tickPosition & QSlider::TicksBelow
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3481 | centerY -= tickSize; never executed: centerY -= tickSize; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3482 | rect.moveTop(centerY); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3483 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3484 | rect.setWidth(proxy()->pixelMetric(PM_SliderThickness)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3485 | rect.setHeight(proxy()->pixelMetric(PM_SliderLength)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3486 | int centerX = slider->rect.center().x() - rect.width() / 2; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3487 | if (slider->tickPosition & QSlider::TicksAbove
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3488 | centerX += tickSize; never executed: centerX += tickSize; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3489 | if (slider->tickPosition & QSlider::TicksBelow
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3490 | centerX -= tickSize; never executed: centerX -= tickSize; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3491 | rect.moveLeft(centerX); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3492 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3493 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3494 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3495 | case never executed: SC_SliderGroove:case SC_SliderGroove: never executed: {case SC_SliderGroove: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3496 | QPoint grooveCenter = slider->rect.center(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3497 | if (slider->orientation == Qt::Horizontal
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3498 | rect.setHeight(7); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3499 | if (slider->tickPosition & QSlider::TicksAbove
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3500 | grooveCenter.ry() += tickSize; never executed: grooveCenter.ry() += tickSize; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3501 | if (slider->tickPosition & QSlider::TicksBelow
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3502 | grooveCenter.ry() -= tickSize; never executed: grooveCenter.ry() -= tickSize; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3503 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3504 | rect.setWidth(7); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3505 | if (slider->tickPosition & QSlider::TicksAbove
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3506 | grooveCenter.rx() += tickSize; never executed: grooveCenter.rx() += tickSize; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3507 | if (slider->tickPosition & QSlider::TicksBelow
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3508 | grooveCenter.rx() -= tickSize; never executed: grooveCenter.rx() -= tickSize; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3509 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3510 | rect.moveCenter(grooveCenter); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3511 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3512 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3513 | default never executed: :default: never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3514 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3515 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3516 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3517 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3518 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3519 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3520 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3521 | case never executed: CC_GroupBox:case CC_GroupBox: never executed: case CC_GroupBox: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3522 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3523 | rect = option->rect.adjusted(0, groupBoxTopMargin, 0, -groupBoxBottomMargin); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3524 | int topMargin = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3525 | int topHeight = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3526 | topHeight = 10; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3527 | QRect frameRect = rect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3528 | frameRect.setTop(topMargin); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3529 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3530 | if (subControl == SC_GroupBoxFrame
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3531 | return never executed: rect;return rect; never executed: return rect; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3532 | else if (subControl == SC_GroupBoxContents
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3533 | int margin = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3534 | int leftMarginExtension = 8; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3535 | return never executed: frameRect.adjusted(leftMarginExtension + margin, margin + topHeight + groupBoxTitleMargin, -margin, -margin);return frameRect.adjusted(leftMarginExtension + margin, margin + topHeight + groupBoxTitleMargin, -margin, -margin); never executed: return frameRect.adjusted(leftMarginExtension + margin, margin + topHeight + groupBoxTitleMargin, -margin, -margin); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3536 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3537 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3538 | QFontMetrics fontMetrics = option->fontMetrics; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3539 | if (qobject_cast<const QGroupBox *>(widget)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3540 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3541 | QFont font = widget->font(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3542 | font.setBold(true); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3543 | fontMetrics = QFontMetrics(font); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3544 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3545 | } never executed: else if (QStyleHelper::isInstanceOf(groupBox->styleObject, QAccessible::Grouping)end of block
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3546 | QVariant var = groupBox->styleObject->property("font"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3547 | if (var.isValid()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3548 | QFont font = var.value<QFont>(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3549 | font.setBold(true); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3550 | fontMetrics = QFontMetrics(font); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3551 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3552 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3553 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3554 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3555 | QSize textRect = fontMetrics.boundingRect(groupBox->text).size() + QSize(4, 4); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3556 | int indicatorWidth = proxy()->pixelMetric(PM_IndicatorWidth, option, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3557 | int indicatorHeight = proxy()->pixelMetric(PM_IndicatorHeight, option, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3558 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3559 | if (subControl == SC_GroupBoxCheckBox
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3560 | rect.setWidth(indicatorWidth); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3561 | rect.setHeight(indicatorHeight); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3562 | rect.moveTop((textRect.height() - indicatorHeight) / 2); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3563 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3564 | } never executed: else if (subControl == SC_GroupBoxLabelend of block
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3565 | if (groupBox->subControls & SC_GroupBoxCheckBox
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3566 | rect.adjust(indicatorWidth + 4, 0, 0, 0); never executed: rect.adjust(indicatorWidth + 4, 0, 0, 0); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3567 | rect.setSize(textRect); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3568 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3569 | rect = visualRect(option->direction, option->rect, rect); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3570 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3571 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3572 | return never executed: rect;return rect; never executed: return rect; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3573 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3574 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3575 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3576 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3577 | case never executed: CC_SpinBox:case CC_SpinBox: never executed: case CC_SpinBox: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3578 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3579 | GtkWidget *gtkSpinButton = d->gtkWidget("GtkSpinButton"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3580 | int center = spinbox->rect.height() / 2; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3581 | GtkStyle *gtkSpinButtonStyle = d->gtk_widget_get_style(gtkSpinButton); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3582 | int xt = spinbox->frame
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3583 | int yt = spinbox->frame
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3584 | int y = yt; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3585 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3586 | QSize bs; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3587 | bs.setHeight(qMax(8, spinbox->rect.height()/2 - y)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3588 | bs.setWidth(d->getSpinboxArrowSize()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3589 | int x, lx, rx; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3590 | x = spinbox->rect.width() - y - bs.width() + 2; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3591 | lx = xt; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3592 | rx = x - xt; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3593 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3594 | switch (subControl) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3595 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3596 | case never executed: SC_SpinBoxUp:case SC_SpinBoxUp: never executed: case SC_SpinBoxUp: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3597 | if (spinbox->buttonSymbols == QAbstractSpinBox::NoButtons
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3598 | return never executed: QRect();return QRect(); never executed: return QRect(); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3599 | rect = QRect(x, xt, bs.width(), center - yt); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3600 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3601 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3602 | case never executed: SC_SpinBoxDown:case SC_SpinBoxDown: never executed: case SC_SpinBoxDown: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3603 | if (spinbox->buttonSymbols == QAbstractSpinBox::NoButtons
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3604 | return never executed: QRect();return QRect(); never executed: return QRect(); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3605 | rect = QRect(x, center, bs.width(), spinbox->rect.bottom() - center - yt + 1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3606 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3607 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3608 | case never executed: SC_SpinBoxEditField:case SC_SpinBoxEditField: never executed: case SC_SpinBoxEditField: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3609 | if (spinbox->buttonSymbols == QAbstractSpinBox::NoButtons
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3610 | rect = QRect(lx, yt, spinbox->rect.width() - 2*xt, spinbox->rect.height() - 2*yt); never executed: rect = QRect(lx, yt, spinbox->rect.width() - 2*xt, spinbox->rect.height() - 2*yt); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3611 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3612 | rect = QRect(lx, yt, rx - qMax(xt - 1, 0), spinbox->rect.height() - 2*yt); never executed: rect = QRect(lx, yt, rx - qMax(xt - 1, 0), spinbox->rect.height() - 2*yt); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3613 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3614 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3615 | case never executed: SC_SpinBoxFrame:case SC_SpinBoxFrame: never executed: case SC_SpinBoxFrame: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3616 | rect = spinbox->rect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3617 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3618 | default never executed: :default: never executed: default: code before this statement never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3619 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3620 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3621 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3622 | rect = visualRect(spinbox->direction, spinbox->rect, rect); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3623 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3624 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3625 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3626 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3627 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3628 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3629 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3630 | case never executed: CC_TitleBar:case CC_TitleBar: never executed: case CC_TitleBar: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3631 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3632 | SubControl sc = subControl; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3633 | QRect &ret = rect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3634 | const int indent = 3; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3635 | const int controlTopMargin = 3; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3636 | const int controlBottomMargin = 3; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3637 | const int controlWidthMargin = 2; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3638 | const int controlHeight = tb->rect.height() - controlTopMargin - controlBottomMargin ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3639 | const int delta = controlHeight + controlWidthMargin; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3640 | int offset = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3641 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3642 | bool isMinimized = tb->titleBarState & Qt::WindowMinimized; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3643 | bool isMaximized = tb->titleBarState & Qt::WindowMaximized; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3644 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3645 | switch (sc) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3646 | case never executed: SC_TitleBarLabel:case SC_TitleBarLabel: never executed: case SC_TitleBarLabel: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3647 | if (tb->titleBarFlags & (Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3648 | ret = tb->rect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3649 | if (tb->titleBarFlags & Qt::WindowSystemMenuHint
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3650 | ret.adjust(delta, 0, -delta, 0); never executed: ret.adjust(delta, 0, -delta, 0); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3651 | if (tb->titleBarFlags & Qt::WindowMinimizeButtonHint
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3652 | ret.adjust(0, 0, -delta, 0); never executed: ret.adjust(0, 0, -delta, 0); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3653 | if (tb->titleBarFlags & Qt::WindowMaximizeButtonHint
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3654 | ret.adjust(0, 0, -delta, 0); never executed: ret.adjust(0, 0, -delta, 0); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3655 | if (tb->titleBarFlags & Qt::WindowShadeButtonHint
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3656 | ret.adjust(0, 0, -delta, 0); never executed: ret.adjust(0, 0, -delta, 0); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3657 | if (tb->titleBarFlags & Qt::WindowContextHelpButtonHint
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3658 | ret.adjust(0, 0, -delta, 0); never executed: ret.adjust(0, 0, -delta, 0); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3659 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3660 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3661 | case never executed: SC_TitleBarContextHelpButton:case SC_TitleBarContextHelpButton: never executed: case SC_TitleBarContextHelpButton: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3662 | if (tb->titleBarFlags & Qt::WindowContextHelpButtonHint
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3663 | offset += delta; never executed: offset += delta; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3664 | case never executed: SC_TitleBarMinButton:case SC_TitleBarMinButton: never executed: case SC_TitleBarMinButton: code before this statement never executed: case SC_TitleBarMinButton: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3665 | if (!isMinimized
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3666 | offset += delta; never executed: offset += delta; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3667 | else if (sc == SC_TitleBarMinButton
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3668 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3669 | case never executed: SC_TitleBarNormalButton:case SC_TitleBarNormalButton: never executed: case SC_TitleBarNormalButton: code before this statement never executed: case SC_TitleBarNormalButton: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3670 | if (isMinimized
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3671 | offset += delta; never executed: offset += delta; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3672 | else if (isMaximized
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3673 | offset += delta; never executed: offset += delta; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3674 | else if (sc == SC_TitleBarNormalButton
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3675 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3676 | case never executed: SC_TitleBarMaxButton:case SC_TitleBarMaxButton: never executed: case SC_TitleBarMaxButton: code before this statement never executed: case SC_TitleBarMaxButton: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3677 | if (!isMaximized
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3678 | offset += delta; never executed: offset += delta; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3679 | else if (sc == SC_TitleBarMaxButton
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3680 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3681 | case never executed: SC_TitleBarShadeButton:case SC_TitleBarShadeButton: never executed: case SC_TitleBarShadeButton: code before this statement never executed: case SC_TitleBarShadeButton: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3682 | if (!isMinimized
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3683 | offset += delta; never executed: offset += delta; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3684 | else if (sc == SC_TitleBarShadeButton
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3685 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3686 | case never executed: SC_TitleBarUnshadeButton:case SC_TitleBarUnshadeButton: never executed: case SC_TitleBarUnshadeButton: code before this statement never executed: case SC_TitleBarUnshadeButton: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3687 | if (isMinimized
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3688 | offset += delta; never executed: offset += delta; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3689 | else if (sc == SC_TitleBarUnshadeButton
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3690 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3691 | case never executed: SC_TitleBarCloseButton:case SC_TitleBarCloseButton: never executed: case SC_TitleBarCloseButton: code before this statement never executed: case SC_TitleBarCloseButton: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3692 | if (tb->titleBarFlags & Qt::WindowSystemMenuHint
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3693 | offset += delta; never executed: offset += delta; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3694 | else if (sc == SC_TitleBarCloseButton
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3695 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3696 | ret.setRect(tb->rect.right() - indent - offset, tb->rect.top() + controlTopMargin, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3697 | controlHeight, controlHeight); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3698 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3699 | case never executed: SC_TitleBarSysMenu:case SC_TitleBarSysMenu: never executed: case SC_TitleBarSysMenu: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3700 | if (tb->titleBarFlags & Qt::WindowSystemMenuHint
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3701 | ret.setRect(tb->rect.left() + controlWidthMargin + indent, tb->rect.top() + controlTopMargin, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3702 | controlHeight, controlHeight); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3703 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3704 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3705 | default never executed: :default: never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3706 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3707 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3708 | ret = visualRect(tb->direction, tb->rect, ret); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3709 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3710 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3711 | case never executed: CC_ComboBox:case CC_ComboBox: never executed: case CC_ComboBox: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3712 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3713 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3714 | GtkWidget *gtkCombo = box->editable
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3715 | : d->gtkWidget("GtkComboBox"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3716 | d->gtk_widget_set_direction(gtkCombo, (option->direction == Qt::RightToLeft) ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3717 | GtkAllocation geometry = {0, 0, qMax(0, option->rect.width()), qMax(0, option->rect.height())}; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3718 | d->gtk_widget_size_allocate(gtkCombo, &geometry); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3719 | int appears_as_list = !proxy()->styleHint(QStyle::SH_ComboBox_Popup, option, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3720 | QHashableLatin1Literal arrowPath("GtkComboBoxEntry.GtkToggleButton"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3721 | if (!box->editable
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3722 | if (appears_as_list
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3723 | arrowPath = "GtkComboBox.GtkToggleButton"; never executed: arrowPath = "GtkComboBox.GtkToggleButton"; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3724 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3725 | arrowPath = "GtkComboBox.GtkToggleButton.GtkHBox.GtkArrow"; never executed: arrowPath = "GtkComboBox.GtkToggleButton.GtkHBox.GtkArrow"; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3726 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3727 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3728 | GtkWidget *arrowWidget = d->gtkWidget(arrowPath); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3729 | if (!arrowWidget
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3730 | return never executed: QCommonStyle::subControlRect(control, option, subControl, widget);return QCommonStyle::subControlRect(control, option, subControl, widget); never executed: return QCommonStyle::subControlRect(control, option, subControl, widget); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3731 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3732 | GtkAllocation allocation; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3733 | d->gtk_widget_get_allocation(arrowWidget, &allocation); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3734 | QRect buttonRect(option->rect.left() + allocation.x, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3735 | option->rect.top() + allocation.y, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3736 | allocation.width, allocation.height); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3737 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3738 | switch (subControl) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3739 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3740 | case never executed: SC_ComboBoxArrow:case SC_ComboBoxArrow: never executed: case SC_ComboBoxArrow: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3741 | rect = buttonRect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3742 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3743 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3744 | case never executed: SC_ComboBoxEditField:case SC_ComboBoxEditField: never executed: {case SC_ComboBoxEditField: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3745 | rect = visualRect(option->direction, option->rect, rect); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3746 | int xMargin = box->editable
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3747 | GtkStyle *gtkComboStyle = d->gtk_widget_get_style(gtkCombo); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3748 | rect.setRect(option->rect.left() + gtkComboStyle->xthickness + xMargin, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3749 | option->rect.top() + gtkComboStyle->ythickness + yMargin, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3750 | option->rect.width() - buttonRect.width() - 2*(gtkComboStyle->xthickness + xMargin), | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3751 | option->rect.height() - 2*(gtkComboStyle->ythickness + yMargin)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3752 | rect = visualRect(option->direction, option->rect, rect); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3753 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3754 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3755 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3756 | default never executed: :default: never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3757 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3758 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3759 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3760 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3761 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3762 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3763 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3764 | default never executed: :default: never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3765 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3766 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3767 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3768 | return never executed: rect;return rect; never executed: return rect; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3769 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3770 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3771 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3772 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3773 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3774 | QSize QGtkStyle::sizeFromContents(ContentsType type, const QStyleOption *option, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3775 | const QSize &size, const QWidget *widget) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3776 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3777 | const QGtkStylePrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3778 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3779 | QSize newSize = QCommonStyle::sizeFromContents(type, option, size, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3780 | if (!d->isThemeAvailable()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3781 | return never executed: newSize;return newSize; never executed: return newSize; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3782 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3783 | switch (type) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3784 | case never executed: CT_GroupBox:case CT_GroupBox: never executed: case CT_GroupBox: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3785 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3786 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3787 | QFont font = gb->font(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3788 | font.setBold(true); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3789 | QFontMetrics metrics(font); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3790 | int baseWidth = metrics.width(gb->title()) + metrics.width(QLatin1Char(' ')); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3791 | if (gb->isCheckable()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3792 | baseWidth += proxy()->pixelMetric(QStyle::PM_IndicatorWidth, option, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3793 | baseWidth += proxy()->pixelMetric(QStyle::PM_CheckBoxLabelSpacing, option, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3794 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3795 | newSize.setWidth(qMax(baseWidth, newSize.width())); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3796 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3797 | newSize += QSize(4, 1 + groupBoxBottomMargin + groupBoxTopMargin + groupBoxTitleMargin); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3798 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3799 | case never executed: CT_ToolButton:case CT_ToolButton: never executed: case CT_ToolButton: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3800 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3801 | GtkWidget *gtkButton = d->gtkWidget("GtkToolButton.GtkButton"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3802 | GtkStyle *gtkButtonStyle = d->gtk_widget_get_style(gtkButton); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3803 | newSize = size + QSize(2 * gtkButtonStyle->xthickness, 2 + 2 * gtkButtonStyle->ythickness); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3804 | if (widget
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3805 | QSize minSize(0, 25); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3806 | if (toolbutton->toolButtonStyle != Qt::ToolButtonTextOnly
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3807 | minSize = toolbutton->iconSize + QSize(12, 12); never executed: minSize = toolbutton->iconSize + QSize(12, 12); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3808 | newSize = newSize.expandedTo(minSize); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3809 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3810 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3811 | if (toolbutton->features & QStyleOptionToolButton::HasMenu
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3812 | newSize += QSize(6, 0); never executed: newSize += QSize(6, 0); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3813 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3814 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3815 | case never executed: CT_SpinBox:case CT_SpinBox: never executed: case CT_SpinBox: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3816 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3817 | newSize = newSize + QSize(0, -d->gtk_widget_get_style(d->gtkWidget("GtkSpinButton"))->ythickness * 2); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3818 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3819 | case never executed: CT_RadioButton:case CT_RadioButton: never executed: case CT_RadioButton: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3820 | case never executed: CT_CheckBox:case CT_CheckBox: never executed: case CT_CheckBox: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3821 | newSize += QSize(0, 1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3822 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3823 | case never executed: CT_PushButton:case CT_PushButton: never executed: case CT_PushButton: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3824 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3825 | if (!btn->icon.isNull()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3826 | newSize -= QSize(0, 2); never executed: newSize -= QSize(0, 2); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3827 | newSize += QSize(0, 1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3828 | GtkWidget *gtkButton = d->gtkWidget("GtkButton"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3829 | gint focusPadding, focusWidth; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3830 | d->gtk_widget_style_get(gtkButton, "focus-padding", &focusPadding, __null); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3831 | d->gtk_widget_style_get(gtkButton, "focus-line-width", &focusWidth, __null); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3832 | newSize = size; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3833 | GtkStyle *gtkButtonStyle = d->gtk_widget_get_style(gtkButton); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3834 | newSize += QSize(2*gtkButtonStyle->xthickness + 4, 2*gtkButtonStyle->ythickness); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3835 | newSize += QSize(2*(focusWidth + focusPadding + 2), 2*(focusWidth + focusPadding)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3836 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3837 | GtkWidget *gtkButtonBox = d->gtkWidget("GtkHButtonBox"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3838 | gint minWidth = 85, minHeight = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3839 | d->gtk_widget_style_get(gtkButtonBox, "child-min-width", &minWidth, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3840 | "child-min-height", &minHeight, __null); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3841 | if (!btn->text.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3842 | newSize.setWidth(minWidth); never executed: newSize.setWidth(minWidth); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3843 | if (newSize.height() < minHeight
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3844 | newSize.setHeight(minHeight); never executed: newSize.setHeight(minHeight); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3845 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3846 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3847 | case never executed: CT_Slider:case CT_Slider: never executed: {case CT_Slider: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3848 | GtkWidget *gtkSlider = d->gtkWidget("GtkHScale"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3849 | GtkStyle *gtkSliderStyle = d->gtk_widget_get_style(gtkSlider); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3850 | newSize = size + QSize(2*gtkSliderStyle->xthickness, 2*gtkSliderStyle->ythickness); } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3851 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3852 | case never executed: CT_LineEdit:case CT_LineEdit: never executed: {case CT_LineEdit: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3853 | GtkWidget *gtkEntry = d->gtkWidget("GtkEntry"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3854 | GtkStyle *gtkEntryStyle = d->gtk_widget_get_style(gtkEntry); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3855 | newSize = size + QSize(2*gtkEntryStyle->xthickness, 2 + 2*gtkEntryStyle->ythickness); } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3856 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3857 | case never executed: CT_ItemViewItem:case CT_ItemViewItem: never executed: case CT_ItemViewItem: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3858 | newSize += QSize(0, 2); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3859 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3860 | case never executed: CT_ComboBox:case CT_ComboBox: never executed: case CT_ComboBox: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3861 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3862 | GtkWidget *gtkCombo = d->gtkWidget("GtkComboBox"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3863 | QRect arrowButtonRect = proxy()->subControlRect(CC_ComboBox, combo, SC_ComboBoxArrow, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3864 | GtkStyle *gtkComboStyle = d->gtk_widget_get_style(gtkCombo); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3865 | newSize = size + QSize(12 + arrowButtonRect.width() + 2*gtkComboStyle->xthickness, 4 + 2*gtkComboStyle->ythickness); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3866 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3867 | if (!(widget
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3868 | newSize += QSize(0, 2); never executed: newSize += QSize(0, 2); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3869 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3870 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3871 | case never executed: CT_TabBarTab:case CT_TabBarTab: never executed: case CT_TabBarTab: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3872 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3873 | if (!tab->icon.isNull()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3874 | newSize += QSize(6, 0); never executed: newSize += QSize(6, 0); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3875 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3876 | newSize += QSize(1, 1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3877 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3878 | case never executed: CT_MenuBarItem:case CT_MenuBarItem: never executed: case CT_MenuBarItem: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3879 | newSize += QSize(QGtkStylePrivate::menuItemHMargin * 4, QGtkStylePrivate::menuItemVMargin * 2 + 2); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3880 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3881 | case never executed: CT_SizeGrip:case CT_SizeGrip: never executed: case CT_SizeGrip: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3882 | newSize += QSize(4, 4); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3883 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3884 | case never executed: CT_MdiControls:case CT_MdiControls: never executed: case CT_MdiControls: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3885 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3886 | int width = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3887 | if (styleOpt->subControls & SC_MdiMinButton
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3888 | width += 19 + 1; never executed: width += 19 + 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3889 | if (styleOpt->subControls & SC_MdiNormalButton
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3890 | width += 19 + 1; never executed: width += 19 + 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3891 | if (styleOpt->subControls & SC_MdiCloseButton
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3892 | width += 19 + 1; never executed: width += 19 + 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3893 | newSize = QSize(width, 19); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3894 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3895 | newSize = QSize(60, 19); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3896 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3897 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3898 | case never executed: CT_MenuItem:case CT_MenuItem: never executed: case CT_MenuItem: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3899 | if (const
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3900 | int w = newSize.width(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3901 | int maxpmw = menuItem->maxIconWidth; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3902 | int tabSpacing = 20; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3903 | if (menuItem->text.contains(QLatin1Char('\t'))
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3904 | w += tabSpacing; never executed: w += tabSpacing; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3905 | else if (menuItem->menuItemType == QStyleOptionMenuItem::SubMenu
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3906 | w += 2 * QGtkStylePrivate::menuArrowHMargin; never executed: w += 2 * QGtkStylePrivate::menuArrowHMargin; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3907 | else if (menuItem->menuItemType == QStyleOptionMenuItem::DefaultItem
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3908 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3909 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3910 | QFontMetrics fm(menuItem->font); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3911 | QFont fontBold = menuItem->font; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3912 | fontBold.setBold(true); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3913 | QFontMetrics fmBold(fontBold); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3914 | w += fmBold.width(menuItem->text) - fm.width(menuItem->text); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3915 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3916 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3917 | int checkcol = qMax<int>(maxpmw, QGtkStylePrivate::menuCheckMarkWidth); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3918 | w += checkcol; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3919 | w += int(QGtkStylePrivate::menuRightBorder) + 10; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3920 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3921 | newSize.setWidth(w); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3922 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3923 | int textMargin = 8; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3924 | if (menuItem->menuItemType == QStyleOptionMenuItem::Separator
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3925 | GtkWidget *gtkMenuSeparator = d->gtkWidget("GtkMenu.GtkSeparatorMenuItem"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3926 | GtkRequisition sizeReq = {0, 0}; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3927 | d->gtk_widget_size_request(gtkMenuSeparator, &sizeReq); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3928 | newSize = QSize(newSize.width(), sizeReq.height); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3929 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3930 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3931 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3932 | GtkWidget *gtkMenuItem = d->gtkWidget("GtkMenu.GtkCheckMenuItem"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3933 | GtkStyle* style = d->gtk_widget_get_style(gtkMenuItem); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3934 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3935 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3936 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3937 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3938 | GtkRequisition sizeReq = {0, 0}; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3939 | d->gtk_widget_size_request(gtkMenuItem, &sizeReq); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3940 | newSize.setHeight(qMax(newSize.height() - 4, sizeReq.height)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3941 | newSize += QSize(textMargin + style->xthickness - 1, 0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3942 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3943 | gint checkSize; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3944 | d->gtk_widget_style_get(gtkMenuItem, "indicator-size", &checkSize, __null); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3945 | newSize.setWidth(newSize.width() + qMax(0, checkSize - 20)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3946 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3947 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3948 | default never executed: :default: never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3949 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3950 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3951 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3952 | return never executed: newSize;return newSize; never executed: return newSize; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3953 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3954 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3955 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3956 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3957 | QPixmap QGtkStyle::standardPixmap(StandardPixmap sp, const QStyleOption *option, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3958 | const QWidget *widget) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3959 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3960 | const QGtkStylePrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3961 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3962 | if (!d->isThemeAvailable()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3963 | return never executed: QCommonStyle::standardPixmap(sp, option, widget);return QCommonStyle::standardPixmap(sp, option, widget); never executed: return QCommonStyle::standardPixmap(sp, option, widget); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3964 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3965 | QPixmap pixmap; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3966 | switch (sp) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3967 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3968 | case never executed: SP_TitleBarNormalButton:case SP_TitleBarNormalButton: never executed: {case SP_TitleBarNormalButton: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3969 | QImage restoreButton(dock_widget_restore_xpm); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3970 | QColor alphaCorner = restoreButton.color(2); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3971 | alphaCorner.setAlpha(80); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3972 | restoreButton.setColor(2, alphaCorner.rgba()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3973 | alphaCorner.setAlpha(180); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3974 | restoreButton.setColor(4, alphaCorner.rgba()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3975 | return never executed: QPixmap::fromImage(restoreButton);return QPixmap::fromImage(restoreButton); never executed: return QPixmap::fromImage(restoreButton); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3976 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3977 | break; dead code: break; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3978 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3979 | case never executed: SP_TitleBarCloseButton:case SP_TitleBarCloseButton: never executed: case SP_TitleBarCloseButton: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3980 | case never executed: SP_DockWidgetCloseButton:case SP_DockWidgetCloseButton: never executed: {case SP_DockWidgetCloseButton: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3981 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3982 | QImage closeButton(dock_widget_close_xpm); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3983 | QColor alphaCorner = closeButton.color(2); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3984 | alphaCorner.setAlpha(80); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3985 | closeButton.setColor(2, alphaCorner.rgba()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3986 | return never executed: QPixmap::fromImage(closeButton);return QPixmap::fromImage(closeButton); never executed: return QPixmap::fromImage(closeButton); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3987 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3988 | break; dead code: break; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3989 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
3990 | case never executed: SP_DialogDiscardButton:case SP_DialogDiscardButton: never executed: case SP_DialogDiscardButton: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3991 | return never executed: qt_gtk_get_icon("gtk-delete");return qt_gtk_get_icon("gtk-delete"); never executed: return qt_gtk_get_icon("gtk-delete"); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3992 | case never executed: SP_DialogOkButton:case SP_DialogOkButton: never executed: case SP_DialogOkButton: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3993 | return never executed: qt_gtk_get_icon("gtk-ok");return qt_gtk_get_icon("gtk-ok"); never executed: return qt_gtk_get_icon("gtk-ok"); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3994 | case never executed: SP_DialogCancelButton:case SP_DialogCancelButton: never executed: case SP_DialogCancelButton: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3995 | return never executed: qt_gtk_get_icon("gtk-cancel");return qt_gtk_get_icon("gtk-cancel"); never executed: return qt_gtk_get_icon("gtk-cancel"); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3996 | case never executed: SP_DialogYesButton:case SP_DialogYesButton: never executed: case SP_DialogYesButton: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3997 | return never executed: qt_gtk_get_icon("gtk-yes");return qt_gtk_get_icon("gtk-yes"); never executed: return qt_gtk_get_icon("gtk-yes"); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3998 | case never executed: SP_DialogNoButton:case SP_DialogNoButton: never executed: case SP_DialogNoButton: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
3999 | return never executed: qt_gtk_get_icon("gtk-no");return qt_gtk_get_icon("gtk-no"); never executed: return qt_gtk_get_icon("gtk-no"); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4000 | case never executed: SP_DialogOpenButton:case SP_DialogOpenButton: never executed: case SP_DialogOpenButton: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4001 | return never executed: qt_gtk_get_icon("gtk-open");return qt_gtk_get_icon("gtk-open"); never executed: return qt_gtk_get_icon("gtk-open"); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4002 | case never executed: SP_DialogCloseButton:case SP_DialogCloseButton: never executed: case SP_DialogCloseButton: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4003 | return never executed: qt_gtk_get_icon("gtk-close");return qt_gtk_get_icon("gtk-close"); never executed: return qt_gtk_get_icon("gtk-close"); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4004 | case never executed: SP_DialogApplyButton:case SP_DialogApplyButton: never executed: case SP_DialogApplyButton: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4005 | return never executed: qt_gtk_get_icon("gtk-apply");return qt_gtk_get_icon("gtk-apply"); never executed: return qt_gtk_get_icon("gtk-apply"); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4006 | case never executed: SP_DialogSaveButton:case SP_DialogSaveButton: never executed: case SP_DialogSaveButton: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4007 | return never executed: qt_gtk_get_icon("gtk-save");return qt_gtk_get_icon("gtk-save"); never executed: return qt_gtk_get_icon("gtk-save"); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4008 | case never executed: SP_MessageBoxWarning:case SP_MessageBoxWarning: never executed: case SP_MessageBoxWarning: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4009 | return never executed: qt_gtk_get_icon("gtk-dialog-warning", GTK_ICON_SIZE_DIALOG);return qt_gtk_get_icon("gtk-dialog-warning", GTK_ICON_SIZE_DIALOG); never executed: return qt_gtk_get_icon("gtk-dialog-warning", GTK_ICON_SIZE_DIALOG); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4010 | case never executed: SP_MessageBoxQuestion:case SP_MessageBoxQuestion: never executed: case SP_MessageBoxQuestion: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4011 | return never executed: qt_gtk_get_icon("gtk-dialog-question", GTK_ICON_SIZE_DIALOG);return qt_gtk_get_icon("gtk-dialog-question", GTK_ICON_SIZE_DIALOG); never executed: return qt_gtk_get_icon("gtk-dialog-question", GTK_ICON_SIZE_DIALOG); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4012 | case never executed: SP_MessageBoxInformation:case SP_MessageBoxInformation: never executed: case SP_MessageBoxInformation: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4013 | return never executed: qt_gtk_get_icon("gtk-dialog-info", GTK_ICON_SIZE_DIALOG);return qt_gtk_get_icon("gtk-dialog-info", GTK_ICON_SIZE_DIALOG); never executed: return qt_gtk_get_icon("gtk-dialog-info", GTK_ICON_SIZE_DIALOG); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4014 | case never executed: SP_MessageBoxCritical:case SP_MessageBoxCritical: never executed: case SP_MessageBoxCritical: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4015 | return never executed: qt_gtk_get_icon("gtk-dialog-error", GTK_ICON_SIZE_DIALOG);return qt_gtk_get_icon("gtk-dialog-error", GTK_ICON_SIZE_DIALOG); never executed: return qt_gtk_get_icon("gtk-dialog-error", GTK_ICON_SIZE_DIALOG); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4016 | default never executed: :default: never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4017 | return never executed: QCommonStyle::standardPixmap(sp, option, widget);return QCommonStyle::standardPixmap(sp, option, widget); never executed: return QCommonStyle::standardPixmap(sp, option, widget); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4018 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4019 | return never executed: pixmap;return pixmap; never executed: return pixmap; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4020 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4021 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
4022 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
4023 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
4024 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
4025 | QIcon QGtkStyle::standardIcon(StandardPixmap standardIcon, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4026 | const QStyleOption *option, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4027 | const QWidget *widget) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4028 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4029 | const QGtkStylePrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4030 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
4031 | if (!d->isThemeAvailable()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4032 | return never executed: QCommonStyle::standardIcon(standardIcon, option, widget);return QCommonStyle::standardIcon(standardIcon, option, widget); never executed: return QCommonStyle::standardIcon(standardIcon, option, widget); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4033 | switch (standardIcon) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4034 | case never executed: SP_DialogDiscardButton:case SP_DialogDiscardButton: never executed: case SP_DialogDiscardButton: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4035 | return never executed: qt_gtk_get_icon("gtk-delete");return qt_gtk_get_icon("gtk-delete"); never executed: return qt_gtk_get_icon("gtk-delete"); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4036 | case never executed: SP_DialogOkButton:case SP_DialogOkButton: never executed: case SP_DialogOkButton: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4037 | return never executed: qt_gtk_get_icon("gtk-ok");return qt_gtk_get_icon("gtk-ok"); never executed: return qt_gtk_get_icon("gtk-ok"); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4038 | case never executed: SP_DialogCancelButton:case SP_DialogCancelButton: never executed: case SP_DialogCancelButton: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4039 | return never executed: qt_gtk_get_icon("gtk-cancel");return qt_gtk_get_icon("gtk-cancel"); never executed: return qt_gtk_get_icon("gtk-cancel"); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4040 | case never executed: SP_DialogYesButton:case SP_DialogYesButton: never executed: case SP_DialogYesButton: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4041 | return never executed: qt_gtk_get_icon("gtk-yes");return qt_gtk_get_icon("gtk-yes"); never executed: return qt_gtk_get_icon("gtk-yes"); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4042 | case never executed: SP_DialogNoButton:case SP_DialogNoButton: never executed: case SP_DialogNoButton: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4043 | return never executed: qt_gtk_get_icon("gtk-no");return qt_gtk_get_icon("gtk-no"); never executed: return qt_gtk_get_icon("gtk-no"); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4044 | case never executed: SP_DialogOpenButton:case SP_DialogOpenButton: never executed: case SP_DialogOpenButton: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4045 | return never executed: qt_gtk_get_icon("gtk-open");return qt_gtk_get_icon("gtk-open"); never executed: return qt_gtk_get_icon("gtk-open"); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4046 | case never executed: SP_DialogCloseButton:case SP_DialogCloseButton: never executed: case SP_DialogCloseButton: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4047 | return never executed: qt_gtk_get_icon("gtk-close");return qt_gtk_get_icon("gtk-close"); never executed: return qt_gtk_get_icon("gtk-close"); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4048 | case never executed: SP_DialogApplyButton:case SP_DialogApplyButton: never executed: case SP_DialogApplyButton: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4049 | return never executed: qt_gtk_get_icon("gtk-apply");return qt_gtk_get_icon("gtk-apply"); never executed: return qt_gtk_get_icon("gtk-apply"); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4050 | case never executed: SP_DialogSaveButton:case SP_DialogSaveButton: never executed: case SP_DialogSaveButton: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4051 | return never executed: qt_gtk_get_icon("gtk-save");return qt_gtk_get_icon("gtk-save"); never executed: return qt_gtk_get_icon("gtk-save"); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4052 | case never executed: SP_MessageBoxWarning:case SP_MessageBoxWarning: never executed: case SP_MessageBoxWarning: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4053 | return never executed: qt_gtk_get_icon("gtk-dialog-warning", GTK_ICON_SIZE_DIALOG);return qt_gtk_get_icon("gtk-dialog-warning", GTK_ICON_SIZE_DIALOG); never executed: return qt_gtk_get_icon("gtk-dialog-warning", GTK_ICON_SIZE_DIALOG); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4054 | case never executed: SP_MessageBoxQuestion:case SP_MessageBoxQuestion: never executed: case SP_MessageBoxQuestion: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4055 | return never executed: qt_gtk_get_icon("gtk-dialog-question", GTK_ICON_SIZE_DIALOG);return qt_gtk_get_icon("gtk-dialog-question", GTK_ICON_SIZE_DIALOG); never executed: return qt_gtk_get_icon("gtk-dialog-question", GTK_ICON_SIZE_DIALOG); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4056 | case never executed: SP_MessageBoxInformation:case SP_MessageBoxInformation: never executed: case SP_MessageBoxInformation: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4057 | return never executed: qt_gtk_get_icon("gtk-dialog-info", GTK_ICON_SIZE_DIALOG);return qt_gtk_get_icon("gtk-dialog-info", GTK_ICON_SIZE_DIALOG); never executed: return qt_gtk_get_icon("gtk-dialog-info", GTK_ICON_SIZE_DIALOG); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4058 | case never executed: SP_MessageBoxCritical:case SP_MessageBoxCritical: never executed: case SP_MessageBoxCritical: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4059 | return never executed: qt_gtk_get_icon("gtk-dialog-error", GTK_ICON_SIZE_DIALOG);return qt_gtk_get_icon("gtk-dialog-error", GTK_ICON_SIZE_DIALOG); never executed: return qt_gtk_get_icon("gtk-dialog-error", GTK_ICON_SIZE_DIALOG); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4060 | default never executed: :default: never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4061 | return never executed: QCommonStyle::standardIcon(standardIcon, option, widget);return QCommonStyle::standardIcon(standardIcon, option, widget); never executed: return QCommonStyle::standardIcon(standardIcon, option, widget); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4062 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4063 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4064 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
4065 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
4066 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
4067 | QRect QGtkStyle::subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4068 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4069 | const QGtkStylePrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4070 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
4071 | QRect r = QCommonStyle::subElementRect(element, option, widget); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4072 | if (!d->isThemeAvailable()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4073 | return never executed: r;return r; never executed: return r; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4074 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
4075 | switch (element) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4076 | case never executed: SE_PushButtonFocusRect:case SE_PushButtonFocusRect: never executed: case SE_PushButtonFocusRect: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4077 | r.adjust(0, 1, 0, -1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4078 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4079 | case never executed: SE_DockWidgetTitleBarText:case SE_DockWidgetTitleBarText: never executed: {case SE_DockWidgetTitleBarText: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4080 | const QStyleOptionDockWidgetV2 *v2 | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4081 | = qstyleoption_cast<const QStyleOptionDockWidgetV2*>(option); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4082 | bool verticalTitleBar = v2 == 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4083 | if (verticalTitleBar
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4084 | r.adjust(0, 0, 0, -4); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4085 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4086 | if (option->direction == Qt::LeftToRight
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4087 | r.adjust(4, 0, 0, 0); never executed: r.adjust(4, 0, 0, 0); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4088 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4089 | r.adjust(0, 0, -4, 0); never executed: r.adjust(0, 0, -4, 0); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4090 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4091 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
4092 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4093 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4094 | case never executed: SE_ProgressBarLabel:case SE_ProgressBarLabel: never executed: case SE_ProgressBarLabel: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4095 | case never executed: SE_ProgressBarContents:case SE_ProgressBarContents: never executed: case SE_ProgressBarContents: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4096 | case never executed: SE_ProgressBarGroove:case SE_ProgressBarGroove: never executed: case SE_ProgressBarGroove: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4097 | return never executed: option->rect;return option->rect; never executed: return option->rect; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4098 | case never executed: SE_PushButtonContents:case SE_PushButtonContents: never executed: case SE_PushButtonContents: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4099 | if (!d->gtk_check_version(2, 10, 0)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4100 | GtkWidget *gtkButton = d->gtkWidget("GtkButton"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4101 | GtkBorder *border = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4102 | d->gtk_widget_style_get(gtkButton, "inner-border", &border, __null); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4103 | if (border
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4104 | r = option->rect.adjusted(border->left, border->top, -border->right, -border->bottom); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4105 | d->gtk_border_free(border); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4106 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4107 | r = option->rect.adjusted(1, 1, -1, -1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4108 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4109 | r = visualRect(option->direction, option->rect, r); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4110 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4111 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4112 | default never executed: :default: never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4113 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4114 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4115 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
4116 | return never executed: r;return r; never executed: return r; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4117 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4118 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
4119 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
4120 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
4121 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
4122 | QRect QGtkStyle::itemPixmapRect(const QRect &r, int flags, const QPixmap &pixmap) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4123 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4124 | return never executed: QCommonStyle::itemPixmapRect(r, flags, pixmap);return QCommonStyle::itemPixmapRect(r, flags, pixmap); never executed: return QCommonStyle::itemPixmapRect(r, flags, pixmap); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4125 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4126 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
4127 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
4128 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
4129 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
4130 | void QGtkStyle::drawItemPixmap(QPainter *painter, const QRect &rect, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4131 | int alignment, const QPixmap &pixmap) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4132 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4133 | QCommonStyle::drawItemPixmap(painter, rect, alignment, pixmap); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4134 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4135 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
4136 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
4137 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
4138 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
4139 | QStyle::SubControl QGtkStyle::hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4140 | const QPoint &pt, const QWidget *w) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4141 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4142 | return never executed: QCommonStyle::hitTestComplexControl(cc, opt, pt, w);return QCommonStyle::hitTestComplexControl(cc, opt, pt, w); never executed: return QCommonStyle::hitTestComplexControl(cc, opt, pt, w); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4143 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4144 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
4145 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
4146 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
4147 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
4148 | QPixmap QGtkStyle::generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4149 | const QStyleOption *opt) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4150 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4151 | return never executed: QCommonStyle::generatedIconPixmap(iconMode, pixmap, opt);return QCommonStyle::generatedIconPixmap(iconMode, pixmap, opt); never executed: return QCommonStyle::generatedIconPixmap(iconMode, pixmap, opt); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4152 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4153 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
4154 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
4155 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
4156 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
4157 | void QGtkStyle::drawItemText(QPainter *painter, const QRect &rect, int alignment, const QPalette &pal, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4158 | bool enabled, const QString& text, QPalette::ColorRole textRole) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4159 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4160 | return never executed: QCommonStyle::drawItemText(painter, rect, alignment, pal, enabled, text, textRole);return QCommonStyle::drawItemText(painter, rect, alignment, pal, enabled, text, textRole); never executed: return QCommonStyle::drawItemText(painter, rect, alignment, pal, enabled, text, textRole); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4161 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
4162 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
4163 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Switch to Source code | Preprocessed file |