1 /* ***** BEGIN LICENSE BLOCK *****
2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 * The contents of this file are subject to the Mozilla Public License Version
5 * 1.1 (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 * http://www.mozilla.org/MPL/
9 * Software distributed under the License is distributed on an "AS IS" basis,
10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11 * for the specific language governing rights and limitations under the
14 * The Original Code is mozilla.org code.
16 * The Initial Developer of the Original Code is
17 * David Hyatt (hyatt@netscape.com).
18 * Portions created by the Initial Developer are Copyright (C) 2001
19 * the Initial Developer. All Rights Reserved.
22 * Lars Knoll <knoll@kde.org>
23 * Zack Rusin <zack@kde.org>
24 * Tim Hill (tim@prismelite.com)
25 * Vladimir Vukicevic <vladimir@pobox.com>
27 * Alternatively, the contents of this file may be used under the terms of
28 * either of the GNU General Public License Version 2 or later (the "GPL"),
29 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
30 * in which case the provisions of the GPL or the LGPL are applicable instead
31 * of those above. If you wish to allow use of your version of this file only
32 * under the terms of either the GPL or the LGPL, and not to allow others to
33 * use your version of this file under the terms of the MPL, indicate your
34 * decision by deleting the provisions above and replace them with the notice
35 * and other provisions required by the GPL or the LGPL. If you do not delete
36 * the provisions above, a recipient may use your version of this file under
37 * the terms of any one of the MPL, the GPL or the LGPL.
39 * ***** END LICENSE BLOCK ***** */
43 #include <QApplication>
48 #include <QStyleOption>
49 #include <QStyleOptionFrameV2>
50 #include <QStyleOptionButton>
52 #include <QStyleOptionComboBox>
55 #include "nsNativeThemeQt.h"
56 #include "nsIDeviceContext.h"
57 #include "nsPresContext.h"
61 #include "nsTransform2D.h"
62 #include "nsThemeConstants.h"
63 #include "nsILookAndFeel.h"
64 #include "nsIServiceManager.h"
65 #include "nsIEventStateManager.h"
66 #include "nsIDOMHTMLInputElement.h"
70 #include "gfxASurface.h"
71 #include "gfxContext.h"
72 #include "gfxQPainterSurface.h"
73 #include "nsIRenderingContext.h"
75 nsNativeThemeQt::nsNativeThemeQt()
77 mNoBackgroundPalette
.setColor(QPalette::Window
, Qt::transparent
);
81 nsNativeThemeQt::~nsNativeThemeQt()
85 NS_IMPL_ISUPPORTS1(nsNativeThemeQt
, nsITheme
)
87 static inline QRect
qRectInPixels(const nsRect
&aRect
,
90 return QRect(NSAppUnitsToIntPixels(aRect
.x
, p2a
),
91 NSAppUnitsToIntPixels(aRect
.y
, p2a
),
92 NSAppUnitsToIntPixels(aRect
.width
, p2a
),
93 NSAppUnitsToIntPixels(aRect
.height
, p2a
));
97 nsNativeThemeQt::DrawWidgetBackground(nsIRenderingContext
* aContext
,
101 const nsRect
& aClipRect
)
103 gfxContext
* context
= aContext
->ThebesContext();
104 nsRefPtr
<gfxASurface
> surface
= context
->CurrentSurface();
106 context
->UpdateSurfaceClip();
108 if (surface
->GetType() != gfxASurface::SurfaceTypeQPainter
)
109 return NS_ERROR_NOT_IMPLEMENTED
;
111 gfxQPainterSurface
* qSurface
= (gfxQPainterSurface
*) (surface
.get());
112 QPainter
* qPainter
= qSurface
->GetQPainter();
114 NS_ASSERTION(qPainter
, "Where'd my QPainter go?");
116 if (qPainter
== nsnull
)
119 QStyle
* style
= qApp
->style();
123 gfxPoint offs
= surface
->GetDeviceOffset();
124 qPainter
->translate(offs
.x
, offs
.y
);
126 gfxMatrix ctm
= context
->CurrentMatrix();
127 if (!ctm
.HasNonTranslation()) {
128 ctm
.x0
= NSToCoordRound(ctm
.x0
);
129 ctm
.y0
= NSToCoordRound(ctm
.y0
);
132 QMatrix
qctm(ctm
.xx
, ctm
.xy
, ctm
.yx
, ctm
.yy
, ctm
.x0
, ctm
.y0
);
133 qPainter
->setWorldMatrix(qctm
, true);
135 PRInt32 p2a
= GetAppUnitsPerDevPixel(aContext
);
137 QRect r
= qRectInPixels(aRect
, p2a
);
138 QRect cr
= qRectInPixels(aClipRect
, p2a
);
140 QStyle::State extraFlags
= QStyle::State_None
;
142 switch (aWidgetType
) {
144 case NS_THEME_CHECKBOX
: {
145 QStyleOptionButton opt
;
146 InitButtonStyle (aWidgetType
, aFrame
, r
, opt
);
148 if (aWidgetType
== NS_THEME_CHECKBOX
)
150 style
->drawPrimitive (QStyle::PE_IndicatorCheckBox
, &opt
, qPainter
);
152 style
->drawPrimitive (QStyle::PE_IndicatorRadioButton
, &opt
, qPainter
);
156 case NS_THEME_BUTTON
:
157 case NS_THEME_BUTTON_BEVEL
: {
158 QStyleOptionButton opt
;
159 InitButtonStyle (aWidgetType
, aFrame
, r
, opt
);
161 if (aWidgetType
== NS_THEME_BUTTON
) {
162 style
->drawPrimitive(QStyle::PE_PanelButtonCommand
, &opt
, qPainter
);
163 if (IsDefaultButton(aFrame
))
164 style
->drawPrimitive(QStyle::PE_FrameDefaultButton
, &opt
, qPainter
);
166 style
->drawPrimitive(QStyle::PE_PanelButtonBevel
, &opt
, qPainter
);
167 style
->drawPrimitive(QStyle::PE_FrameButtonBevel
, &opt
, qPainter
);
171 case NS_THEME_SCROLLBAR
: {
172 qPainter
->fillRect(r
, qApp
->palette().brush(QPalette::Normal
, QPalette::Window
));
175 case NS_THEME_SCROLLBAR_TRACK_HORIZONTAL
: {
176 qPainter
->fillRect(r
, qApp
->palette().brush(QPalette::Active
, QPalette::Window
));
179 case NS_THEME_SCROLLBAR_TRACK_VERTICAL
: {
180 qPainter
->fillRect(r
, qApp
->palette().brush(QPalette::Active
, QPalette::Window
));
183 case NS_THEME_SCROLLBAR_BUTTON_LEFT
: {
184 QStyleOptionSlider opt
;
185 InitPlainStyle(aWidgetType
, aFrame
, r
, (QStyleOption
&)opt
, QStyle::State_Horizontal
);
186 opt
.orientation
= Qt::Horizontal
;
187 style
->drawControl(QStyle::CE_ScrollBarSubLine
, &opt
, qPainter
, NULL
);
190 case NS_THEME_SCROLLBAR_BUTTON_RIGHT
: {
191 QStyleOptionSlider opt
;
192 InitPlainStyle(aWidgetType
, aFrame
, r
, (QStyleOption
&)opt
, QStyle::State_Horizontal
);
193 opt
.orientation
= Qt::Horizontal
;
194 style
->drawControl(QStyle::CE_ScrollBarAddLine
, &opt
, qPainter
, NULL
);
197 case NS_THEME_SCROLLBAR_BUTTON_UP
: {
198 QStyleOptionSlider opt
;
199 InitPlainStyle(aWidgetType
, aFrame
, r
, (QStyleOption
&)opt
);
200 opt
.orientation
= Qt::Vertical
;
201 style
->drawControl(QStyle::CE_ScrollBarSubLine
, &opt
, qPainter
, NULL
);
204 case NS_THEME_SCROLLBAR_BUTTON_DOWN
: {
205 QStyleOptionSlider opt
;
206 InitPlainStyle(aWidgetType
, aFrame
, r
, (QStyleOption
&)opt
);
207 opt
.orientation
= Qt::Vertical
;
208 style
->drawControl(QStyle::CE_ScrollBarAddLine
, &opt
, qPainter
, NULL
);
211 case NS_THEME_SCROLLBAR_THUMB_HORIZONTAL
: {
212 extraFlags
|= QStyle::State_Horizontal
;
213 QStyleOptionSlider option
;
214 InitPlainStyle(aWidgetType
, aFrame
, r
, (QStyleOption
&)option
, extraFlags
);
215 option
.orientation
= Qt::Horizontal
;
216 style
->drawControl(QStyle::CE_ScrollBarSlider
, &option
, qPainter
, NULL
);
219 case NS_THEME_SCROLLBAR_THUMB_VERTICAL
: {
220 QStyleOptionSlider option
;
221 InitPlainStyle(aWidgetType
, aFrame
, r
, (QStyleOption
&)option
, extraFlags
);
222 option
.orientation
= Qt::Vertical
;
223 style
->drawControl(QStyle::CE_ScrollBarSlider
, &option
, qPainter
, NULL
);
226 case NS_THEME_DROPDOWN
: {
227 QStyleOptionComboBox comboOpt
;
229 InitComboStyle(aWidgetType
, aFrame
, r
, comboOpt
);
231 style
->drawComplexControl(QStyle::CC_ComboBox
, &comboOpt
, qPainter
);
234 case NS_THEME_DROPDOWN_BUTTON
: {
235 QStyleOptionComboBox option
;
237 InitComboStyle(aWidgetType
, aFrame
, r
, option
);
239 style
->drawPrimitive(QStyle::PE_FrameDefaultButton
, &option
, qPainter
);
240 style
->drawPrimitive(QStyle::PE_IndicatorSpinDown
, &option
, qPainter
);
243 case NS_THEME_DROPDOWN_TEXT
:
244 case NS_THEME_DROPDOWN_TEXTFIELD
:
245 case NS_THEME_TEXTFIELD
:
246 case NS_THEME_TEXTFIELD_MULTILINE
:
247 case NS_THEME_LISTBOX
: {
248 QStyleOptionFrameV2 frameOpt
;
250 if (!IsDisabled(aFrame
))
251 frameOpt
.state
|= QStyle::State_Enabled
;
254 frameOpt
.features
= QStyleOptionFrameV2::Flat
;
256 if (aWidgetType
== NS_THEME_TEXTFIELD
|| aWidgetType
== NS_THEME_TEXTFIELD_MULTILINE
) {
257 QRect contentRect
= style
->subElementRect(QStyle::SE_LineEditContents
, &frameOpt
);
258 contentRect
.adjust(mFrameWidth
, mFrameWidth
, -mFrameWidth
, -mFrameWidth
);
259 qPainter
->fillRect(contentRect
, QBrush(Qt::white
));
262 frameOpt
.palette
= mNoBackgroundPalette
;
263 style
->drawPrimitive(QStyle::PE_FrameLineEdit
, &frameOpt
, qPainter
, NULL
);
266 case NS_THEME_MENUPOPUP
: {
267 QStyleOptionMenuItem option
;
268 InitPlainStyle(aWidgetType
, aFrame
, r
, (QStyleOption
&)option
, extraFlags
);
269 style
->drawPrimitive(QStyle::PE_FrameMenu
, &option
, qPainter
, NULL
);
281 nsNativeThemeQt::GetWidgetBorder(nsIDeviceContext
* aContext
,
286 (*aResult
).top
= (*aResult
).bottom
= (*aResult
).left
= (*aResult
).right
= 0;
288 QStyle
* style
= qApp
->style();
289 switch(aWidgetType
) {
290 // case NS_THEME_TEXTFIELD:
291 // case NS_THEME_LISTBOX:
292 case NS_THEME_MENUPOPUP
: {
293 (*aResult
).top
= (*aResult
).bottom
= (*aResult
).left
= (*aResult
).right
= style
->pixelMetric(QStyle::PM_MenuPanelWidth
);
304 nsNativeThemeQt::GetWidgetPadding(nsIDeviceContext
* ,
305 nsIFrame
*, PRUint8 aWidgetType
,
308 // XXX: Where to get padding values, framewidth?
309 if (aWidgetType
== NS_THEME_TEXTFIELD
||
310 aWidgetType
== NS_THEME_TEXTFIELD_MULTILINE
||
311 aWidgetType
== NS_THEME_DROPDOWN
) {
312 aResult
->SizeTo(2, 2, 2, 2);
320 nsNativeThemeQt::GetMinimumWidgetSize(nsIRenderingContext
* aContext
, nsIFrame
* aFrame
,
322 nsSize
* aResult
, PRBool
* aIsOverridable
)
324 (*aResult
).width
= (*aResult
).height
= 0;
325 *aIsOverridable
= PR_TRUE
;
327 QStyle
*s
= qApp
->style();
329 PRInt32 p2a
= GetAppUnitsPerDevPixel(aContext
);
331 switch (aWidgetType
) {
333 case NS_THEME_CHECKBOX
: {
334 nsRect frameRect
= aFrame
->GetRect();
336 QRect qRect
= qRectInPixels(frameRect
, p2a
);
338 QStyleOptionButton option
;
340 InitButtonStyle(aWidgetType
, aFrame
, qRect
, option
);
342 QRect rect
= s
->subElementRect(
343 (aWidgetType
== NS_THEME_CHECKBOX
) ?
344 QStyle::SE_CheckBoxIndicator
:
345 QStyle::SE_RadioButtonIndicator
,
349 (*aResult
).width
= rect
.width();
350 (*aResult
).height
= rect
.height();
353 case NS_THEME_BUTTON
: {
354 nsRect frameRect
= aFrame
->GetRect();
356 QRect qRect
= qRectInPixels(frameRect
, p2a
);
358 QStyleOptionButton option
;
360 InitButtonStyle(aWidgetType
, aFrame
, qRect
, option
);
362 QRect rect
= s
->subElementRect(
363 QStyle::SE_PushButtonFocusRect
,
367 (*aResult
).width
= rect
.width();
368 (*aResult
).height
= rect
.height();
371 case NS_THEME_SCROLLBAR_BUTTON_UP
:
372 case NS_THEME_SCROLLBAR_BUTTON_DOWN
: {
373 (*aResult
).width
= s
->pixelMetric(QStyle::PM_ScrollBarExtent
);
374 (*aResult
).height
= (*aResult
).width
;
375 //*aIsOverridable = PR_FALSE;
378 case NS_THEME_SCROLLBAR_BUTTON_LEFT
:
379 case NS_THEME_SCROLLBAR_BUTTON_RIGHT
: {
380 (*aResult
).height
= s
->pixelMetric(QStyle::PM_ScrollBarExtent
);
381 (*aResult
).width
= (*aResult
).height
;
382 //*aIsOverridable = PR_FALSE;
385 case NS_THEME_SCROLLBAR_THUMB_VERTICAL
: {
386 (*aResult
).width
= s
->pixelMetric(QStyle::PM_ScrollBarExtent
);
387 (*aResult
).height
= s
->pixelMetric(QStyle::PM_ScrollBarSliderMin
);
388 //*aIsOverridable = PR_FALSE;
391 case NS_THEME_SCROLLBAR_THUMB_HORIZONTAL
: {
392 (*aResult
).width
= s
->pixelMetric(QStyle::PM_ScrollBarSliderMin
);
393 (*aResult
).height
= s
->pixelMetric(QStyle::PM_ScrollBarExtent
);
394 //*aIsOverridable = PR_FALSE;
397 case NS_THEME_SCROLLBAR_TRACK_VERTICAL
: {
398 (*aResult
).width
= s
->pixelMetric(QStyle::PM_ScrollBarExtent
);
399 (*aResult
).height
= s
->pixelMetric(QStyle::PM_SliderLength
);
402 case NS_THEME_SCROLLBAR_TRACK_HORIZONTAL
: {
403 (*aResult
).width
= s
->pixelMetric(QStyle::PM_SliderLength
);
404 (*aResult
).height
= s
->pixelMetric(QStyle::PM_ScrollBarExtent
);
407 case NS_THEME_DROPDOWN_BUTTON
: {
408 QStyleOptionComboBox comboOpt
;
410 nsRect frameRect
= aFrame
->GetRect();
411 QRect qRect
= qRectInPixels(frameRect
, p2a
);
412 comboOpt
.rect
= qRect
;
414 InitComboStyle(aWidgetType
, aFrame
, qRect
, comboOpt
);
416 QRect subRect
= s
->subControlRect(QStyle::CC_ComboBox
, &comboOpt
, QStyle::SC_ComboBoxArrow
, NULL
);
418 (*aResult
).width
= subRect
.width();
419 (*aResult
).height
= subRect
.height();
420 //*aIsOverridable = PR_FALSE;
423 case NS_THEME_DROPDOWN
: {
424 QStyleOptionComboBox comboOpt
;
426 nsRect frameRect
= aFrame
->GetRect();
427 QRect qRect
= qRectInPixels(frameRect
, p2a
);
428 comboOpt
.rect
= qRect
;
430 InitComboStyle(aWidgetType
, aFrame
, qRect
, comboOpt
);
432 QRect subRect
= s
->subControlRect(QStyle::CC_ComboBox
,
434 QStyle::SC_ComboBoxFrame
,
437 (*aResult
).width
= subRect
.width();
438 (*aResult
).height
= subRect
.height();
439 //*aIsOverridable = PR_FALSE;
442 case NS_THEME_DROPDOWN_TEXT
: {
443 QStyleOptionComboBox comboOpt
;
445 nsRect frameRect
= aFrame
->GetRect();
447 QRect qRect
= qRectInPixels(frameRect
, p2a
);
449 comboOpt
.rect
= qRect
;
451 QRect subRect
= s
->subControlRect(QStyle::CC_ComboBox
, &comboOpt
, QStyle::SC_ComboBoxEditField
, NULL
);
453 (*aResult
).width
= subRect
.width();
454 (*aResult
).height
= subRect
.height();
455 //*aIsOverridable = PR_FALSE;
458 case NS_THEME_DROPDOWN_TEXTFIELD
: {
459 QStyleOptionComboBox comboOpt
;
461 nsRect frameRect
= aFrame
->GetRect();
463 QRect qRect
= qRectInPixels(frameRect
, p2a
);
465 comboOpt
.rect
= qRect
;
467 QRect subRect
= s
->subControlRect(QStyle::CC_ComboBox
, &comboOpt
, QStyle::SC_ComboBoxArrow
, NULL
);
468 QRect subRect2
= s
->subControlRect(QStyle::CC_ComboBox
, &comboOpt
, QStyle::SC_ComboBoxFrame
, NULL
);
470 (*aResult
).width
= subRect
.width() + subRect2
.width();
471 (*aResult
).height
= std::max(subRect
.height(), subRect2
.height());
472 //*aIsOverridable = PR_FALSE;
475 case NS_THEME_TEXTFIELD
:
476 case NS_THEME_TEXTFIELD_MULTILINE
:
483 nsNativeThemeQt::WidgetStateChanged(nsIFrame
* aFrame
, PRUint8 aWidgetType
,
484 nsIAtom
* aAttribute
, PRBool
* aShouldRepaint
)
486 *aShouldRepaint
= TRUE
;
492 nsNativeThemeQt::ThemeChanged()
494 QStyle
*s
= qApp
->style();
496 mFrameWidth
= s
->pixelMetric(QStyle::PM_DefaultFrameWidth
);
501 nsNativeThemeQt::ThemeSupportsWidget(nsPresContext
* aPresContext
,
505 switch (aWidgetType
) {
506 case NS_THEME_SCROLLBAR
:
507 case NS_THEME_SCROLLBAR_BUTTON_UP
:
508 case NS_THEME_SCROLLBAR_BUTTON_DOWN
:
509 case NS_THEME_SCROLLBAR_BUTTON_LEFT
:
510 case NS_THEME_SCROLLBAR_BUTTON_RIGHT
:
511 case NS_THEME_SCROLLBAR_THUMB_HORIZONTAL
:
512 case NS_THEME_SCROLLBAR_THUMB_VERTICAL
:
513 //case NS_THEME_SCROLLBAR_GRIPPER_HORIZONTAL:
514 //case NS_THEME_SCROLLBAR_GRIPPER_VERTICAL:
515 case NS_THEME_SCROLLBAR_TRACK_HORIZONTAL
:
516 case NS_THEME_SCROLLBAR_TRACK_VERTICAL
:
518 case NS_THEME_CHECKBOX
:
519 case NS_THEME_BUTTON_BEVEL
:
520 case NS_THEME_BUTTON
:
521 case NS_THEME_DROPDOWN
:
522 case NS_THEME_DROPDOWN_BUTTON
:
523 case NS_THEME_DROPDOWN_TEXT
:
524 case NS_THEME_DROPDOWN_TEXTFIELD
:
525 case NS_THEME_TEXTFIELD
:
526 case NS_THEME_TEXTFIELD_MULTILINE
:
527 case NS_THEME_LISTBOX
:
528 case NS_THEME_MENUPOPUP
:
529 return !IsWidgetStyled(aPresContext
, aFrame
, aWidgetType
);
537 nsNativeThemeQt::WidgetIsContainer(PRUint8 aWidgetType
)
539 // if (aWidgetType == NS_THEME_DROPDOWN_BUTTON ||
540 // aWidgetType == NS_THEME_RADIO ||
541 // aWidgetType == NS_THEME_CHECKBOX) {
549 nsNativeThemeQt::ThemeDrawsFocusForWidget(nsPresContext
* aPresContext
, nsIFrame
* aFrame
, PRUint8 aWidgetType
)
551 if (aWidgetType
== NS_THEME_DROPDOWN
||
552 aWidgetType
== NS_THEME_BUTTON
||
553 aWidgetType
== NS_THEME_TREEVIEW_HEADER_CELL
) {
561 nsNativeThemeQt::ThemeNeedsComboboxDropmarker()
567 nsNativeThemeQt::GetWidgetTransparency(PRUint8 aWidgetType
)
569 return eTransparencyOpaque
;
573 nsNativeThemeQt::InitButtonStyle(PRUint8 aWidgetType
,
576 QStyleOptionButton
&opt
)
578 PRInt32 eventState
= GetContentState(aFrame
, aWidgetType
);
581 opt
.palette
= mNoBackgroundPalette
;
583 PRBool disabled
= IsDisabled(aFrame
);
586 opt
.state
|= QStyle::State_Enabled
;
587 if (eventState
& NS_EVENT_STATE_HOVER
)
588 opt
.state
|= QStyle::State_MouseOver
;
589 if (eventState
& NS_EVENT_STATE_FOCUS
)
590 opt
.state
|= QStyle::State_HasFocus
;
591 if (!disabled
&& eventState
& NS_EVENT_STATE_ACTIVE
)
592 // Don't allow sunken when disabled
593 opt
.state
|= QStyle::State_Sunken
;
595 switch (aWidgetType
) {
597 case NS_THEME_CHECKBOX
:
598 if (IsChecked(aFrame
))
599 opt
.state
|= QStyle::State_On
;
601 opt
.state
|= QStyle::State_Off
;
605 if (!(eventState
& NS_EVENT_STATE_ACTIVE
))
606 opt
.state
|= QStyle::State_Raised
;
612 nsNativeThemeQt::InitPlainStyle(PRUint8 aWidgetType
,
616 QStyle::State extraFlags
)
618 PRInt32 eventState
= GetContentState(aFrame
, aWidgetType
);
622 if (!IsDisabled(aFrame
))
623 opt
.state
|= QStyle::State_Enabled
;
624 if (eventState
& NS_EVENT_STATE_HOVER
)
625 opt
.state
|= QStyle::State_MouseOver
;
626 if (eventState
& NS_EVENT_STATE_FOCUS
)
627 opt
.state
|= QStyle::State_HasFocus
;
629 opt
.state
|= extraFlags
;
633 nsNativeThemeQt::InitComboStyle(PRUint8 aWidgetType
,
636 QStyleOptionComboBox
&opt
)
638 PRInt32 eventState
= GetContentState(aFrame
, aWidgetType
);
640 PRBool disabled
= IsDisabled(aFrame
);
643 opt
.state
|= QStyle::State_Enabled
;
644 if (eventState
& NS_EVENT_STATE_HOVER
)
645 opt
.state
|= QStyle::State_MouseOver
;
646 if (eventState
& NS_EVENT_STATE_FOCUS
)
647 opt
.state
|= QStyle::State_HasFocus
;
648 if (!(eventState
& NS_EVENT_STATE_ACTIVE
))
649 opt
.state
|= QStyle::State_Raised
;
650 if (!disabled
&& eventState
& NS_EVENT_STATE_ACTIVE
)
651 // Don't allow sunken when disabled
652 opt
.state
|= QStyle::State_Sunken
;
655 opt
.palette
= mNoBackgroundPalette
;