Bug 1273424 - Rename -moz-appearance keyword constants to be more consistent with CSS keywords. r=bholley

This commit is contained in:
Keith Yeung 2016-05-18 10:29:56 -07:00 коммит произвёл Bobby Holley
Родитель 24bac18bf5
Коммит 90a39873d8
9 изменённых файлов: 581 добавлений и 581 удалений

Просмотреть файл

@ -28,13 +28,13 @@
#define NS_THEME_TOOLBAR 12
// A single toolbar button (with no associated dropdown)
#define NS_THEME_TOOLBAR_BUTTON 13
#define NS_THEME_TOOLBARBUTTON 13
// A dual toolbar button (e.g., a Back button with a dropdown)
#define NS_THEME_TOOLBAR_DUAL_BUTTON 14
#define NS_THEME_DUALBUTTON 14
// The dropdown portion of a toolbar button
#define NS_THEME_TOOLBAR_BUTTON_DROPDOWN 15
#define NS_THEME_TOOLBARBUTTON_DROPDOWN 15
// Various arrows that go in buttons
#define NS_THEME_BUTTON_ARROW_UP 16
@ -43,10 +43,10 @@
#define NS_THEME_BUTTON_ARROW_PREVIOUS 19
// A separator. Can be horizontal or vertical.
#define NS_THEME_TOOLBAR_SEPARATOR 20
#define NS_THEME_SEPARATOR 20
// The gripper for a toolbar.
#define NS_THEME_TOOLBAR_GRIPPER 21
#define NS_THEME_TOOLBARGRIPPER 21
// A splitter. Can be horizontal or vertical.
#define NS_THEME_SPLITTER 22
@ -55,11 +55,11 @@
#define NS_THEME_STATUSBAR 23
// A single pane of a status bar.
#define NS_THEME_STATUSBAR_PANEL 24
#define NS_THEME_STATUSBARPANEL 24
// The resizer background area in a status bar
// for the resizer widget in the corner of a window.
#define NS_THEME_STATUSBAR_RESIZER_PANEL 25
#define NS_THEME_RESIZER_PANEL 25
// The resizer itself.
#define NS_THEME_RESIZER 26
@ -68,62 +68,62 @@
#define NS_THEME_LISTBOX 31
// A listbox item
#define NS_THEME_LISTBOX_LISTITEM 32
#define NS_THEME_LISTITEM 32
// A tree widget
#define NS_THEME_TREEVIEW 41
// A tree item
#define NS_THEME_TREEVIEW_TREEITEM 42
#define NS_THEME_TREEITEM 42
// A tree widget twisty
#define NS_THEME_TREEVIEW_TWISTY 43
#define NS_THEME_TREETWISTY 43
// A tree widget branch line
#define NS_THEME_TREEVIEW_LINE 44
#define NS_THEME_TREELINE 44
// A listbox or tree widget header
#define NS_THEME_TREEVIEW_HEADER 45
#define NS_THEME_TREEHEADER 45
// An individual header cell
#define NS_THEME_TREEVIEW_HEADER_CELL 46
#define NS_THEME_TREEHEADERCELL 46
// The sort arrow for a header.
#define NS_THEME_TREEVIEW_HEADER_SORTARROW 47
#define NS_THEME_TREEHEADERSORTARROW 47
// Open tree widget twisty
#define NS_THEME_TREEVIEW_TWISTY_OPEN 48
#define NS_THEME_TREETWISTYOPEN 48
// A horizontal progress bar.
#define NS_THEME_PROGRESSBAR 51
// The progress bar's progress indicator
#define NS_THEME_PROGRESSBAR_CHUNK 52
#define NS_THEME_PROGRESSCHUNK 52
// A vertical progress bar.
#define NS_THEME_PROGRESSBAR_VERTICAL 53
// A vertical progress chunk
#define NS_THEME_PROGRESSBAR_CHUNK_VERTICAL 54
#define NS_THEME_PROGRESSCHUNK_VERTICAL 54
// A horizontal meter bar.
#define NS_THEME_METERBAR 55
// The meter bar's meter indicator
#define NS_THEME_METERBAR_CHUNK 56
#define NS_THEME_METERCHUNK 56
// A single tab in a tab widget.
#define NS_THEME_TAB 61
// A single pane (inside the tabpanels container)
#define NS_THEME_TAB_PANEL 62
#define NS_THEME_TABPANEL 62
// The tab panels container.
#define NS_THEME_TAB_PANELS 65
#define NS_THEME_TABPANELS 65
// The tabs scroll arrows (left/right)
#define NS_THEME_TAB_SCROLLARROW_BACK 66
#define NS_THEME_TAB_SCROLLARROW_FORWARD 67
#define NS_THEME_TAB_SCROLL_ARROW_BACK 66
#define NS_THEME_TAB_SCROLL_ARROW_FORWARD 67
// A tooltip
#define NS_THEME_TOOLTIP 71
@ -132,10 +132,10 @@
#define NS_THEME_SPINNER 72
// The up button of a spin control
#define NS_THEME_SPINNER_UP_BUTTON 73
#define NS_THEME_SPINNER_UPBUTTON 73
// The down button of a spin control
#define NS_THEME_SPINNER_DOWN_BUTTON 74
#define NS_THEME_SPINNER_DOWNBUTTON 74
// The textfield of a spin control
#define NS_THEME_SPINNER_TEXTFIELD 75
@ -154,18 +154,18 @@
#define NS_THEME_SCROLLBAR_VERTICAL 83
// A scrollbar button (up/down/left/right)
#define NS_THEME_SCROLLBAR_BUTTON_UP 84
#define NS_THEME_SCROLLBAR_BUTTON_DOWN 85
#define NS_THEME_SCROLLBAR_BUTTON_LEFT 86
#define NS_THEME_SCROLLBAR_BUTTON_RIGHT 87
#define NS_THEME_SCROLLBARBUTTON_UP 84
#define NS_THEME_SCROLLBARBUTTON_DOWN 85
#define NS_THEME_SCROLLBARBUTTON_LEFT 86
#define NS_THEME_SCROLLBARBUTTON_RIGHT 87
// The scrollbar track
#define NS_THEME_SCROLLBAR_TRACK_HORIZONTAL 88
#define NS_THEME_SCROLLBAR_TRACK_VERTICAL 89
#define NS_THEME_SCROLLBARTRACK_HORIZONTAL 88
#define NS_THEME_SCROLLBARTRACK_VERTICAL 89
// The scrollbar thumb
#define NS_THEME_SCROLLBAR_THUMB_HORIZONTAL 90
#define NS_THEME_SCROLLBAR_THUMB_VERTICAL 91
#define NS_THEME_SCROLLBARTHUMB_HORIZONTAL 90
#define NS_THEME_SCROLLBARTHUMB_VERTICAL 91
// A non-disappearing scrollbar.
#define NS_THEME_SCROLLBAR_NON_DISAPPEARING 92
@ -183,36 +183,36 @@
#define NS_THEME_SEARCHFIELD 98
// A dropdown list.
#define NS_THEME_DROPDOWN 101
#define NS_THEME_MENULIST 101
// The dropdown button(s) that open up a dropdown list.
#define NS_THEME_DROPDOWN_BUTTON 102
#define NS_THEME_MENULIST_BUTTON 102
// The text part of a dropdown list, to left of button
#define NS_THEME_DROPDOWN_TEXT 103
#define NS_THEME_MENULIST_TEXT 103
// An editable textfield with a dropdown list (a combobox)
#define NS_THEME_DROPDOWN_TEXTFIELD 104
#define NS_THEME_MENULIST_TEXTFIELD 104
// A slider
#define NS_THEME_SCALE_HORIZONTAL 111
#define NS_THEME_SCALE_VERTICAL 112
#define NS_THEME_SCALE_HORIZONTAL 111
#define NS_THEME_SCALE_VERTICAL 112
// A slider's thumb
#define NS_THEME_SCALE_THUMB_HORIZONTAL 113
#define NS_THEME_SCALE_THUMB_VERTICAL 114
#define NS_THEME_SCALETHUMB_HORIZONTAL 113
#define NS_THEME_SCALETHUMB_VERTICAL 114
// If the platform supports it, the left/right chunks
// of the slider thumb
#define NS_THEME_SCALE_THUMB_START 115
#define NS_THEME_SCALE_THUMB_END 116
#define NS_THEME_SCALETHUMBSTART 115
#define NS_THEME_SCALETHUMBEND 116
// The ticks for a slider.
#define NS_THEME_SCALE_TICK 117
#define NS_THEME_SCALETHUMBTICK 117
// nsRangeFrame and its subparts
#define NS_THEME_RANGE 120
#define NS_THEME_RANGE_THUMB 121
#define NS_THEME_RANGE 120
#define NS_THEME_RANGE_THUMB 121
// A groupbox
#define NS_THEME_GROUPBOX 149
@ -257,13 +257,13 @@
// Vista Rebars
#define NS_THEME_WIN_COMMUNICATIONS_TOOLBOX 221
#define NS_THEME_WIN_MEDIA_TOOLBOX 222
#define NS_THEME_WIN_BROWSER_TAB_BAR_TOOLBOX 223
#define NS_THEME_WIN_BROWSERTABBAR_TOOLBOX 223
// Titlebar elements on the Mac
#define NS_THEME_MOZ_MAC_FULLSCREEN_BUTTON 226
#define NS_THEME_MAC_FULLSCREEN_BUTTON 226
// Mac help button
#define NS_THEME_MOZ_MAC_HELP_BUTTON 227
#define NS_THEME_MAC_HELP_BUTTON 227
// Vista glass
#define NS_THEME_WIN_BORDERLESS_GLASS 229

Просмотреть файл

@ -281,7 +281,7 @@ nsMeterFrame::ShouldUseNativeStyle() const
!PresContext()->HasAuthorSpecifiedRules(this,
NS_AUTHOR_SPECIFIED_BORDER | NS_AUTHOR_SPECIFIED_BACKGROUND) &&
barFrame &&
barFrame->StyleDisplay()->mAppearance == NS_THEME_METERBAR_CHUNK &&
barFrame->StyleDisplay()->mAppearance == NS_THEME_METERCHUNK &&
!PresContext()->HasAuthorSpecifiedRules(barFrame,
NS_AUTHOR_SPECIFIED_BORDER | NS_AUTHOR_SPECIFIED_BACKGROUND);
}

Просмотреть файл

@ -705,11 +705,11 @@ nsNumberControlFrame::ShouldUseNativeStyleForSpinner() const
nsIFrame* spinDownFrame = mSpinDown->GetPrimaryFrame();
return spinUpFrame &&
spinUpFrame->StyleDisplay()->mAppearance == NS_THEME_SPINNER_UP_BUTTON &&
spinUpFrame->StyleDisplay()->mAppearance == NS_THEME_SPINNER_UPBUTTON &&
!PresContext()->HasAuthorSpecifiedRules(spinUpFrame,
STYLES_DISABLING_NATIVE_THEMING) &&
spinDownFrame &&
spinDownFrame->StyleDisplay()->mAppearance == NS_THEME_SPINNER_DOWN_BUTTON &&
spinDownFrame->StyleDisplay()->mAppearance == NS_THEME_SPINNER_DOWNBUTTON &&
!PresContext()->HasAuthorSpecifiedRules(spinDownFrame,
STYLES_DISABLING_NATIVE_THEMING);
}

Просмотреть файл

@ -289,7 +289,7 @@ nsProgressFrame::ShouldUseNativeStyle() const
!PresContext()->HasAuthorSpecifiedRules(this,
NS_AUTHOR_SPECIFIED_BORDER | NS_AUTHOR_SPECIFIED_BACKGROUND) &&
barFrame &&
barFrame->StyleDisplay()->mAppearance == NS_THEME_PROGRESSBAR_CHUNK &&
barFrame->StyleDisplay()->mAppearance == NS_THEME_PROGRESSCHUNK &&
!PresContext()->HasAuthorSpecifiedRules(barFrame,
NS_AUTHOR_SPECIFIED_BORDER | NS_AUTHOR_SPECIFIED_BACKGROUND);
}

Просмотреть файл

@ -754,76 +754,76 @@ const KTableEntry nsCSSProps::kAppearanceKTable[] = {
{ eCSSKeyword_button_bevel, NS_THEME_BUTTON_BEVEL },
{ eCSSKeyword_toolbox, NS_THEME_TOOLBOX },
{ eCSSKeyword_toolbar, NS_THEME_TOOLBAR },
{ eCSSKeyword_toolbarbutton, NS_THEME_TOOLBAR_BUTTON },
{ eCSSKeyword_toolbargripper, NS_THEME_TOOLBAR_GRIPPER },
{ eCSSKeyword_dualbutton, NS_THEME_TOOLBAR_DUAL_BUTTON },
{ eCSSKeyword_toolbarbutton_dropdown, NS_THEME_TOOLBAR_BUTTON_DROPDOWN },
{ eCSSKeyword_toolbarbutton, NS_THEME_TOOLBARBUTTON },
{ eCSSKeyword_toolbargripper, NS_THEME_TOOLBARGRIPPER },
{ eCSSKeyword_dualbutton, NS_THEME_DUALBUTTON },
{ eCSSKeyword_toolbarbutton_dropdown, NS_THEME_TOOLBARBUTTON_DROPDOWN },
{ eCSSKeyword_button_arrow_up, NS_THEME_BUTTON_ARROW_UP },
{ eCSSKeyword_button_arrow_down, NS_THEME_BUTTON_ARROW_DOWN },
{ eCSSKeyword_button_arrow_next, NS_THEME_BUTTON_ARROW_NEXT },
{ eCSSKeyword_button_arrow_previous, NS_THEME_BUTTON_ARROW_PREVIOUS },
{ eCSSKeyword_meterbar, NS_THEME_METERBAR },
{ eCSSKeyword_meterchunk, NS_THEME_METERBAR_CHUNK },
{ eCSSKeyword_meterchunk, NS_THEME_METERCHUNK },
{ eCSSKeyword_number_input, NS_THEME_NUMBER_INPUT },
{ eCSSKeyword_separator, NS_THEME_TOOLBAR_SEPARATOR },
{ eCSSKeyword_separator, NS_THEME_SEPARATOR },
{ eCSSKeyword_splitter, NS_THEME_SPLITTER },
{ eCSSKeyword_statusbar, NS_THEME_STATUSBAR },
{ eCSSKeyword_statusbarpanel, NS_THEME_STATUSBAR_PANEL },
{ eCSSKeyword_resizerpanel, NS_THEME_STATUSBAR_RESIZER_PANEL },
{ eCSSKeyword_statusbarpanel, NS_THEME_STATUSBARPANEL },
{ eCSSKeyword_resizerpanel, NS_THEME_RESIZER_PANEL },
{ eCSSKeyword_resizer, NS_THEME_RESIZER },
{ eCSSKeyword_listbox, NS_THEME_LISTBOX },
{ eCSSKeyword_listitem, NS_THEME_LISTBOX_LISTITEM },
{ eCSSKeyword_listitem, NS_THEME_LISTITEM },
{ eCSSKeyword_treeview, NS_THEME_TREEVIEW },
{ eCSSKeyword_treeitem, NS_THEME_TREEVIEW_TREEITEM },
{ eCSSKeyword_treetwisty, NS_THEME_TREEVIEW_TWISTY },
{ eCSSKeyword_treetwistyopen, NS_THEME_TREEVIEW_TWISTY_OPEN },
{ eCSSKeyword_treeline, NS_THEME_TREEVIEW_LINE },
{ eCSSKeyword_treeheader, NS_THEME_TREEVIEW_HEADER },
{ eCSSKeyword_treeheadercell, NS_THEME_TREEVIEW_HEADER_CELL },
{ eCSSKeyword_treeheadersortarrow, NS_THEME_TREEVIEW_HEADER_SORTARROW },
{ eCSSKeyword_treeitem, NS_THEME_TREEITEM },
{ eCSSKeyword_treetwisty, NS_THEME_TREETWISTY },
{ eCSSKeyword_treetwistyopen, NS_THEME_TREETWISTYOPEN },
{ eCSSKeyword_treeline, NS_THEME_TREELINE },
{ eCSSKeyword_treeheader, NS_THEME_TREEHEADER },
{ eCSSKeyword_treeheadercell, NS_THEME_TREEHEADERCELL },
{ eCSSKeyword_treeheadersortarrow, NS_THEME_TREEHEADERSORTARROW },
{ eCSSKeyword_progressbar, NS_THEME_PROGRESSBAR },
{ eCSSKeyword_progresschunk, NS_THEME_PROGRESSBAR_CHUNK },
{ eCSSKeyword_progresschunk, NS_THEME_PROGRESSCHUNK },
{ eCSSKeyword_progressbar_vertical, NS_THEME_PROGRESSBAR_VERTICAL },
{ eCSSKeyword_progresschunk_vertical, NS_THEME_PROGRESSBAR_CHUNK_VERTICAL },
{ eCSSKeyword_progresschunk_vertical, NS_THEME_PROGRESSCHUNK_VERTICAL },
{ eCSSKeyword_tab, NS_THEME_TAB },
{ eCSSKeyword_tabpanels, NS_THEME_TAB_PANELS },
{ eCSSKeyword_tabpanel, NS_THEME_TAB_PANEL },
{ eCSSKeyword_tab_scroll_arrow_back, NS_THEME_TAB_SCROLLARROW_BACK },
{ eCSSKeyword_tab_scroll_arrow_forward, NS_THEME_TAB_SCROLLARROW_FORWARD },
{ eCSSKeyword_tabpanels, NS_THEME_TABPANELS },
{ eCSSKeyword_tabpanel, NS_THEME_TABPANEL },
{ eCSSKeyword_tab_scroll_arrow_back, NS_THEME_TAB_SCROLL_ARROW_BACK },
{ eCSSKeyword_tab_scroll_arrow_forward, NS_THEME_TAB_SCROLL_ARROW_FORWARD },
{ eCSSKeyword_tooltip, NS_THEME_TOOLTIP },
{ eCSSKeyword_spinner, NS_THEME_SPINNER },
{ eCSSKeyword_spinner_upbutton, NS_THEME_SPINNER_UP_BUTTON },
{ eCSSKeyword_spinner_downbutton, NS_THEME_SPINNER_DOWN_BUTTON },
{ eCSSKeyword_spinner_upbutton, NS_THEME_SPINNER_UPBUTTON },
{ eCSSKeyword_spinner_downbutton, NS_THEME_SPINNER_DOWNBUTTON },
{ eCSSKeyword_spinner_textfield, NS_THEME_SPINNER_TEXTFIELD },
{ eCSSKeyword_scrollbar, NS_THEME_SCROLLBAR },
{ eCSSKeyword_scrollbar_small, NS_THEME_SCROLLBAR_SMALL },
{ eCSSKeyword_scrollbar_horizontal, NS_THEME_SCROLLBAR_HORIZONTAL },
{ eCSSKeyword_scrollbar_vertical, NS_THEME_SCROLLBAR_VERTICAL },
{ eCSSKeyword_scrollbarbutton_up, NS_THEME_SCROLLBAR_BUTTON_UP },
{ eCSSKeyword_scrollbarbutton_down, NS_THEME_SCROLLBAR_BUTTON_DOWN },
{ eCSSKeyword_scrollbarbutton_left, NS_THEME_SCROLLBAR_BUTTON_LEFT },
{ eCSSKeyword_scrollbarbutton_right, NS_THEME_SCROLLBAR_BUTTON_RIGHT },
{ eCSSKeyword_scrollbartrack_horizontal, NS_THEME_SCROLLBAR_TRACK_HORIZONTAL },
{ eCSSKeyword_scrollbartrack_vertical, NS_THEME_SCROLLBAR_TRACK_VERTICAL },
{ eCSSKeyword_scrollbarthumb_horizontal, NS_THEME_SCROLLBAR_THUMB_HORIZONTAL },
{ eCSSKeyword_scrollbarthumb_vertical, NS_THEME_SCROLLBAR_THUMB_VERTICAL },
{ eCSSKeyword_scrollbarbutton_up, NS_THEME_SCROLLBARBUTTON_UP },
{ eCSSKeyword_scrollbarbutton_down, NS_THEME_SCROLLBARBUTTON_DOWN },
{ eCSSKeyword_scrollbarbutton_left, NS_THEME_SCROLLBARBUTTON_LEFT },
{ eCSSKeyword_scrollbarbutton_right, NS_THEME_SCROLLBARBUTTON_RIGHT },
{ eCSSKeyword_scrollbartrack_horizontal, NS_THEME_SCROLLBARTRACK_HORIZONTAL },
{ eCSSKeyword_scrollbartrack_vertical, NS_THEME_SCROLLBARTRACK_VERTICAL },
{ eCSSKeyword_scrollbarthumb_horizontal, NS_THEME_SCROLLBARTHUMB_HORIZONTAL },
{ eCSSKeyword_scrollbarthumb_vertical, NS_THEME_SCROLLBARTHUMB_VERTICAL },
{ eCSSKeyword_textfield, NS_THEME_TEXTFIELD },
{ eCSSKeyword_textfield_multiline, NS_THEME_TEXTFIELD_MULTILINE },
{ eCSSKeyword_caret, NS_THEME_TEXTFIELD_CARET },
{ eCSSKeyword_searchfield, NS_THEME_SEARCHFIELD },
{ eCSSKeyword_menulist, NS_THEME_DROPDOWN },
{ eCSSKeyword_menulist_button, NS_THEME_DROPDOWN_BUTTON },
{ eCSSKeyword_menulist_text, NS_THEME_DROPDOWN_TEXT },
{ eCSSKeyword_menulist_textfield, NS_THEME_DROPDOWN_TEXTFIELD },
{ eCSSKeyword_menulist, NS_THEME_MENULIST },
{ eCSSKeyword_menulist_button, NS_THEME_MENULIST_BUTTON },
{ eCSSKeyword_menulist_text, NS_THEME_MENULIST_TEXT },
{ eCSSKeyword_menulist_textfield, NS_THEME_MENULIST_TEXTFIELD },
{ eCSSKeyword_range, NS_THEME_RANGE },
{ eCSSKeyword_range_thumb, NS_THEME_RANGE_THUMB },
{ eCSSKeyword_scale_horizontal, NS_THEME_SCALE_HORIZONTAL },
{ eCSSKeyword_scale_vertical, NS_THEME_SCALE_VERTICAL },
{ eCSSKeyword_scalethumb_horizontal, NS_THEME_SCALE_THUMB_HORIZONTAL },
{ eCSSKeyword_scalethumb_vertical, NS_THEME_SCALE_THUMB_VERTICAL },
{ eCSSKeyword_scalethumbstart, NS_THEME_SCALE_THUMB_START },
{ eCSSKeyword_scalethumbend, NS_THEME_SCALE_THUMB_END },
{ eCSSKeyword_scalethumbtick, NS_THEME_SCALE_TICK },
{ eCSSKeyword_scalethumb_horizontal, NS_THEME_SCALETHUMB_HORIZONTAL },
{ eCSSKeyword_scalethumb_vertical, NS_THEME_SCALETHUMB_VERTICAL },
{ eCSSKeyword_scalethumbstart, NS_THEME_SCALETHUMBSTART },
{ eCSSKeyword_scalethumbend, NS_THEME_SCALETHUMBEND },
{ eCSSKeyword_scalethumbtick, NS_THEME_SCALETHUMBTICK },
{ eCSSKeyword_groupbox, NS_THEME_GROUPBOX },
{ eCSSKeyword_checkbox_container, NS_THEME_CHECKBOX_CONTAINER },
{ eCSSKeyword_radio_container, NS_THEME_RADIO_CONTAINER },
@ -845,11 +845,11 @@ const KTableEntry nsCSSProps::kAppearanceKTable[] = {
{ eCSSKeyword_menuitemtext, NS_THEME_MENUITEMTEXT },
{ eCSSKeyword__moz_win_media_toolbox, NS_THEME_WIN_MEDIA_TOOLBOX },
{ eCSSKeyword__moz_win_communications_toolbox, NS_THEME_WIN_COMMUNICATIONS_TOOLBOX },
{ eCSSKeyword__moz_win_browsertabbar_toolbox, NS_THEME_WIN_BROWSER_TAB_BAR_TOOLBOX },
{ eCSSKeyword__moz_win_browsertabbar_toolbox, NS_THEME_WIN_BROWSERTABBAR_TOOLBOX },
{ eCSSKeyword__moz_win_glass, NS_THEME_WIN_GLASS },
{ eCSSKeyword__moz_win_borderless_glass, NS_THEME_WIN_BORDERLESS_GLASS },
{ eCSSKeyword__moz_mac_fullscreen_button, NS_THEME_MOZ_MAC_FULLSCREEN_BUTTON },
{ eCSSKeyword__moz_mac_help_button, NS_THEME_MOZ_MAC_HELP_BUTTON },
{ eCSSKeyword__moz_mac_fullscreen_button, NS_THEME_MAC_FULLSCREEN_BUTTON },
{ eCSSKeyword__moz_mac_help_button, NS_THEME_MAC_HELP_BUTTON },
{ eCSSKeyword__moz_window_titlebar, NS_THEME_WINDOW_TITLEBAR },
{ eCSSKeyword__moz_window_titlebar_maximized, NS_THEME_WINDOW_TITLEBAR_MAXIMIZED },
{ eCSSKeyword__moz_window_frame_left, NS_THEME_WINDOW_FRAME_LEFT },

Просмотреть файл

@ -1226,7 +1226,7 @@ nsNativeThemeCocoa::DrawPushButton(CGContextRef cgContext, const HIRect& inBoxRe
BOOL isDisabled = IsDisabled(aFrame, inState);
NSButtonCell* cell = (aWidgetType == NS_THEME_BUTTON) ? mPushButtonCell :
(aWidgetType == NS_THEME_MOZ_MAC_HELP_BUTTON) ? mHelpButtonCell : mDisclosureButtonCell;
(aWidgetType == NS_THEME_MAC_HELP_BUTTON) ? mHelpButtonCell : mDisclosureButtonCell;
[cell setEnabled:!isDisabled];
[cell setHighlighted:isActive &&
inState.HasAllStates(NS_EVENT_STATE_ACTIVE | NS_EVENT_STATE_HOVER)];
@ -1234,7 +1234,7 @@ nsNativeThemeCocoa::DrawPushButton(CGContextRef cgContext, const HIRect& inBoxRe
if (aWidgetType != NS_THEME_BUTTON) { // Help button or disclosure button.
NSSize buttonSize = NSMakeSize(0, 0);
if (aWidgetType == NS_THEME_MOZ_MAC_HELP_BUTTON) {
if (aWidgetType == NS_THEME_MAC_HELP_BUTTON) {
buttonSize = kHelpButtonSize;
} else { // Disclosure button.
buttonSize = kDisclosureButtonSize;
@ -1517,7 +1517,7 @@ nsNativeThemeCocoa::DrawDropdown(CGContextRef cgContext, const HIRect& inBoxRect
[mDropdownCell setPullsDown:(aWidgetType == NS_THEME_BUTTON)];
BOOL isEditable = (aWidgetType == NS_THEME_DROPDOWN_TEXTFIELD);
BOOL isEditable = (aWidgetType == NS_THEME_MENULIST_TEXTFIELD);
NSCell* cell = isEditable ? (NSCell*)mComboBoxCell : (NSCell*)mDropdownCell;
[cell setEnabled:!IsDisabled(aFrame, inState)];
@ -1593,8 +1593,8 @@ nsNativeThemeCocoa::DrawSpinButton(CGContextRef cgContext,
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
MOZ_ASSERT(aWidgetType == NS_THEME_SPINNER_UP_BUTTON ||
aWidgetType == NS_THEME_SPINNER_DOWN_BUTTON);
MOZ_ASSERT(aWidgetType == NS_THEME_SPINNER_UPBUTTON ||
aWidgetType == NS_THEME_SPINNER_DOWNBUTTON);
HIThemeButtonDrawInfo bdi;
bdi.version = 0;
@ -1613,7 +1613,7 @@ nsNativeThemeCocoa::DrawSpinButton(CGContextRef cgContext,
// both buttons, using clip to hide the one we don't want to paint.
HIRect drawRect = inBoxRect;
drawRect.size.height *= 2;
if (aWidgetType == NS_THEME_SPINNER_DOWN_BUTTON) {
if (aWidgetType == NS_THEME_SPINNER_DOWNBUTTON) {
drawRect.origin.y -= inBoxRect.size.height;
}
@ -2619,7 +2619,7 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsRenderingContext* aContext,
DrawFocusOutline(cgContext, macRect, eventState, aWidgetType, aFrame);
break;
case NS_THEME_MOZ_MAC_HELP_BUTTON:
case NS_THEME_MAC_HELP_BUTTON:
case NS_THEME_MAC_DISCLOSURE_BUTTON_OPEN:
case NS_THEME_MAC_DISCLOSURE_BUTTON_CLOSED:
DrawPushButton(cgContext, macRect, eventState, aWidgetType, aFrame);
@ -2654,8 +2654,8 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsRenderingContext* aContext,
}
break;
case NS_THEME_SPINNER_UP_BUTTON:
case NS_THEME_SPINNER_DOWN_BUTTON: {
case NS_THEME_SPINNER_UPBUTTON:
case NS_THEME_SPINNER_DOWNBUTTON: {
nsNumberControlFrame* numberControlFrame =
nsNumberControlFrame::GetNumberControlFrameForSpinButton(aFrame);
if (numberControlFrame) {
@ -2671,11 +2671,11 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsRenderingContext* aContext,
}
break;
case NS_THEME_TOOLBAR_BUTTON:
case NS_THEME_TOOLBARBUTTON:
DrawSegment(cgContext, macRect, eventState, aFrame, toolbarButtonRenderSettings);
break;
case NS_THEME_TOOLBAR_SEPARATOR: {
case NS_THEME_SEPARATOR: {
HIThemeSeparatorDrawInfo sdi = { 0, kThemeStateActive };
HIThemeDrawSeparator(&macRect, &sdi, cgContext, HITHEME_ORIENTATION);
}
@ -2719,12 +2719,12 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsRenderingContext* aContext,
DrawStatusBar(cgContext, macRect, aFrame);
break;
case NS_THEME_DROPDOWN:
case NS_THEME_DROPDOWN_TEXTFIELD:
case NS_THEME_MENULIST:
case NS_THEME_MENULIST_TEXTFIELD:
DrawDropdown(cgContext, macRect, eventState, aWidgetType, aFrame);
break;
case NS_THEME_DROPDOWN_BUTTON:
case NS_THEME_MENULIST_BUTTON:
DrawButton(cgContext, kThemeArrowButton, macRect, false, kThemeButtonOn,
kThemeAdornmentArrowDownArrow, eventState, aFrame);
break;
@ -2784,23 +2784,23 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsRenderingContext* aContext,
DrawMeter(cgContext, macRect, aFrame);
break;
case NS_THEME_PROGRESSBAR_CHUNK:
case NS_THEME_PROGRESSBAR_CHUNK_VERTICAL:
case NS_THEME_METERBAR_CHUNK:
case NS_THEME_PROGRESSCHUNK:
case NS_THEME_PROGRESSCHUNK_VERTICAL:
case NS_THEME_METERCHUNK:
// Do nothing: progress and meter bars cases will draw chunks.
break;
case NS_THEME_TREEVIEW_TWISTY:
case NS_THEME_TREETWISTY:
DrawButton(cgContext, kThemeDisclosureButton, macRect, false,
kThemeDisclosureRight, kThemeAdornmentNone, eventState, aFrame);
break;
case NS_THEME_TREEVIEW_TWISTY_OPEN:
case NS_THEME_TREETWISTYOPEN:
DrawButton(cgContext, kThemeDisclosureButton, macRect, false,
kThemeDisclosureDown, kThemeAdornmentNone, eventState, aFrame);
break;
case NS_THEME_TREEVIEW_HEADER_CELL: {
case NS_THEME_TREEHEADERCELL: {
TreeSortDirection sortDirection = GetTreeSortDirection(aFrame);
DrawButton(cgContext, kThemeListHeaderButton, macRect, false,
sortDirection == eTreeSortDirection_Natural ? kThemeButtonOff : kThemeButtonOn,
@ -2809,7 +2809,7 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsRenderingContext* aContext,
}
break;
case NS_THEME_TREEVIEW_TREEITEM:
case NS_THEME_TREEITEM:
case NS_THEME_TREEVIEW:
// HIThemeSetFill is not available on 10.3
// HIThemeSetFill(kThemeBrushWhite, NULL, cgContext, HITHEME_ORIENTATION);
@ -2817,11 +2817,11 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsRenderingContext* aContext,
CGContextFillRect(cgContext, macRect);
break;
case NS_THEME_TREEVIEW_HEADER:
case NS_THEME_TREEHEADER:
// do nothing, taken care of by individual header cells
case NS_THEME_TREEVIEW_HEADER_SORTARROW:
case NS_THEME_TREEHEADERSORTARROW:
// do nothing, taken care of by treeview header
case NS_THEME_TREEVIEW_LINE:
case NS_THEME_TREELINE:
// do nothing, these lines don't exist on macos
break;
@ -2842,8 +2842,8 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsRenderingContext* aContext,
}
break;
case NS_THEME_SCALE_THUMB_HORIZONTAL:
case NS_THEME_SCALE_THUMB_VERTICAL:
case NS_THEME_SCALETHUMB_HORIZONTAL:
case NS_THEME_SCALETHUMB_VERTICAL:
// do nothing, drawn by scale
break;
@ -2870,11 +2870,11 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsRenderingContext* aContext,
DrawScrollbar(cgContext, macRect, aFrame);
}
break;
case NS_THEME_SCROLLBAR_THUMB_VERTICAL:
case NS_THEME_SCROLLBAR_THUMB_HORIZONTAL:
case NS_THEME_SCROLLBARTHUMB_VERTICAL:
case NS_THEME_SCROLLBARTHUMB_HORIZONTAL:
if (ScrollbarTrackAndThumbDrawSeparately()) {
BOOL isOverlay = nsLookAndFeel::UseOverlayScrollbars();
BOOL isHorizontal = (aWidgetType == NS_THEME_SCROLLBAR_THUMB_HORIZONTAL);
BOOL isHorizontal = (aWidgetType == NS_THEME_SCROLLBARTHUMB_HORIZONTAL);
BOOL isRolledOver = IsParentScrollbarRolledOver(aFrame);
nsIFrame* scrollbarFrame = GetParentScrollbarFrame(aFrame);
bool isSmall = (scrollbarFrame && scrollbarFrame->StyleDisplay()->mAppearance == NS_THEME_SCROLLBAR_SMALL);
@ -2907,26 +2907,26 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsRenderingContext* aContext,
true);
}
break;
case NS_THEME_SCROLLBAR_BUTTON_UP:
case NS_THEME_SCROLLBAR_BUTTON_LEFT:
case NS_THEME_SCROLLBARBUTTON_UP:
case NS_THEME_SCROLLBARBUTTON_LEFT:
#if SCROLLBARS_VISUAL_DEBUG
CGContextSetRGBFillColor(cgContext, 1.0, 0, 0, 0.6);
CGContextFillRect(cgContext, macRect);
#endif
break;
case NS_THEME_SCROLLBAR_BUTTON_DOWN:
case NS_THEME_SCROLLBAR_BUTTON_RIGHT:
case NS_THEME_SCROLLBARBUTTON_DOWN:
case NS_THEME_SCROLLBARBUTTON_RIGHT:
#if SCROLLBARS_VISUAL_DEBUG
CGContextSetRGBFillColor(cgContext, 0, 1.0, 0, 0.6);
CGContextFillRect(cgContext, macRect);
#endif
break;
case NS_THEME_SCROLLBAR_TRACK_HORIZONTAL:
case NS_THEME_SCROLLBAR_TRACK_VERTICAL:
case NS_THEME_SCROLLBARTRACK_HORIZONTAL:
case NS_THEME_SCROLLBARTRACK_VERTICAL:
if (ScrollbarTrackAndThumbDrawSeparately()) {
BOOL isOverlay = nsLookAndFeel::UseOverlayScrollbars();
if (!isOverlay || IsParentScrollbarRolledOver(aFrame)) {
BOOL isHorizontal = (aWidgetType == NS_THEME_SCROLLBAR_TRACK_HORIZONTAL);
BOOL isHorizontal = (aWidgetType == NS_THEME_SCROLLBARTRACK_HORIZONTAL);
nsIFrame* scrollbarFrame = GetParentScrollbarFrame(aFrame);
bool isSmall = (scrollbarFrame && scrollbarFrame->StyleDisplay()->mAppearance == NS_THEME_SCROLLBAR_SMALL);
if (isOverlay && !nsCocoaFeatures::OnMountainLionOrLater()) {
@ -3036,7 +3036,7 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsRenderingContext* aContext,
DrawSegment(cgContext, macRect, eventState, aFrame, tabRenderSettings);
break;
case NS_THEME_TAB_PANELS:
case NS_THEME_TABPANELS:
DrawTabPanel(cgContext, macRect, aFrame);
break;
@ -3102,7 +3102,7 @@ nsNativeThemeCocoa::GetWidgetBorder(nsDeviceContext* aContext,
break;
}
case NS_THEME_TOOLBAR_BUTTON:
case NS_THEME_TOOLBARBUTTON:
{
*aResult = DirectionAwareMargin(nsIntMargin(1, 4, 1, 4), aFrame);
break;
@ -3117,12 +3117,12 @@ nsNativeThemeCocoa::GetWidgetBorder(nsDeviceContext* aContext,
break;
}
case NS_THEME_DROPDOWN:
case NS_THEME_DROPDOWN_BUTTON:
case NS_THEME_MENULIST:
case NS_THEME_MENULIST_BUTTON:
*aResult = DirectionAwareMargin(kAquaDropdownBorder, aFrame);
break;
case NS_THEME_DROPDOWN_TEXTFIELD:
case NS_THEME_MENULIST_TEXTFIELD:
*aResult = DirectionAwareMargin(kAquaComboboxBorder, aFrame);
break;
@ -3157,10 +3157,10 @@ nsNativeThemeCocoa::GetWidgetBorder(nsDeviceContext* aContext,
break;
}
case NS_THEME_SCROLLBAR_TRACK_HORIZONTAL:
case NS_THEME_SCROLLBAR_TRACK_VERTICAL:
case NS_THEME_SCROLLBARTRACK_HORIZONTAL:
case NS_THEME_SCROLLBARTRACK_VERTICAL:
{
bool isHorizontal = (aWidgetType == NS_THEME_SCROLLBAR_TRACK_HORIZONTAL);
bool isHorizontal = (aWidgetType == NS_THEME_SCROLLBARTRACK_HORIZONTAL);
// On Lion and later, scrollbars have no arrows.
if (!nsCocoaFeatures::OnLionOrLater()) {
@ -3240,16 +3240,16 @@ nsNativeThemeCocoa::GetWidgetOverflow(nsDeviceContext* aContext, nsIFrame* aFram
case NS_THEME_BUTTON:
case NS_THEME_MAC_DISCLOSURE_BUTTON_OPEN:
case NS_THEME_MAC_DISCLOSURE_BUTTON_CLOSED:
case NS_THEME_MOZ_MAC_HELP_BUTTON:
case NS_THEME_TOOLBAR_BUTTON:
case NS_THEME_MAC_HELP_BUTTON:
case NS_THEME_TOOLBARBUTTON:
case NS_THEME_NUMBER_INPUT:
case NS_THEME_TEXTFIELD:
case NS_THEME_TEXTFIELD_MULTILINE:
case NS_THEME_SEARCHFIELD:
case NS_THEME_LISTBOX:
case NS_THEME_DROPDOWN:
case NS_THEME_DROPDOWN_BUTTON:
case NS_THEME_DROPDOWN_TEXTFIELD:
case NS_THEME_MENULIST:
case NS_THEME_MENULIST_BUTTON:
case NS_THEME_MENULIST_TEXTFIELD:
case NS_THEME_CHECKBOX:
case NS_THEME_RADIO:
case NS_THEME_TAB:
@ -3330,22 +3330,22 @@ nsNativeThemeCocoa::GetMinimumWidgetSize(nsPresContext* aPresContext,
break;
}
case NS_THEME_MOZ_MAC_HELP_BUTTON:
case NS_THEME_MAC_HELP_BUTTON:
{
aResult->SizeTo(kHelpButtonSize.width, kHelpButtonSize.height);
*aIsOverridable = false;
break;
}
case NS_THEME_TOOLBAR_BUTTON:
case NS_THEME_TOOLBARBUTTON:
{
aResult->SizeTo(0, toolbarButtonHeights[miniControlSize]);
break;
}
case NS_THEME_SPINNER:
case NS_THEME_SPINNER_UP_BUTTON:
case NS_THEME_SPINNER_DOWN_BUTTON:
case NS_THEME_SPINNER_UPBUTTON:
case NS_THEME_SPINNER_DOWNBUTTON:
{
SInt32 buttonHeight = 0, buttonWidth = 0;
if (aFrame->GetContent()->IsXULElement()) {
@ -3366,8 +3366,8 @@ nsNativeThemeCocoa::GetMinimumWidgetSize(nsPresContext* aPresContext,
break;
}
case NS_THEME_DROPDOWN:
case NS_THEME_DROPDOWN_BUTTON:
case NS_THEME_MENULIST:
case NS_THEME_MENULIST_BUTTON:
{
SInt32 popupHeight = 0;
::GetThemeMetric(kThemeMetricPopupButtonHeight, &popupHeight);
@ -3394,7 +3394,7 @@ nsNativeThemeCocoa::GetMinimumWidgetSize(nsPresContext* aPresContext,
break;
}
case NS_THEME_MOZ_MAC_FULLSCREEN_BUTTON: {
case NS_THEME_MAC_FULLSCREEN_BUTTON: {
if ([NativeWindowForFrame(aFrame) respondsToSelector:@selector(toggleFullScreen:)] &&
!nsCocoaFeatures::OnYosemiteOrLater()) {
// This value is hardcoded because it's needed before we can measure the
@ -3413,8 +3413,8 @@ nsNativeThemeCocoa::GetMinimumWidgetSize(nsPresContext* aPresContext,
break;
}
case NS_THEME_TREEVIEW_TWISTY:
case NS_THEME_TREEVIEW_TWISTY_OPEN:
case NS_THEME_TREETWISTY:
case NS_THEME_TREETWISTYOPEN:
{
SInt32 twistyHeight = 0, twistyWidth = 0;
::GetThemeMetric(kThemeMetricDisclosureButtonWidth, &twistyWidth);
@ -3424,8 +3424,8 @@ nsNativeThemeCocoa::GetMinimumWidgetSize(nsPresContext* aPresContext,
break;
}
case NS_THEME_TREEVIEW_HEADER:
case NS_THEME_TREEVIEW_HEADER_CELL:
case NS_THEME_TREEHEADER:
case NS_THEME_TREEHEADERCELL:
{
SInt32 headerHeight = 0;
::GetThemeMetric(kThemeMetricListHeaderHeight, &headerHeight);
@ -3486,8 +3486,8 @@ nsNativeThemeCocoa::GetMinimumWidgetSize(nsPresContext* aPresContext,
break;
}
case NS_THEME_SCROLLBAR_THUMB_HORIZONTAL:
case NS_THEME_SCROLLBAR_THUMB_VERTICAL:
case NS_THEME_SCROLLBARTHUMB_HORIZONTAL:
case NS_THEME_SCROLLBARTHUMB_VERTICAL:
{
// Find our parent scrollbar frame in order to find out whether we're in
// a small or a large scrollbar.
@ -3496,7 +3496,7 @@ nsNativeThemeCocoa::GetMinimumWidgetSize(nsPresContext* aPresContext,
return NS_ERROR_FAILURE;
bool isSmall = (scrollbarFrame->StyleDisplay()->mAppearance == NS_THEME_SCROLLBAR_SMALL);
bool isHorizontal = (aWidgetType == NS_THEME_SCROLLBAR_THUMB_HORIZONTAL);
bool isHorizontal = (aWidgetType == NS_THEME_SCROLLBARTHUMB_HORIZONTAL);
int32_t& minSize = isHorizontal ? aResult->width : aResult->height;
minSize = isSmall ? kSmallScrollbarThumbMinSize : kRegularScrollbarThumbMinSize;
break;
@ -3504,8 +3504,8 @@ nsNativeThemeCocoa::GetMinimumWidgetSize(nsPresContext* aPresContext,
case NS_THEME_SCROLLBAR:
case NS_THEME_SCROLLBAR_SMALL:
case NS_THEME_SCROLLBAR_TRACK_VERTICAL:
case NS_THEME_SCROLLBAR_TRACK_HORIZONTAL:
case NS_THEME_SCROLLBARTRACK_VERTICAL:
case NS_THEME_SCROLLBARTRACK_HORIZONTAL:
{
*aIsOverridable = false;
@ -3562,15 +3562,15 @@ nsNativeThemeCocoa::GetMinimumWidgetSize(nsPresContext* aPresContext,
break;
}
case NS_THEME_SCROLLBAR_BUTTON_UP:
case NS_THEME_SCROLLBAR_BUTTON_DOWN:
case NS_THEME_SCROLLBAR_BUTTON_LEFT:
case NS_THEME_SCROLLBAR_BUTTON_RIGHT:
case NS_THEME_SCROLLBARBUTTON_UP:
case NS_THEME_SCROLLBARBUTTON_DOWN:
case NS_THEME_SCROLLBARBUTTON_LEFT:
case NS_THEME_SCROLLBARBUTTON_RIGHT:
{
nsIFrame *scrollbarFrame = GetParentScrollbarFrame(aFrame);
if (!scrollbarFrame) return NS_ERROR_FAILURE;
// Since there is no NS_THEME_SCROLLBAR_BUTTON_UP_SMALL we need to ask the parent what appearance style it has.
// Since there is no NS_THEME_SCROLLBARBUTTON_UP_SMALL we need to ask the parent what appearance style it has.
int32_t themeMetric = (scrollbarFrame->StyleDisplay()->mAppearance == NS_THEME_SCROLLBAR_SMALL) ?
kThemeMetricSmallScrollBarWidth :
kThemeMetricScrollBarWidth;
@ -3578,7 +3578,7 @@ nsNativeThemeCocoa::GetMinimumWidgetSize(nsPresContext* aPresContext,
::GetThemeMetric(themeMetric, &scrollbarWidth);
// It seems that for both sizes of scrollbar, the buttons are one pixel "longer".
if (aWidgetType == NS_THEME_SCROLLBAR_BUTTON_LEFT || aWidgetType == NS_THEME_SCROLLBAR_BUTTON_RIGHT)
if (aWidgetType == NS_THEME_SCROLLBARBUTTON_LEFT || aWidgetType == NS_THEME_SCROLLBARBUTTON_RIGHT)
aResult->SizeTo(scrollbarWidth+1, scrollbarWidth);
else
aResult->SizeTo(scrollbarWidth, scrollbarWidth+1);
@ -3622,20 +3622,20 @@ nsNativeThemeCocoa::WidgetStateChanged(nsIFrame* aFrame, uint8_t aWidgetType,
case NS_THEME_TOOLBOX:
case NS_THEME_TOOLBAR:
case NS_THEME_STATUSBAR:
case NS_THEME_STATUSBAR_PANEL:
case NS_THEME_STATUSBAR_RESIZER_PANEL:
case NS_THEME_STATUSBARPANEL:
case NS_THEME_RESIZER_PANEL:
case NS_THEME_TOOLTIP:
case NS_THEME_TAB_PANELS:
case NS_THEME_TAB_PANEL:
case NS_THEME_TABPANELS:
case NS_THEME_TABPANEL:
case NS_THEME_DIALOG:
case NS_THEME_MENUPOPUP:
case NS_THEME_GROUPBOX:
case NS_THEME_PROGRESSBAR_CHUNK:
case NS_THEME_PROGRESSBAR_CHUNK_VERTICAL:
case NS_THEME_PROGRESSCHUNK:
case NS_THEME_PROGRESSCHUNK_VERTICAL:
case NS_THEME_PROGRESSBAR:
case NS_THEME_PROGRESSBAR_VERTICAL:
case NS_THEME_METERBAR:
case NS_THEME_METERBAR_CHUNK:
case NS_THEME_METERCHUNK:
case NS_THEME_MAC_VIBRANCY_LIGHT:
case NS_THEME_MAC_VIBRANCY_DARK:
*aShouldRepaint = false;
@ -3699,7 +3699,7 @@ nsNativeThemeCocoa::ThemeSupportsWidget(nsPresContext* aPresContext, nsIFrame* a
return false;
// if this is a dropdown button in a combobox the answer is always no
if (aWidgetType == NS_THEME_DROPDOWN_BUTTON) {
if (aWidgetType == NS_THEME_MENULIST_BUTTON) {
nsIFrame* parentFrame = aFrame->GetParent();
if (parentFrame && (parentFrame->GetType() == nsGkAtoms::comboboxControlFrame))
return false;
@ -3707,10 +3707,10 @@ nsNativeThemeCocoa::ThemeSupportsWidget(nsPresContext* aPresContext, nsIFrame* a
switch (aWidgetType) {
// Combobox dropdowns don't support native theming in vertical mode.
case NS_THEME_DROPDOWN:
case NS_THEME_DROPDOWN_BUTTON:
case NS_THEME_DROPDOWN_TEXT:
case NS_THEME_DROPDOWN_TEXTFIELD:
case NS_THEME_MENULIST:
case NS_THEME_MENULIST_BUTTON:
case NS_THEME_MENULIST_TEXT:
case NS_THEME_MENULIST_TEXTFIELD:
if (aFrame && aFrame->GetWritingMode().IsVertical()) {
return false;
}
@ -3727,7 +3727,7 @@ nsNativeThemeCocoa::ThemeSupportsWidget(nsPresContext* aPresContext, nsIFrame* a
case NS_THEME_MENUARROW:
case NS_THEME_MENUITEM:
case NS_THEME_MENUSEPARATOR:
case NS_THEME_MOZ_MAC_FULLSCREEN_BUTTON:
case NS_THEME_MAC_FULLSCREEN_BUTTON:
case NS_THEME_TOOLTIP:
case NS_THEME_CHECKBOX:
@ -3735,17 +3735,17 @@ nsNativeThemeCocoa::ThemeSupportsWidget(nsPresContext* aPresContext, nsIFrame* a
case NS_THEME_RADIO:
case NS_THEME_RADIO_CONTAINER:
case NS_THEME_GROUPBOX:
case NS_THEME_MOZ_MAC_HELP_BUTTON:
case NS_THEME_MAC_HELP_BUTTON:
case NS_THEME_MAC_DISCLOSURE_BUTTON_OPEN:
case NS_THEME_MAC_DISCLOSURE_BUTTON_CLOSED:
case NS_THEME_BUTTON:
case NS_THEME_BUTTON_ARROW_UP:
case NS_THEME_BUTTON_ARROW_DOWN:
case NS_THEME_BUTTON_BEVEL:
case NS_THEME_TOOLBAR_BUTTON:
case NS_THEME_TOOLBARBUTTON:
case NS_THEME_SPINNER:
case NS_THEME_SPINNER_UP_BUTTON:
case NS_THEME_SPINNER_DOWN_BUTTON:
case NS_THEME_SPINNER_UPBUTTON:
case NS_THEME_SPINNER_DOWNBUTTON:
case NS_THEME_TOOLBAR:
case NS_THEME_STATUSBAR:
case NS_THEME_NUMBER_INPUT:
@ -3753,45 +3753,45 @@ nsNativeThemeCocoa::ThemeSupportsWidget(nsPresContext* aPresContext, nsIFrame* a
case NS_THEME_TEXTFIELD_MULTILINE:
case NS_THEME_SEARCHFIELD:
case NS_THEME_TOOLBOX:
//case NS_THEME_TOOLBAR_BUTTON:
//case NS_THEME_TOOLBARBUTTON:
case NS_THEME_PROGRESSBAR:
case NS_THEME_PROGRESSBAR_VERTICAL:
case NS_THEME_PROGRESSBAR_CHUNK:
case NS_THEME_PROGRESSBAR_CHUNK_VERTICAL:
case NS_THEME_PROGRESSCHUNK:
case NS_THEME_PROGRESSCHUNK_VERTICAL:
case NS_THEME_METERBAR:
case NS_THEME_METERBAR_CHUNK:
case NS_THEME_TOOLBAR_SEPARATOR:
case NS_THEME_METERCHUNK:
case NS_THEME_SEPARATOR:
case NS_THEME_TAB_PANELS:
case NS_THEME_TABPANELS:
case NS_THEME_TAB:
case NS_THEME_TREEVIEW_TWISTY:
case NS_THEME_TREEVIEW_TWISTY_OPEN:
case NS_THEME_TREETWISTY:
case NS_THEME_TREETWISTYOPEN:
case NS_THEME_TREEVIEW:
case NS_THEME_TREEVIEW_HEADER:
case NS_THEME_TREEVIEW_HEADER_CELL:
case NS_THEME_TREEVIEW_HEADER_SORTARROW:
case NS_THEME_TREEVIEW_TREEITEM:
case NS_THEME_TREEVIEW_LINE:
case NS_THEME_TREEHEADER:
case NS_THEME_TREEHEADERCELL:
case NS_THEME_TREEHEADERSORTARROW:
case NS_THEME_TREEITEM:
case NS_THEME_TREELINE:
case NS_THEME_MAC_SOURCE_LIST:
case NS_THEME_RANGE:
case NS_THEME_SCALE_HORIZONTAL:
case NS_THEME_SCALE_THUMB_HORIZONTAL:
case NS_THEME_SCALETHUMB_HORIZONTAL:
case NS_THEME_SCALE_VERTICAL:
case NS_THEME_SCALE_THUMB_VERTICAL:
case NS_THEME_SCALETHUMB_VERTICAL:
case NS_THEME_SCROLLBAR:
case NS_THEME_SCROLLBAR_SMALL:
case NS_THEME_SCROLLBAR_BUTTON_UP:
case NS_THEME_SCROLLBAR_BUTTON_DOWN:
case NS_THEME_SCROLLBAR_BUTTON_LEFT:
case NS_THEME_SCROLLBAR_BUTTON_RIGHT:
case NS_THEME_SCROLLBAR_THUMB_HORIZONTAL:
case NS_THEME_SCROLLBAR_THUMB_VERTICAL:
case NS_THEME_SCROLLBAR_TRACK_VERTICAL:
case NS_THEME_SCROLLBAR_TRACK_HORIZONTAL:
case NS_THEME_SCROLLBARBUTTON_UP:
case NS_THEME_SCROLLBARBUTTON_DOWN:
case NS_THEME_SCROLLBARBUTTON_LEFT:
case NS_THEME_SCROLLBARBUTTON_RIGHT:
case NS_THEME_SCROLLBARTHUMB_HORIZONTAL:
case NS_THEME_SCROLLBARTHUMB_VERTICAL:
case NS_THEME_SCROLLBARTRACK_VERTICAL:
case NS_THEME_SCROLLBARTRACK_HORIZONTAL:
case NS_THEME_SCROLLBAR_NON_DISAPPEARING:
return !IsWidgetStyled(aPresContext, aFrame, aWidgetType);
@ -3827,13 +3827,13 @@ nsNativeThemeCocoa::WidgetIsContainer(uint8_t aWidgetType)
{
// flesh this out at some point
switch (aWidgetType) {
case NS_THEME_DROPDOWN_BUTTON:
case NS_THEME_MENULIST_BUTTON:
case NS_THEME_RADIO:
case NS_THEME_CHECKBOX:
case NS_THEME_PROGRESSBAR:
case NS_THEME_METERBAR:
case NS_THEME_RANGE:
case NS_THEME_MOZ_MAC_HELP_BUTTON:
case NS_THEME_MAC_HELP_BUTTON:
case NS_THEME_MAC_DISCLOSURE_BUTTON_OPEN:
case NS_THEME_MAC_DISCLOSURE_BUTTON_CLOSED:
return false;
@ -3844,10 +3844,10 @@ nsNativeThemeCocoa::WidgetIsContainer(uint8_t aWidgetType)
bool
nsNativeThemeCocoa::ThemeDrawsFocusForWidget(uint8_t aWidgetType)
{
if (aWidgetType == NS_THEME_DROPDOWN ||
aWidgetType == NS_THEME_DROPDOWN_TEXTFIELD ||
if (aWidgetType == NS_THEME_MENULIST ||
aWidgetType == NS_THEME_MENULIST_TEXTFIELD ||
aWidgetType == NS_THEME_BUTTON ||
aWidgetType == NS_THEME_MOZ_MAC_HELP_BUTTON ||
aWidgetType == NS_THEME_MAC_HELP_BUTTON ||
aWidgetType == NS_THEME_MAC_DISCLOSURE_BUTTON_OPEN ||
aWidgetType == NS_THEME_MAC_DISCLOSURE_BUTTON_CLOSED ||
aWidgetType == NS_THEME_RADIO ||
@ -3870,7 +3870,7 @@ nsNativeThemeCocoa::WidgetAppearanceDependsOnWindowFocus(uint8_t aWidgetType)
switch (aWidgetType) {
case NS_THEME_DIALOG:
case NS_THEME_GROUPBOX:
case NS_THEME_TAB_PANELS:
case NS_THEME_TABPANELS:
case NS_THEME_BUTTON_ARROW_UP:
case NS_THEME_BUTTON_ARROW_DOWN:
case NS_THEME_CHECKMENUITEM:
@ -3880,14 +3880,14 @@ nsNativeThemeCocoa::WidgetAppearanceDependsOnWindowFocus(uint8_t aWidgetType)
case NS_THEME_MENUSEPARATOR:
case NS_THEME_TOOLTIP:
case NS_THEME_SPINNER:
case NS_THEME_SPINNER_UP_BUTTON:
case NS_THEME_SPINNER_DOWN_BUTTON:
case NS_THEME_TOOLBAR_SEPARATOR:
case NS_THEME_SPINNER_UPBUTTON:
case NS_THEME_SPINNER_DOWNBUTTON:
case NS_THEME_SEPARATOR:
case NS_THEME_TOOLBOX:
case NS_THEME_NUMBER_INPUT:
case NS_THEME_TEXTFIELD:
case NS_THEME_TREEVIEW:
case NS_THEME_TREEVIEW_LINE:
case NS_THEME_TREELINE:
case NS_THEME_TEXTFIELD_MULTILINE:
case NS_THEME_LISTBOX:
case NS_THEME_RESIZER:
@ -3982,7 +3982,7 @@ nsNativeThemeCocoa::ThemeGeometryTypeForWidget(nsIFrame* aFrame, uint8_t aWidget
return eThemeGeometryTypeToolbox;
case NS_THEME_WINDOW_BUTTON_BOX:
return eThemeGeometryTypeWindowButtons;
case NS_THEME_MOZ_MAC_FULLSCREEN_BUTTON:
case NS_THEME_MAC_FULLSCREEN_BUTTON:
return eThemeGeometryTypeFullscreenButton;
case NS_THEME_MAC_VIBRANCY_LIGHT:
return eThemeGeometryTypeVibrancyLight;

Просмотреть файл

@ -180,10 +180,10 @@ nsNativeThemeGTK::GetTabMarginPixels(nsIFrame* aFrame)
static bool ShouldScrollbarButtonBeDisabled(int32_t aCurpos, int32_t aMaxpos,
uint8_t aWidgetType)
{
return ((aCurpos == 0 && (aWidgetType == NS_THEME_SCROLLBAR_BUTTON_UP ||
aWidgetType == NS_THEME_SCROLLBAR_BUTTON_LEFT))
|| (aCurpos == aMaxpos && (aWidgetType == NS_THEME_SCROLLBAR_BUTTON_DOWN ||
aWidgetType == NS_THEME_SCROLLBAR_BUTTON_RIGHT)));
return ((aCurpos == 0 && (aWidgetType == NS_THEME_SCROLLBARBUTTON_UP ||
aWidgetType == NS_THEME_SCROLLBARBUTTON_LEFT))
|| (aCurpos == aMaxpos && (aWidgetType == NS_THEME_SCROLLBARBUTTON_DOWN ||
aWidgetType == NS_THEME_SCROLLBARBUTTON_RIGHT)));
}
bool
@ -240,8 +240,8 @@ nsNativeThemeGTK::GetGtkWidgetAndState(uint8_t aWidgetType, nsIFrame* aFrame,
*aWidgetFlags |= MOZ_GTK_WIDGET_INCONSISTENT;
}
}
} else if (aWidgetType == NS_THEME_TOOLBAR_BUTTON_DROPDOWN ||
aWidgetType == NS_THEME_TREEVIEW_HEADER_SORTARROW ||
} else if (aWidgetType == NS_THEME_TOOLBARBUTTON_DROPDOWN ||
aWidgetType == NS_THEME_TREEHEADERSORTARROW ||
aWidgetType == NS_THEME_BUTTON_ARROW_PREVIOUS ||
aWidgetType == NS_THEME_BUTTON_ARROW_NEXT ||
aWidgetType == NS_THEME_BUTTON_ARROW_UP ||
@ -270,11 +270,11 @@ nsNativeThemeGTK::GetGtkWidgetAndState(uint8_t aWidgetType, nsIFrame* aFrame,
aState->focused = TRUE;
aState->depressed = TRUE; // see moz_gtk_entry_paint()
} else if (aWidgetType == NS_THEME_BUTTON ||
aWidgetType == NS_THEME_TOOLBAR_BUTTON ||
aWidgetType == NS_THEME_TOOLBAR_DUAL_BUTTON ||
aWidgetType == NS_THEME_TOOLBAR_BUTTON_DROPDOWN ||
aWidgetType == NS_THEME_DROPDOWN ||
aWidgetType == NS_THEME_DROPDOWN_BUTTON) {
aWidgetType == NS_THEME_TOOLBARBUTTON ||
aWidgetType == NS_THEME_DUALBUTTON ||
aWidgetType == NS_THEME_TOOLBARBUTTON_DROPDOWN ||
aWidgetType == NS_THEME_MENULIST ||
aWidgetType == NS_THEME_MENULIST_BUTTON) {
aState->active &= aState->inHover;
}
@ -285,7 +285,7 @@ nsNativeThemeGTK::GetGtkWidgetAndState(uint8_t aWidgetType, nsIFrame* aFrame,
if (aWidgetType == NS_THEME_NUMBER_INPUT ||
aWidgetType == NS_THEME_TEXTFIELD ||
aWidgetType == NS_THEME_TEXTFIELD_MULTILINE ||
aWidgetType == NS_THEME_DROPDOWN_TEXTFIELD ||
aWidgetType == NS_THEME_MENULIST_TEXTFIELD ||
aWidgetType == NS_THEME_SPINNER_TEXTFIELD ||
aWidgetType == NS_THEME_RADIO_CONTAINER ||
aWidgetType == NS_THEME_RADIO_LABEL) {
@ -296,8 +296,8 @@ nsNativeThemeGTK::GetGtkWidgetAndState(uint8_t aWidgetType, nsIFrame* aFrame,
aState->focused = FALSE;
}
if (aWidgetType == NS_THEME_SCROLLBAR_THUMB_VERTICAL ||
aWidgetType == NS_THEME_SCROLLBAR_THUMB_HORIZONTAL) {
if (aWidgetType == NS_THEME_SCROLLBARTHUMB_VERTICAL ||
aWidgetType == NS_THEME_SCROLLBARTHUMB_HORIZONTAL) {
// for scrollbars we need to go up two to go from the thumb to
// the slider to the actual scrollbar object
nsIFrame *tmpFrame = aFrame->GetParent()->GetParent();
@ -310,10 +310,10 @@ nsNativeThemeGTK::GetGtkWidgetAndState(uint8_t aWidgetType, nsIFrame* aFrame,
}
}
if (aWidgetType == NS_THEME_SCROLLBAR_BUTTON_UP ||
aWidgetType == NS_THEME_SCROLLBAR_BUTTON_DOWN ||
aWidgetType == NS_THEME_SCROLLBAR_BUTTON_LEFT ||
aWidgetType == NS_THEME_SCROLLBAR_BUTTON_RIGHT) {
if (aWidgetType == NS_THEME_SCROLLBARBUTTON_UP ||
aWidgetType == NS_THEME_SCROLLBARBUTTON_DOWN ||
aWidgetType == NS_THEME_SCROLLBARBUTTON_LEFT ||
aWidgetType == NS_THEME_SCROLLBARBUTTON_RIGHT) {
// set the state to disabled when the scrollbar is scrolled to
// the beginning or the end, depending on the button type.
int32_t curpos = CheckIntAttr(aFrame, nsGkAtoms::curpos, 0);
@ -331,7 +331,7 @@ nsNativeThemeGTK::GetGtkWidgetAndState(uint8_t aWidgetType, nsIFrame* aFrame,
if (aWidgetFlags) {
*aWidgetFlags = GetScrollbarButtonType(aFrame);
if (aWidgetType - NS_THEME_SCROLLBAR_BUTTON_UP < 2)
if (aWidgetType - NS_THEME_SCROLLBARBUTTON_UP < 2)
*aWidgetFlags |= MOZ_GTK_STEPPER_VERTICAL;
}
}
@ -376,11 +376,11 @@ nsNativeThemeGTK::GetGtkWidgetAndState(uint8_t aWidgetType, nsIFrame* aFrame,
// A button with drop down menu open or an activated toggle button
// should always appear depressed.
if (aWidgetType == NS_THEME_BUTTON ||
aWidgetType == NS_THEME_TOOLBAR_BUTTON ||
aWidgetType == NS_THEME_TOOLBAR_DUAL_BUTTON ||
aWidgetType == NS_THEME_TOOLBAR_BUTTON_DROPDOWN ||
aWidgetType == NS_THEME_DROPDOWN ||
aWidgetType == NS_THEME_DROPDOWN_BUTTON) {
aWidgetType == NS_THEME_TOOLBARBUTTON ||
aWidgetType == NS_THEME_DUALBUTTON ||
aWidgetType == NS_THEME_TOOLBARBUTTON_DROPDOWN ||
aWidgetType == NS_THEME_MENULIST ||
aWidgetType == NS_THEME_MENULIST_BUTTON) {
bool menuOpen = IsOpenButton(aFrame);
aState->depressed = IsCheckedButton(aFrame) || menuOpen;
// we must not highlight buttons with open drop down menus on hover.
@ -389,7 +389,7 @@ nsNativeThemeGTK::GetGtkWidgetAndState(uint8_t aWidgetType, nsIFrame* aFrame,
// When the input field of the drop down button has focus, some themes
// should draw focus for the drop down button as well.
if (aWidgetType == NS_THEME_DROPDOWN_BUTTON && aWidgetFlags) {
if (aWidgetType == NS_THEME_MENULIST_BUTTON && aWidgetFlags) {
*aWidgetFlags = CheckBooleanAttr(aFrame, nsGkAtoms::parentfocused);
}
}
@ -402,8 +402,8 @@ nsNativeThemeGTK::GetGtkWidgetAndState(uint8_t aWidgetType, nsIFrame* aFrame,
*aWidgetFlags = GTK_RELIEF_NORMAL;
aGtkWidgetType = MOZ_GTK_BUTTON;
break;
case NS_THEME_TOOLBAR_BUTTON:
case NS_THEME_TOOLBAR_DUAL_BUTTON:
case NS_THEME_TOOLBARBUTTON:
case NS_THEME_DUALBUTTON:
if (aWidgetFlags)
*aWidgetFlags = GTK_RELIEF_NONE;
aGtkWidgetType = MOZ_GTK_TOOLBAR_BUTTON;
@ -415,10 +415,10 @@ nsNativeThemeGTK::GetGtkWidgetAndState(uint8_t aWidgetType, nsIFrame* aFrame,
case NS_THEME_RADIO:
aGtkWidgetType = (aWidgetType == NS_THEME_RADIO) ? MOZ_GTK_RADIOBUTTON : MOZ_GTK_CHECKBUTTON;
break;
case NS_THEME_SCROLLBAR_BUTTON_UP:
case NS_THEME_SCROLLBAR_BUTTON_DOWN:
case NS_THEME_SCROLLBAR_BUTTON_LEFT:
case NS_THEME_SCROLLBAR_BUTTON_RIGHT:
case NS_THEME_SCROLLBARBUTTON_UP:
case NS_THEME_SCROLLBARBUTTON_DOWN:
case NS_THEME_SCROLLBARBUTTON_LEFT:
case NS_THEME_SCROLLBARBUTTON_RIGHT:
aGtkWidgetType = MOZ_GTK_SCROLLBAR_BUTTON;
break;
case NS_THEME_SCROLLBAR_VERTICAL:
@ -435,19 +435,19 @@ nsNativeThemeGTK::GetGtkWidgetAndState(uint8_t aWidgetType, nsIFrame* aFrame,
else
*aWidgetFlags = 0;
break;
case NS_THEME_SCROLLBAR_THUMB_VERTICAL:
case NS_THEME_SCROLLBARTHUMB_VERTICAL:
aGtkWidgetType = MOZ_GTK_SCROLLBAR_THUMB_VERTICAL;
break;
case NS_THEME_SCROLLBAR_THUMB_HORIZONTAL:
case NS_THEME_SCROLLBARTHUMB_HORIZONTAL:
aGtkWidgetType = MOZ_GTK_SCROLLBAR_THUMB_HORIZONTAL;
break;
case NS_THEME_SPINNER:
aGtkWidgetType = MOZ_GTK_SPINBUTTON;
break;
case NS_THEME_SPINNER_UP_BUTTON:
case NS_THEME_SPINNER_UPBUTTON:
aGtkWidgetType = MOZ_GTK_SPINBUTTON_UP;
break;
case NS_THEME_SPINNER_DOWN_BUTTON:
case NS_THEME_SPINNER_DOWNBUTTON:
aGtkWidgetType = MOZ_GTK_SPINBUTTON_DOWN;
break;
case NS_THEME_SPINNER_TEXTFIELD:
@ -484,7 +484,7 @@ nsNativeThemeGTK::GetGtkWidgetAndState(uint8_t aWidgetType, nsIFrame* aFrame,
*aWidgetFlags = GTK_ORIENTATION_HORIZONTAL;
aGtkWidgetType = MOZ_GTK_SCALE_HORIZONTAL;
break;
case NS_THEME_SCALE_THUMB_HORIZONTAL:
case NS_THEME_SCALETHUMB_HORIZONTAL:
if (aWidgetFlags)
*aWidgetFlags = GTK_ORIENTATION_HORIZONTAL;
aGtkWidgetType = MOZ_GTK_SCALE_THUMB_HORIZONTAL;
@ -494,15 +494,15 @@ nsNativeThemeGTK::GetGtkWidgetAndState(uint8_t aWidgetType, nsIFrame* aFrame,
*aWidgetFlags = GTK_ORIENTATION_VERTICAL;
aGtkWidgetType = MOZ_GTK_SCALE_VERTICAL;
break;
case NS_THEME_TOOLBAR_SEPARATOR:
case NS_THEME_SEPARATOR:
aGtkWidgetType = MOZ_GTK_TOOLBAR_SEPARATOR;
break;
case NS_THEME_SCALE_THUMB_VERTICAL:
case NS_THEME_SCALETHUMB_VERTICAL:
if (aWidgetFlags)
*aWidgetFlags = GTK_ORIENTATION_VERTICAL;
aGtkWidgetType = MOZ_GTK_SCALE_THUMB_VERTICAL;
break;
case NS_THEME_TOOLBAR_GRIPPER:
case NS_THEME_TOOLBARGRIPPER:
aGtkWidgetType = MOZ_GTK_GRIPPER;
break;
case NS_THEME_RESIZER:
@ -523,7 +523,7 @@ nsNativeThemeGTK::GetGtkWidgetAndState(uint8_t aWidgetType, nsIFrame* aFrame,
case NS_THEME_TREEVIEW:
aGtkWidgetType = MOZ_GTK_TREEVIEW;
break;
case NS_THEME_TREEVIEW_HEADER_CELL:
case NS_THEME_TREEHEADERCELL:
if (aWidgetFlags) {
// In this case, the flag denotes whether the header is the sorted one or not
if (GetTreeSortDirection(aFrame) == eTreeSortDirection_Natural)
@ -533,7 +533,7 @@ nsNativeThemeGTK::GetGtkWidgetAndState(uint8_t aWidgetType, nsIFrame* aFrame,
}
aGtkWidgetType = MOZ_GTK_TREE_HEADER_CELL;
break;
case NS_THEME_TREEVIEW_HEADER_SORTARROW:
case NS_THEME_TREEHEADERSORTARROW:
if (aWidgetFlags) {
switch (GetTreeSortDirection(aFrame)) {
case eTreeSortDirection_Ascending:
@ -553,30 +553,30 @@ nsNativeThemeGTK::GetGtkWidgetAndState(uint8_t aWidgetType, nsIFrame* aFrame,
}
aGtkWidgetType = MOZ_GTK_TREE_HEADER_SORTARROW;
break;
case NS_THEME_TREEVIEW_TWISTY:
case NS_THEME_TREETWISTY:
aGtkWidgetType = MOZ_GTK_TREEVIEW_EXPANDER;
if (aWidgetFlags)
*aWidgetFlags = GTK_EXPANDER_COLLAPSED;
break;
case NS_THEME_TREEVIEW_TWISTY_OPEN:
case NS_THEME_TREETWISTYOPEN:
aGtkWidgetType = MOZ_GTK_TREEVIEW_EXPANDER;
if (aWidgetFlags)
*aWidgetFlags = GTK_EXPANDER_EXPANDED;
break;
case NS_THEME_DROPDOWN:
case NS_THEME_MENULIST:
aGtkWidgetType = MOZ_GTK_DROPDOWN;
if (aWidgetFlags)
*aWidgetFlags = IsFrameContentNodeInNamespace(aFrame, kNameSpaceID_XHTML);
break;
case NS_THEME_DROPDOWN_TEXT:
case NS_THEME_MENULIST_TEXT:
return false; // nothing to do, but prevents the bg from being drawn
case NS_THEME_DROPDOWN_TEXTFIELD:
case NS_THEME_MENULIST_TEXTFIELD:
aGtkWidgetType = MOZ_GTK_DROPDOWN_ENTRY;
break;
case NS_THEME_DROPDOWN_BUTTON:
case NS_THEME_MENULIST_BUTTON:
aGtkWidgetType = MOZ_GTK_DROPDOWN_ARROW;
break;
case NS_THEME_TOOLBAR_BUTTON_DROPDOWN:
case NS_THEME_TOOLBARBUTTON_DROPDOWN:
case NS_THEME_BUTTON_ARROW_DOWN:
case NS_THEME_BUTTON_ARROW_UP:
case NS_THEME_BUTTON_ARROW_NEXT:
@ -611,16 +611,16 @@ nsNativeThemeGTK::GetGtkWidgetAndState(uint8_t aWidgetType, nsIFrame* aFrame,
case NS_THEME_TOOLTIP:
aGtkWidgetType = MOZ_GTK_TOOLTIP;
break;
case NS_THEME_STATUSBAR_PANEL:
case NS_THEME_STATUSBAR_RESIZER_PANEL:
case NS_THEME_STATUSBARPANEL:
case NS_THEME_RESIZER_PANEL:
aGtkWidgetType = MOZ_GTK_FRAME;
break;
case NS_THEME_PROGRESSBAR:
case NS_THEME_PROGRESSBAR_VERTICAL:
aGtkWidgetType = MOZ_GTK_PROGRESSBAR;
break;
case NS_THEME_PROGRESSBAR_CHUNK:
case NS_THEME_PROGRESSBAR_CHUNK_VERTICAL:
case NS_THEME_PROGRESSCHUNK:
case NS_THEME_PROGRESSCHUNK_VERTICAL:
{
nsIFrame* stateFrame = aFrame->GetParent();
EventStates eventStates = GetContentState(stateFrame, aWidgetType);
@ -632,14 +632,14 @@ nsNativeThemeGTK::GetGtkWidgetAndState(uint8_t aWidgetType, nsIFrame* aFrame,
: MOZ_GTK_PROGRESS_CHUNK;
}
break;
case NS_THEME_TAB_SCROLLARROW_BACK:
case NS_THEME_TAB_SCROLLARROW_FORWARD:
case NS_THEME_TAB_SCROLL_ARROW_BACK:
case NS_THEME_TAB_SCROLL_ARROW_FORWARD:
if (aWidgetFlags)
*aWidgetFlags = aWidgetType == NS_THEME_TAB_SCROLLARROW_BACK ?
*aWidgetFlags = aWidgetType == NS_THEME_TAB_SCROLL_ARROW_BACK ?
GTK_ARROW_LEFT : GTK_ARROW_RIGHT;
aGtkWidgetType = MOZ_GTK_TAB_SCROLLARROW;
break;
case NS_THEME_TAB_PANELS:
case NS_THEME_TABPANELS:
aGtkWidgetType = MOZ_GTK_TABPANELS;
break;
case NS_THEME_TAB:
@ -1003,10 +1003,10 @@ nsNativeThemeGTK::GetExtraSizeForWidget(nsIFrame* aFrame, uint8_t aWidgetType,
// GTK2 themes (Ximian Industrial, Bluecurve, Misty, at least);
// We modify the frame's overflow area. See bug 297508.
switch (aWidgetType) {
case NS_THEME_SCROLLBAR_THUMB_VERTICAL:
case NS_THEME_SCROLLBARTHUMB_VERTICAL:
aExtra->top = aExtra->bottom = 1;
break;
case NS_THEME_SCROLLBAR_THUMB_HORIZONTAL:
case NS_THEME_SCROLLBARTHUMB_HORIZONTAL:
aExtra->left = aExtra->right = 1;
break;
@ -1234,7 +1234,7 @@ nsNativeThemeGTK::GetWidgetBorder(nsDeviceContext* aContext, nsIFrame* aFrame,
aResult->top = aResult->left = aResult->right = aResult->bottom = 0;
switch (aWidgetType) {
case NS_THEME_SCROLLBAR_VERTICAL:
case NS_THEME_SCROLLBAR_TRACK_HORIZONTAL:
case NS_THEME_SCROLLBARTRACK_HORIZONTAL:
{
MozGtkScrollbarMetrics metrics;
moz_gtk_get_scrollbar_metrics(&metrics);
@ -1244,7 +1244,7 @@ nsNativeThemeGTK::GetWidgetBorder(nsDeviceContext* aContext, nsIFrame* aFrame,
}
break;
case NS_THEME_SCROLLBAR_HORIZONTAL:
case NS_THEME_SCROLLBAR_TRACK_VERTICAL:
case NS_THEME_SCROLLBARTRACK_VERTICAL:
{
MozGtkScrollbarMetrics metrics;
moz_gtk_get_scrollbar_metrics(&metrics);
@ -1256,7 +1256,7 @@ nsNativeThemeGTK::GetWidgetBorder(nsDeviceContext* aContext, nsIFrame* aFrame,
// gtk's 'toolbar' for purposes of painting the widget background,
// we don't use the toolbar border for toolbox.
break;
case NS_THEME_TOOLBAR_DUAL_BUTTON:
case NS_THEME_DUALBUTTON:
// TOOLBAR_DUAL_BUTTON is an interesting case. We want a border to draw
// around the entire button + dropdown, and also an inner border if you're
// over the button part. But, we want the inner button to be right up
@ -1314,12 +1314,12 @@ nsNativeThemeGTK::GetWidgetPadding(nsDeviceContext* aContext,
{
switch (aWidgetType) {
case NS_THEME_BUTTON_FOCUS:
case NS_THEME_TOOLBAR_BUTTON:
case NS_THEME_TOOLBAR_DUAL_BUTTON:
case NS_THEME_TAB_SCROLLARROW_BACK:
case NS_THEME_TAB_SCROLLARROW_FORWARD:
case NS_THEME_DROPDOWN_BUTTON:
case NS_THEME_TOOLBAR_BUTTON_DROPDOWN:
case NS_THEME_TOOLBARBUTTON:
case NS_THEME_DUALBUTTON:
case NS_THEME_TAB_SCROLL_ARROW_BACK:
case NS_THEME_TAB_SCROLL_ARROW_FORWARD:
case NS_THEME_MENULIST_BUTTON:
case NS_THEME_TOOLBARBUTTON_DROPDOWN:
case NS_THEME_BUTTON_ARROW_UP:
case NS_THEME_BUTTON_ARROW_DOWN:
case NS_THEME_BUTTON_ARROW_NEXT:
@ -1401,8 +1401,8 @@ nsNativeThemeGTK::GetMinimumWidgetSize(nsPresContext* aPresContext,
*aIsOverridable = true;
switch (aWidgetType) {
case NS_THEME_SCROLLBAR_BUTTON_UP:
case NS_THEME_SCROLLBAR_BUTTON_DOWN:
case NS_THEME_SCROLLBARBUTTON_UP:
case NS_THEME_SCROLLBARBUTTON_DOWN:
{
MozGtkScrollbarMetrics metrics;
moz_gtk_get_scrollbar_metrics(&metrics);
@ -1412,8 +1412,8 @@ nsNativeThemeGTK::GetMinimumWidgetSize(nsPresContext* aPresContext,
*aIsOverridable = false;
}
break;
case NS_THEME_SCROLLBAR_BUTTON_LEFT:
case NS_THEME_SCROLLBAR_BUTTON_RIGHT:
case NS_THEME_SCROLLBARBUTTON_LEFT:
case NS_THEME_SCROLLBARBUTTON_RIGHT:
{
MozGtkScrollbarMetrics metrics;
moz_gtk_get_scrollbar_metrics(&metrics);
@ -1465,13 +1465,13 @@ nsNativeThemeGTK::GetMinimumWidgetSize(nsPresContext* aPresContext,
*aIsOverridable = false;
}
break;
case NS_THEME_SCROLLBAR_THUMB_VERTICAL:
case NS_THEME_SCROLLBAR_THUMB_HORIZONTAL:
case NS_THEME_SCROLLBARTHUMB_VERTICAL:
case NS_THEME_SCROLLBARTHUMB_HORIZONTAL:
{
MozGtkScrollbarMetrics metrics;
moz_gtk_get_scrollbar_metrics(&metrics);
if (aWidgetType == NS_THEME_SCROLLBAR_THUMB_VERTICAL) {
if (aWidgetType == NS_THEME_SCROLLBARTHUMB_VERTICAL) {
aResult->width = metrics.slider_width;
aResult->height = metrics.min_slider_size;
} else {
@ -1510,12 +1510,12 @@ nsNativeThemeGTK::GetMinimumWidgetSize(nsPresContext* aPresContext,
*aIsOverridable = true;
}
break;
case NS_THEME_SCALE_THUMB_HORIZONTAL:
case NS_THEME_SCALE_THUMB_VERTICAL:
case NS_THEME_SCALETHUMB_HORIZONTAL:
case NS_THEME_SCALETHUMB_VERTICAL:
{
gint thumb_length, thumb_height;
if (aWidgetType == NS_THEME_SCALE_THUMB_VERTICAL) {
if (aWidgetType == NS_THEME_SCALETHUMB_VERTICAL) {
moz_gtk_get_scalethumb_metrics(GTK_ORIENTATION_VERTICAL, &thumb_length, &thumb_height);
aResult->width = thumb_height;
aResult->height = thumb_length;
@ -1528,14 +1528,14 @@ nsNativeThemeGTK::GetMinimumWidgetSize(nsPresContext* aPresContext,
*aIsOverridable = false;
}
break;
case NS_THEME_TAB_SCROLLARROW_BACK:
case NS_THEME_TAB_SCROLLARROW_FORWARD:
case NS_THEME_TAB_SCROLL_ARROW_BACK:
case NS_THEME_TAB_SCROLL_ARROW_FORWARD:
{
moz_gtk_get_tab_scroll_arrow_size(&aResult->width, &aResult->height);
*aIsOverridable = false;
}
break;
case NS_THEME_DROPDOWN_BUTTON:
case NS_THEME_MENULIST_BUTTON:
{
moz_gtk_get_combo_box_entry_button_size(&aResult->width,
&aResult->height);
@ -1568,7 +1568,7 @@ nsNativeThemeGTK::GetMinimumWidgetSize(nsPresContext* aPresContext,
aResult->height = indicator_size;
}
break;
case NS_THEME_TOOLBAR_BUTTON_DROPDOWN:
case NS_THEME_TOOLBARBUTTON_DROPDOWN:
case NS_THEME_BUTTON_ARROW_UP:
case NS_THEME_BUTTON_ARROW_DOWN:
case NS_THEME_BUTTON_ARROW_NEXT:
@ -1584,11 +1584,11 @@ nsNativeThemeGTK::GetMinimumWidgetSize(nsPresContext* aPresContext,
case NS_THEME_CHECKBOX_LABEL:
case NS_THEME_RADIO_LABEL:
case NS_THEME_BUTTON:
case NS_THEME_DROPDOWN:
case NS_THEME_TOOLBAR_BUTTON:
case NS_THEME_TREEVIEW_HEADER_CELL:
case NS_THEME_MENULIST:
case NS_THEME_TOOLBARBUTTON:
case NS_THEME_TREEHEADERCELL:
{
if (aWidgetType == NS_THEME_DROPDOWN) {
if (aWidgetType == NS_THEME_MENULIST) {
// Include the arrow size.
moz_gtk_get_arrow_size(MOZ_GTK_DROPDOWN,
&aResult->width, &aResult->height);
@ -1612,7 +1612,7 @@ nsNativeThemeGTK::GetMinimumWidgetSize(nsPresContext* aPresContext,
}
break;
#endif
case NS_THEME_TOOLBAR_SEPARATOR:
case NS_THEME_SEPARATOR:
{
gint separator_width;
@ -1626,9 +1626,9 @@ nsNativeThemeGTK::GetMinimumWidgetSize(nsPresContext* aPresContext,
aResult->width = 14;
aResult->height = 26;
break;
case NS_THEME_TREEVIEW_HEADER_SORTARROW:
case NS_THEME_SPINNER_UP_BUTTON:
case NS_THEME_SPINNER_DOWN_BUTTON:
case NS_THEME_TREEHEADERSORTARROW:
case NS_THEME_SPINNER_UPBUTTON:
case NS_THEME_SPINNER_DOWNBUTTON:
// hard code these sizes
aResult->width = 14;
aResult->height = 13;
@ -1638,8 +1638,8 @@ nsNativeThemeGTK::GetMinimumWidgetSize(nsPresContext* aPresContext,
aResult->width = aResult->height = 15;
*aIsOverridable = false;
break;
case NS_THEME_TREEVIEW_TWISTY:
case NS_THEME_TREEVIEW_TWISTY_OPEN:
case NS_THEME_TREETWISTY:
case NS_THEME_TREETWISTYOPEN:
{
gint expander_size;
@ -1664,10 +1664,10 @@ nsNativeThemeGTK::WidgetStateChanged(nsIFrame* aFrame, uint8_t aWidgetType,
if (aWidgetType == NS_THEME_TOOLBOX ||
aWidgetType == NS_THEME_TOOLBAR ||
aWidgetType == NS_THEME_STATUSBAR ||
aWidgetType == NS_THEME_STATUSBAR_PANEL ||
aWidgetType == NS_THEME_STATUSBAR_RESIZER_PANEL ||
aWidgetType == NS_THEME_PROGRESSBAR_CHUNK ||
aWidgetType == NS_THEME_PROGRESSBAR_CHUNK_VERTICAL ||
aWidgetType == NS_THEME_STATUSBARPANEL ||
aWidgetType == NS_THEME_RESIZER_PANEL ||
aWidgetType == NS_THEME_PROGRESSCHUNK ||
aWidgetType == NS_THEME_PROGRESSCHUNK_VERTICAL ||
aWidgetType == NS_THEME_PROGRESSBAR ||
aWidgetType == NS_THEME_PROGRESSBAR_VERTICAL ||
aWidgetType == NS_THEME_MENUBAR ||
@ -1680,17 +1680,17 @@ nsNativeThemeGTK::WidgetStateChanged(nsIFrame* aFrame, uint8_t aWidgetType,
return NS_OK;
}
if ((aWidgetType == NS_THEME_SCROLLBAR_THUMB_VERTICAL ||
aWidgetType == NS_THEME_SCROLLBAR_THUMB_HORIZONTAL) &&
if ((aWidgetType == NS_THEME_SCROLLBARTHUMB_VERTICAL ||
aWidgetType == NS_THEME_SCROLLBARTHUMB_HORIZONTAL) &&
aAttribute == nsGkAtoms::active) {
*aShouldRepaint = true;
return NS_OK;
}
if ((aWidgetType == NS_THEME_SCROLLBAR_BUTTON_UP ||
aWidgetType == NS_THEME_SCROLLBAR_BUTTON_DOWN ||
aWidgetType == NS_THEME_SCROLLBAR_BUTTON_LEFT ||
aWidgetType == NS_THEME_SCROLLBAR_BUTTON_RIGHT) &&
if ((aWidgetType == NS_THEME_SCROLLBARBUTTON_UP ||
aWidgetType == NS_THEME_SCROLLBARBUTTON_DOWN ||
aWidgetType == NS_THEME_SCROLLBARBUTTON_LEFT ||
aWidgetType == NS_THEME_SCROLLBARBUTTON_RIGHT) &&
(aAttribute == nsGkAtoms::curpos ||
aAttribute == nsGkAtoms::maxpos)) {
// If 'curpos' has changed and we are passed its old value, we can
@ -1759,9 +1759,9 @@ nsNativeThemeGTK::ThemeSupportsWidget(nsPresContext* aPresContext,
switch (aWidgetType) {
// Combobox dropdowns don't support native theming in vertical mode.
case NS_THEME_DROPDOWN:
case NS_THEME_DROPDOWN_TEXT:
case NS_THEME_DROPDOWN_TEXTFIELD:
case NS_THEME_MENULIST:
case NS_THEME_MENULIST_TEXT:
case NS_THEME_MENULIST_TEXTFIELD:
if (aFrame && aFrame->GetWritingMode().IsVertical()) {
return false;
}
@ -1773,67 +1773,67 @@ nsNativeThemeGTK::ThemeSupportsWidget(nsPresContext* aPresContext,
case NS_THEME_CHECKBOX:
case NS_THEME_TOOLBOX: // N/A
case NS_THEME_TOOLBAR:
case NS_THEME_TOOLBAR_BUTTON:
case NS_THEME_TOOLBAR_DUAL_BUTTON: // so we can override the border with 0
case NS_THEME_TOOLBAR_BUTTON_DROPDOWN:
case NS_THEME_TOOLBARBUTTON:
case NS_THEME_DUALBUTTON: // so we can override the border with 0
case NS_THEME_TOOLBARBUTTON_DROPDOWN:
case NS_THEME_BUTTON_ARROW_UP:
case NS_THEME_BUTTON_ARROW_DOWN:
case NS_THEME_BUTTON_ARROW_NEXT:
case NS_THEME_BUTTON_ARROW_PREVIOUS:
case NS_THEME_TOOLBAR_SEPARATOR:
case NS_THEME_TOOLBAR_GRIPPER:
case NS_THEME_SEPARATOR:
case NS_THEME_TOOLBARGRIPPER:
case NS_THEME_STATUSBAR:
case NS_THEME_STATUSBAR_PANEL:
case NS_THEME_STATUSBAR_RESIZER_PANEL:
case NS_THEME_STATUSBARPANEL:
case NS_THEME_RESIZER_PANEL:
case NS_THEME_RESIZER:
case NS_THEME_LISTBOX:
// case NS_THEME_LISTBOX_LISTITEM:
// case NS_THEME_LISTITEM:
case NS_THEME_TREEVIEW:
// case NS_THEME_TREEVIEW_TREEITEM:
case NS_THEME_TREEVIEW_TWISTY:
// case NS_THEME_TREEVIEW_LINE:
// case NS_THEME_TREEVIEW_HEADER:
case NS_THEME_TREEVIEW_HEADER_CELL:
case NS_THEME_TREEVIEW_HEADER_SORTARROW:
case NS_THEME_TREEVIEW_TWISTY_OPEN:
// case NS_THEME_TREEITEM:
case NS_THEME_TREETWISTY:
// case NS_THEME_TREELINE:
// case NS_THEME_TREEHEADER:
case NS_THEME_TREEHEADERCELL:
case NS_THEME_TREEHEADERSORTARROW:
case NS_THEME_TREETWISTYOPEN:
case NS_THEME_PROGRESSBAR:
case NS_THEME_PROGRESSBAR_CHUNK:
case NS_THEME_PROGRESSCHUNK:
case NS_THEME_PROGRESSBAR_VERTICAL:
case NS_THEME_PROGRESSBAR_CHUNK_VERTICAL:
case NS_THEME_PROGRESSCHUNK_VERTICAL:
case NS_THEME_TAB:
// case NS_THEME_TAB_PANEL:
case NS_THEME_TAB_PANELS:
case NS_THEME_TAB_SCROLLARROW_BACK:
case NS_THEME_TAB_SCROLLARROW_FORWARD:
// case NS_THEME_TABPANEL:
case NS_THEME_TABPANELS:
case NS_THEME_TAB_SCROLL_ARROW_BACK:
case NS_THEME_TAB_SCROLL_ARROW_FORWARD:
case NS_THEME_TOOLTIP:
case NS_THEME_SPINNER:
case NS_THEME_SPINNER_UP_BUTTON:
case NS_THEME_SPINNER_DOWN_BUTTON:
case NS_THEME_SPINNER_UPBUTTON:
case NS_THEME_SPINNER_DOWNBUTTON:
case NS_THEME_SPINNER_TEXTFIELD:
// case NS_THEME_SCROLLBAR: (n/a for gtk)
// case NS_THEME_SCROLLBAR_SMALL: (n/a for gtk)
case NS_THEME_SCROLLBAR_BUTTON_UP:
case NS_THEME_SCROLLBAR_BUTTON_DOWN:
case NS_THEME_SCROLLBAR_BUTTON_LEFT:
case NS_THEME_SCROLLBAR_BUTTON_RIGHT:
case NS_THEME_SCROLLBARBUTTON_UP:
case NS_THEME_SCROLLBARBUTTON_DOWN:
case NS_THEME_SCROLLBARBUTTON_LEFT:
case NS_THEME_SCROLLBARBUTTON_RIGHT:
case NS_THEME_SCROLLBAR_HORIZONTAL:
case NS_THEME_SCROLLBAR_VERTICAL:
case NS_THEME_SCROLLBAR_TRACK_HORIZONTAL:
case NS_THEME_SCROLLBAR_TRACK_VERTICAL:
case NS_THEME_SCROLLBAR_THUMB_HORIZONTAL:
case NS_THEME_SCROLLBAR_THUMB_VERTICAL:
case NS_THEME_SCROLLBARTRACK_HORIZONTAL:
case NS_THEME_SCROLLBARTRACK_VERTICAL:
case NS_THEME_SCROLLBARTHUMB_HORIZONTAL:
case NS_THEME_SCROLLBARTHUMB_VERTICAL:
case NS_THEME_NUMBER_INPUT:
case NS_THEME_TEXTFIELD:
case NS_THEME_TEXTFIELD_MULTILINE:
case NS_THEME_RANGE:
case NS_THEME_RANGE_THUMB:
case NS_THEME_SCALE_HORIZONTAL:
case NS_THEME_SCALE_THUMB_HORIZONTAL:
case NS_THEME_SCALETHUMB_HORIZONTAL:
case NS_THEME_SCALE_VERTICAL:
case NS_THEME_SCALE_THUMB_VERTICAL:
// case NS_THEME_SCALE_THUMB_START:
// case NS_THEME_SCALE_THUMB_END:
// case NS_THEME_SCALE_TICK:
case NS_THEME_SCALETHUMB_VERTICAL:
// case NS_THEME_SCALETHUMBSTART:
// case NS_THEME_SCALETHUMBEND:
// case NS_THEME_SCALETHUMBTICK:
case NS_THEME_CHECKBOX_CONTAINER:
case NS_THEME_RADIO_CONTAINER:
case NS_THEME_CHECKBOX_LABEL:
@ -1853,7 +1853,7 @@ nsNativeThemeGTK::ThemeSupportsWidget(nsPresContext* aPresContext,
#endif
return !IsWidgetStyled(aPresContext, aFrame, aWidgetType);
case NS_THEME_DROPDOWN_BUTTON:
case NS_THEME_MENULIST_BUTTON:
if (aFrame && aFrame->GetWritingMode().IsVertical()) {
return false;
}
@ -1873,12 +1873,12 @@ NS_IMETHODIMP_(bool)
nsNativeThemeGTK::WidgetIsContainer(uint8_t aWidgetType)
{
// XXXdwh At some point flesh all of this out.
if (aWidgetType == NS_THEME_DROPDOWN_BUTTON ||
if (aWidgetType == NS_THEME_MENULIST_BUTTON ||
aWidgetType == NS_THEME_RADIO ||
aWidgetType == NS_THEME_RANGE_THUMB ||
aWidgetType == NS_THEME_CHECKBOX ||
aWidgetType == NS_THEME_TAB_SCROLLARROW_BACK ||
aWidgetType == NS_THEME_TAB_SCROLLARROW_FORWARD ||
aWidgetType == NS_THEME_TAB_SCROLL_ARROW_BACK ||
aWidgetType == NS_THEME_TAB_SCROLL_ARROW_FORWARD ||
aWidgetType == NS_THEME_BUTTON_ARROW_UP ||
aWidgetType == NS_THEME_BUTTON_ARROW_DOWN ||
aWidgetType == NS_THEME_BUTTON_ARROW_NEXT ||
@ -1890,9 +1890,9 @@ nsNativeThemeGTK::WidgetIsContainer(uint8_t aWidgetType)
bool
nsNativeThemeGTK::ThemeDrawsFocusForWidget(uint8_t aWidgetType)
{
if (aWidgetType == NS_THEME_DROPDOWN ||
if (aWidgetType == NS_THEME_MENULIST ||
aWidgetType == NS_THEME_BUTTON ||
aWidgetType == NS_THEME_TREEVIEW_HEADER_CELL)
aWidgetType == NS_THEME_TREEHEADERCELL)
return true;
return false;

Просмотреть файл

@ -231,7 +231,7 @@ nsNativeTheme::IsButtonTypeMenu(nsIFrame* aFrame)
bool
nsNativeTheme::IsPressedButton(nsIFrame* aFrame)
{
EventStates eventState = GetContentState(aFrame, NS_THEME_TOOLBAR_BUTTON);
EventStates eventState = GetContentState(aFrame, NS_THEME_TOOLBARBUTTON);
if (IsDisabled(aFrame, eventState))
return false;
@ -295,9 +295,9 @@ nsNativeTheme::IsWidgetStyled(nsPresContext* aPresContext, nsIFrame* aFrame,
* Progress bar appearance should be the same for the bar and the container
* frame. nsProgressFrame owns the logic and will tell us what we should do.
*/
if (aWidgetType == NS_THEME_PROGRESSBAR_CHUNK ||
if (aWidgetType == NS_THEME_PROGRESSCHUNK ||
aWidgetType == NS_THEME_PROGRESSBAR) {
nsProgressFrame* progressFrame = do_QueryFrame(aWidgetType == NS_THEME_PROGRESSBAR_CHUNK
nsProgressFrame* progressFrame = do_QueryFrame(aWidgetType == NS_THEME_PROGRESSCHUNK
? aFrame->GetParent() : aFrame);
if (progressFrame) {
return !progressFrame->ShouldUseNativeStyle();
@ -308,9 +308,9 @@ nsNativeTheme::IsWidgetStyled(nsPresContext* aPresContext, nsIFrame* aFrame,
* Meter bar appearance should be the same for the bar and the container
* frame. nsMeterFrame owns the logic and will tell us what we should do.
*/
if (aWidgetType == NS_THEME_METERBAR_CHUNK ||
if (aWidgetType == NS_THEME_METERCHUNK ||
aWidgetType == NS_THEME_METERBAR) {
nsMeterFrame* meterFrame = do_QueryFrame(aWidgetType == NS_THEME_METERBAR_CHUNK
nsMeterFrame* meterFrame = do_QueryFrame(aWidgetType == NS_THEME_METERCHUNK
? aFrame->GetParent() : aFrame);
if (meterFrame) {
return !meterFrame->ShouldUseNativeStyle();
@ -332,8 +332,8 @@ nsNativeTheme::IsWidgetStyled(nsPresContext* aPresContext, nsIFrame* aFrame,
}
}
if (aWidgetType == NS_THEME_SPINNER_UP_BUTTON ||
aWidgetType == NS_THEME_SPINNER_DOWN_BUTTON) {
if (aWidgetType == NS_THEME_SPINNER_UPBUTTON ||
aWidgetType == NS_THEME_SPINNER_DOWNBUTTON) {
nsNumberControlFrame* numberControlFrame =
nsNumberControlFrame::GetNumberControlFrameForSpinButton(aFrame);
if (numberControlFrame) {
@ -346,7 +346,7 @@ nsNativeTheme::IsWidgetStyled(nsPresContext* aPresContext, nsIFrame* aFrame,
aWidgetType == NS_THEME_TEXTFIELD ||
aWidgetType == NS_THEME_TEXTFIELD_MULTILINE ||
aWidgetType == NS_THEME_LISTBOX ||
aWidgetType == NS_THEME_DROPDOWN) &&
aWidgetType == NS_THEME_MENULIST) &&
aFrame->GetContent()->IsHTMLElement() &&
aPresContext->HasAuthorSpecifiedRules(aFrame,
NS_AUTHOR_SPECIFIED_BORDER |

Просмотреть файл

@ -680,7 +680,7 @@ nsNativeThemeWin::DrawThemedProgressMeter(nsIFrame* aFrame, int aWidgetType,
EventStates eventStates = GetContentState(parentFrame, aWidgetType);
bool vertical = IsVerticalProgress(parentFrame) ||
aWidgetType == NS_THEME_PROGRESSBAR_CHUNK_VERTICAL;
aWidgetType == NS_THEME_PROGRESSCHUNK_VERTICAL;
bool indeterminate = IsIndeterminateProgress(parentFrame, eventStates);
bool animate = indeterminate;
@ -728,7 +728,7 @@ nsNativeThemeWin::GetTheme(uint8_t aWidgetType)
// doing it the right way works fine with the MS themes,
// but breaks on a lot of custom themes (presumably because MS
// apps do the textfield border business as well).
if (aWidgetType == NS_THEME_DROPDOWN)
if (aWidgetType == NS_THEME_MENULIST)
aWidgetType = NS_THEME_TEXTFIELD;
}
@ -753,58 +753,58 @@ nsNativeThemeWin::GetTheme(uint8_t aWidgetType)
return nsUXThemeData::GetTheme(eUXMediaRebar);
case NS_THEME_WIN_COMMUNICATIONS_TOOLBOX:
return nsUXThemeData::GetTheme(eUXCommunicationsRebar);
case NS_THEME_WIN_BROWSER_TAB_BAR_TOOLBOX:
case NS_THEME_WIN_BROWSERTABBAR_TOOLBOX:
return nsUXThemeData::GetTheme(eUXBrowserTabBarRebar);
case NS_THEME_TOOLBAR:
case NS_THEME_TOOLBAR_BUTTON:
case NS_THEME_TOOLBAR_SEPARATOR:
case NS_THEME_TOOLBARBUTTON:
case NS_THEME_SEPARATOR:
return nsUXThemeData::GetTheme(eUXToolbar);
case NS_THEME_PROGRESSBAR:
case NS_THEME_PROGRESSBAR_VERTICAL:
case NS_THEME_PROGRESSBAR_CHUNK:
case NS_THEME_PROGRESSBAR_CHUNK_VERTICAL:
case NS_THEME_PROGRESSCHUNK:
case NS_THEME_PROGRESSCHUNK_VERTICAL:
return nsUXThemeData::GetTheme(eUXProgress);
case NS_THEME_TAB:
case NS_THEME_TAB_PANEL:
case NS_THEME_TAB_PANELS:
case NS_THEME_TABPANEL:
case NS_THEME_TABPANELS:
return nsUXThemeData::GetTheme(eUXTab);
case NS_THEME_SCROLLBAR:
case NS_THEME_SCROLLBAR_SMALL:
case NS_THEME_SCROLLBAR_VERTICAL:
case NS_THEME_SCROLLBAR_HORIZONTAL:
case NS_THEME_SCROLLBAR_BUTTON_UP:
case NS_THEME_SCROLLBAR_BUTTON_DOWN:
case NS_THEME_SCROLLBAR_BUTTON_LEFT:
case NS_THEME_SCROLLBAR_BUTTON_RIGHT:
case NS_THEME_SCROLLBAR_THUMB_VERTICAL:
case NS_THEME_SCROLLBAR_THUMB_HORIZONTAL:
case NS_THEME_SCROLLBARBUTTON_UP:
case NS_THEME_SCROLLBARBUTTON_DOWN:
case NS_THEME_SCROLLBARBUTTON_LEFT:
case NS_THEME_SCROLLBARBUTTON_RIGHT:
case NS_THEME_SCROLLBARTHUMB_VERTICAL:
case NS_THEME_SCROLLBARTHUMB_HORIZONTAL:
return nsUXThemeData::GetTheme(eUXScrollbar);
case NS_THEME_RANGE:
case NS_THEME_RANGE_THUMB:
case NS_THEME_SCALE_HORIZONTAL:
case NS_THEME_SCALE_VERTICAL:
case NS_THEME_SCALE_THUMB_HORIZONTAL:
case NS_THEME_SCALE_THUMB_VERTICAL:
case NS_THEME_SCALETHUMB_HORIZONTAL:
case NS_THEME_SCALETHUMB_VERTICAL:
return nsUXThemeData::GetTheme(eUXTrackbar);
case NS_THEME_SPINNER_UP_BUTTON:
case NS_THEME_SPINNER_DOWN_BUTTON:
case NS_THEME_SPINNER_UPBUTTON:
case NS_THEME_SPINNER_DOWNBUTTON:
return nsUXThemeData::GetTheme(eUXSpin);
case NS_THEME_STATUSBAR:
case NS_THEME_STATUSBAR_PANEL:
case NS_THEME_STATUSBAR_RESIZER_PANEL:
case NS_THEME_STATUSBARPANEL:
case NS_THEME_RESIZER_PANEL:
case NS_THEME_RESIZER:
return nsUXThemeData::GetTheme(eUXStatus);
case NS_THEME_DROPDOWN:
case NS_THEME_DROPDOWN_BUTTON:
case NS_THEME_MENULIST:
case NS_THEME_MENULIST_BUTTON:
return nsUXThemeData::GetTheme(eUXCombobox);
case NS_THEME_TREEVIEW_HEADER_CELL:
case NS_THEME_TREEVIEW_HEADER_SORTARROW:
case NS_THEME_TREEHEADERCELL:
case NS_THEME_TREEHEADERSORTARROW:
return nsUXThemeData::GetTheme(eUXHeader);
case NS_THEME_LISTBOX:
case NS_THEME_LISTBOX_LISTITEM:
case NS_THEME_LISTITEM:
case NS_THEME_TREEVIEW:
case NS_THEME_TREEVIEW_TWISTY_OPEN:
case NS_THEME_TREEVIEW_TREEITEM:
case NS_THEME_TREETWISTYOPEN:
case NS_THEME_TREEITEM:
return nsUXThemeData::GetTheme(eUXListview);
case NS_THEME_MENUBAR:
case NS_THEME_MENUPOPUP:
@ -875,7 +875,7 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, uint8_t aWidgetType,
{
if (!IsVistaOrLater()) {
// See GetTheme
if (aWidgetType == NS_THEME_DROPDOWN)
if (aWidgetType == NS_THEME_MENULIST)
aWidgetType = NS_THEME_TEXTFIELD;
}
@ -1026,10 +1026,10 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, uint8_t aWidgetType,
aState = PBBS_NORMAL;
return NS_OK;
}
case NS_THEME_PROGRESSBAR_CHUNK:
case NS_THEME_PROGRESSBAR_CHUNK_VERTICAL: {
case NS_THEME_PROGRESSCHUNK:
case NS_THEME_PROGRESSCHUNK_VERTICAL: {
nsIFrame* parentFrame = aFrame->GetParent();
if (aWidgetType == NS_THEME_PROGRESSBAR_CHUNK_VERTICAL ||
if (aWidgetType == NS_THEME_PROGRESSCHUNK_VERTICAL ||
IsVerticalProgress(parentFrame)) {
aPart = IsVistaOrLater() ?
PP_FILLVERT : PP_CHUNKVERT;
@ -1041,7 +1041,7 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, uint8_t aWidgetType,
aState = PBBVS_NORMAL;
return NS_OK;
}
case NS_THEME_TOOLBAR_BUTTON: {
case NS_THEME_TOOLBARBUTTON: {
aPart = BP_BUTTON;
if (!aFrame) {
aState = TS_NORMAL;
@ -1075,17 +1075,17 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, uint8_t aWidgetType,
return NS_OK;
}
case NS_THEME_TOOLBAR_SEPARATOR: {
case NS_THEME_SEPARATOR: {
aPart = TP_SEPARATOR;
aState = TS_NORMAL;
return NS_OK;
}
case NS_THEME_SCROLLBAR_BUTTON_UP:
case NS_THEME_SCROLLBAR_BUTTON_DOWN:
case NS_THEME_SCROLLBAR_BUTTON_LEFT:
case NS_THEME_SCROLLBAR_BUTTON_RIGHT: {
case NS_THEME_SCROLLBARBUTTON_UP:
case NS_THEME_SCROLLBARBUTTON_DOWN:
case NS_THEME_SCROLLBARBUTTON_LEFT:
case NS_THEME_SCROLLBARBUTTON_RIGHT: {
aPart = SP_BUTTON;
aState = (aWidgetType - NS_THEME_SCROLLBAR_BUTTON_UP)*4;
aState = (aWidgetType - NS_THEME_SCROLLBARBUTTON_UP)*4;
EventStates eventState = GetContentState(aFrame, aWidgetType);
if (!aFrame)
aState += TS_NORMAL;
@ -1101,7 +1101,7 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, uint8_t aWidgetType,
aState += TS_HOVER;
else if (IsVistaOrLater() &&
parentState.HasState(NS_EVENT_STATE_HOVER))
aState = (aWidgetType - NS_THEME_SCROLLBAR_BUTTON_UP) + SP_BUTTON_IMPLICIT_HOVER_BASE;
aState = (aWidgetType - NS_THEME_SCROLLBARBUTTON_UP) + SP_BUTTON_IMPLICIT_HOVER_BASE;
else
aState += TS_NORMAL;
}
@ -1114,9 +1114,9 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, uint8_t aWidgetType,
aState = TS_NORMAL;
return NS_OK;
}
case NS_THEME_SCROLLBAR_THUMB_HORIZONTAL:
case NS_THEME_SCROLLBAR_THUMB_VERTICAL: {
aPart = (aWidgetType == NS_THEME_SCROLLBAR_THUMB_HORIZONTAL) ?
case NS_THEME_SCROLLBARTHUMB_HORIZONTAL:
case NS_THEME_SCROLLBARTHUMB_VERTICAL: {
aPart = (aWidgetType == NS_THEME_SCROLLBARTHUMB_HORIZONTAL) ?
SP_THUMBHOR : SP_THUMBVERT;
EventStates eventState = GetContentState(aFrame, aWidgetType);
if (!aFrame)
@ -1150,8 +1150,8 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, uint8_t aWidgetType,
return NS_OK;
}
case NS_THEME_RANGE_THUMB:
case NS_THEME_SCALE_THUMB_HORIZONTAL:
case NS_THEME_SCALE_THUMB_VERTICAL: {
case NS_THEME_SCALETHUMB_HORIZONTAL:
case NS_THEME_SCALETHUMB_VERTICAL: {
if (aWidgetType == NS_THEME_RANGE_THUMB) {
if (IsRangeHorizontal(aFrame)) {
aPart = TKP_THUMBBOTTOM;
@ -1159,7 +1159,7 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, uint8_t aWidgetType,
aPart = IsFrameRTL(aFrame) ? TKP_THUMBLEFT : TKP_THUMBRIGHT;
}
} else {
aPart = (aWidgetType == NS_THEME_SCALE_THUMB_HORIZONTAL) ?
aPart = (aWidgetType == NS_THEME_SCALETHUMB_HORIZONTAL) ?
TKP_THUMB : TKP_THUMBVERT;
}
EventStates eventState = GetContentState(aFrame, aWidgetType);
@ -1182,9 +1182,9 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, uint8_t aWidgetType,
}
return NS_OK;
}
case NS_THEME_SPINNER_UP_BUTTON:
case NS_THEME_SPINNER_DOWN_BUTTON: {
aPart = (aWidgetType == NS_THEME_SPINNER_UP_BUTTON) ?
case NS_THEME_SPINNER_UPBUTTON:
case NS_THEME_SPINNER_DOWNBUTTON: {
aPart = (aWidgetType == NS_THEME_SPINNER_UPBUTTON) ?
SPNP_UP : SPNP_DOWN;
EventStates eventState = GetContentState(aFrame, aWidgetType);
if (!aFrame)
@ -1198,7 +1198,7 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, uint8_t aWidgetType,
case NS_THEME_TOOLBOX:
case NS_THEME_WIN_MEDIA_TOOLBOX:
case NS_THEME_WIN_COMMUNICATIONS_TOOLBOX:
case NS_THEME_WIN_BROWSER_TAB_BAR_TOOLBOX:
case NS_THEME_WIN_BROWSERTABBAR_TOOLBOX:
case NS_THEME_STATUSBAR:
case NS_THEME_SCROLLBAR:
case NS_THEME_SCROLLBAR_SMALL: {
@ -1229,10 +1229,10 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, uint8_t aWidgetType,
}
return NS_OK;
}
case NS_THEME_STATUSBAR_PANEL:
case NS_THEME_STATUSBAR_RESIZER_PANEL:
case NS_THEME_STATUSBARPANEL:
case NS_THEME_RESIZER_PANEL:
case NS_THEME_RESIZER: {
aPart = (aWidgetType - NS_THEME_STATUSBAR_PANEL) + 1;
aPart = (aWidgetType - NS_THEME_STATUSBARPANEL) + 1;
aState = TS_NORMAL;
return NS_OK;
}
@ -1242,12 +1242,12 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, uint8_t aWidgetType,
aState = TS_NORMAL;
return NS_OK;
}
case NS_THEME_TAB_PANELS: {
case NS_THEME_TABPANELS: {
aPart = TABP_PANELS;
aState = TS_NORMAL;
return NS_OK;
}
case NS_THEME_TAB_PANEL: {
case NS_THEME_TABPANEL: {
aPart = TABP_PANEL;
aState = TS_NORMAL;
return NS_OK;
@ -1274,13 +1274,13 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, uint8_t aWidgetType,
return NS_OK;
}
case NS_THEME_TREEVIEW_HEADER_SORTARROW: {
case NS_THEME_TREEHEADERSORTARROW: {
// XXX Probably will never work due to a bug in the Luna theme.
aPart = 4;
aState = 1;
return NS_OK;
}
case NS_THEME_TREEVIEW_HEADER_CELL: {
case NS_THEME_TREEHEADERCELL: {
aPart = 1;
if (!aFrame) {
aState = TS_NORMAL;
@ -1291,7 +1291,7 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, uint8_t aWidgetType,
return NS_OK;
}
case NS_THEME_DROPDOWN: {
case NS_THEME_MENULIST: {
nsIContent* content = aFrame->GetContent();
bool isHTML = content && content->IsHTMLElement();
bool useDropBorder = isHTML || IsMenuListEditable(aFrame);
@ -1324,7 +1324,7 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, uint8_t aWidgetType,
return NS_OK;
}
case NS_THEME_DROPDOWN_BUTTON: {
case NS_THEME_MENULIST_BUTTON: {
bool isHTML = IsHTMLContent(aFrame);
nsIFrame* parentFrame = aFrame->GetParent();
bool isMenulist = !isHTML && parentFrame->GetType() == nsGkAtoms::menuFrame;
@ -1341,7 +1341,7 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, uint8_t aWidgetType,
// For HTML controls with author styling, we should fall
// back to the old dropmarker style to avoid clashes with
// author-specified backgrounds and borders (bug #441034)
if (isHTML && IsWidgetStyled(aFrame->PresContext(), aFrame, NS_THEME_DROPDOWN))
if (isHTML && IsWidgetStyled(aFrame->PresContext(), aFrame, NS_THEME_MENULIST))
aPart = CBP_DROPMARKER;
if (IsDisabled(aFrame, eventState)) {
@ -1848,7 +1848,7 @@ RENDER_AGAIN:
}
// The following widgets need to be RTL-aware
else if (aWidgetType == NS_THEME_RESIZER ||
aWidgetType == NS_THEME_DROPDOWN_BUTTON)
aWidgetType == NS_THEME_MENULIST_BUTTON)
{
DrawThemeBGRTLAware(theme, hdc, part, state,
&widgetRect, &clipRect, IsFrameRTL(aFrame));
@ -1875,8 +1875,8 @@ RENDER_AGAIN:
SetPixel(hdc, widgetRect.right-1, widgetRect.bottom-1, color);
SetPixel(hdc, widgetRect.left, widgetRect.bottom-1, color);
}
else if (aWidgetType == NS_THEME_PROGRESSBAR_CHUNK ||
aWidgetType == NS_THEME_PROGRESSBAR_CHUNK_VERTICAL) {
else if (aWidgetType == NS_THEME_PROGRESSCHUNK ||
aWidgetType == NS_THEME_PROGRESSCHUNK_VERTICAL) {
DrawThemedProgressMeter(aFrame, aWidgetType, theme, hdc, part, state,
&widgetRect, &clipRect, p2a);
}
@ -1966,14 +1966,14 @@ RENDER_AGAIN:
widgetRect.bottom = widgetRect.top + TB_SEPARATOR_HEIGHT;
DrawThemeEdge(theme, hdc, RP_BAND, 0, &widgetRect, EDGE_ETCHED, BF_TOP, nullptr);
}
else if (aWidgetType == NS_THEME_SCROLLBAR_THUMB_HORIZONTAL ||
aWidgetType == NS_THEME_SCROLLBAR_THUMB_VERTICAL)
else if (aWidgetType == NS_THEME_SCROLLBARTHUMB_HORIZONTAL ||
aWidgetType == NS_THEME_SCROLLBARTHUMB_VERTICAL)
{
// Draw the decorative gripper for the scrollbar thumb button, if it fits
SIZE gripSize;
MARGINS thumbMgns;
int gripPart = (aWidgetType == NS_THEME_SCROLLBAR_THUMB_HORIZONTAL) ?
int gripPart = (aWidgetType == NS_THEME_SCROLLBARTHUMB_HORIZONTAL) ?
SP_GRIPPERHOR : SP_GRIPPERVERT;
if (GetThemePartSize(theme, hdc, gripPart, state, nullptr, TS_TRUE, &gripSize) == S_OK &&
@ -2037,15 +2037,15 @@ nsNativeThemeWin::GetWidgetBorder(nsDeviceContext* aContext,
aWidgetType == NS_THEME_TOOLBOX ||
aWidgetType == NS_THEME_WIN_MEDIA_TOOLBOX ||
aWidgetType == NS_THEME_WIN_COMMUNICATIONS_TOOLBOX ||
aWidgetType == NS_THEME_WIN_BROWSER_TAB_BAR_TOOLBOX ||
aWidgetType == NS_THEME_WIN_BROWSERTABBAR_TOOLBOX ||
aWidgetType == NS_THEME_STATUSBAR ||
aWidgetType == NS_THEME_RESIZER || aWidgetType == NS_THEME_TAB_PANEL ||
aWidgetType == NS_THEME_RESIZER || aWidgetType == NS_THEME_TABPANEL ||
aWidgetType == NS_THEME_SCROLLBAR_HORIZONTAL ||
aWidgetType == NS_THEME_SCROLLBAR_VERTICAL ||
aWidgetType == NS_THEME_MENUITEM || aWidgetType == NS_THEME_CHECKMENUITEM ||
aWidgetType == NS_THEME_RADIOMENUITEM || aWidgetType == NS_THEME_MENUPOPUP ||
aWidgetType == NS_THEME_MENUIMAGE || aWidgetType == NS_THEME_MENUITEMTEXT ||
aWidgetType == NS_THEME_TOOLBAR_SEPARATOR ||
aWidgetType == NS_THEME_SEPARATOR ||
aWidgetType == NS_THEME_WINDOW_TITLEBAR ||
aWidgetType == NS_THEME_WINDOW_TITLEBAR_MAXIMIZED ||
aWidgetType == NS_THEME_WIN_GLASS || aWidgetType == NS_THEME_WIN_BORDERLESS_GLASS)
@ -2176,7 +2176,7 @@ nsNativeThemeWin::GetWidgetPadding(nsDeviceContext* aContext,
if (aWidgetType == NS_THEME_NUMBER_INPUT ||
aWidgetType == NS_THEME_TEXTFIELD ||
aWidgetType == NS_THEME_TEXTFIELD_MULTILINE ||
aWidgetType == NS_THEME_DROPDOWN)
aWidgetType == NS_THEME_MENULIST)
{
/* If we have author-specified padding for these elements, don't do the fixups below */
if (aFrame->PresContext()->HasAuthorSpecifiedRules(aFrame, NS_AUTHOR_SPECIFIED_PADDING))
@ -2196,7 +2196,7 @@ nsNativeThemeWin::GetWidgetPadding(nsDeviceContext* aContext,
aResult->left = aResult->right = 2;
ScaleForFrameDPI(aResult, aFrame);
return ok;
} else if (IsHTMLContent(aFrame) && aWidgetType == NS_THEME_DROPDOWN) {
} else if (IsHTMLContent(aFrame) && aWidgetType == NS_THEME_MENULIST) {
/* For content menulist controls, we need an extra pixel so
* that we have room to draw our focus rectangle stuff.
* Otherwise, the focus rect might overlap the control's
@ -2276,11 +2276,11 @@ nsNativeThemeWin::GetWidgetOverflow(nsDeviceContext* aContext,
* up, right, and bottom so that they overlap the dropdown's border
* like they're supposed to.
*/
if (aWidgetType == NS_THEME_DROPDOWN_BUTTON &&
if (aWidgetType == NS_THEME_MENULIST_BUTTON &&
IsHTMLContent(aFrame) &&
!IsWidgetStyled(aFrame->GetParent()->PresContext(),
aFrame->GetParent(),
NS_THEME_DROPDOWN))
NS_THEME_MENULIST))
{
int32_t p2a = aContext->AppUnitsPerDevPixel();
/* Note: no overflow on the left */
@ -2330,13 +2330,13 @@ nsNativeThemeWin::GetMinimumWidgetSize(nsPresContext* aPresContext, nsIFrame* aF
case NS_THEME_TOOLBOX:
case NS_THEME_WIN_MEDIA_TOOLBOX:
case NS_THEME_WIN_COMMUNICATIONS_TOOLBOX:
case NS_THEME_WIN_BROWSER_TAB_BAR_TOOLBOX:
case NS_THEME_WIN_BROWSERTABBAR_TOOLBOX:
case NS_THEME_TOOLBAR:
case NS_THEME_STATUSBAR:
case NS_THEME_PROGRESSBAR_CHUNK:
case NS_THEME_PROGRESSBAR_CHUNK_VERTICAL:
case NS_THEME_TAB_PANELS:
case NS_THEME_TAB_PANEL:
case NS_THEME_PROGRESSCHUNK:
case NS_THEME_PROGRESSCHUNK_VERTICAL:
case NS_THEME_TABPANELS:
case NS_THEME_TABPANEL:
case NS_THEME_LISTBOX:
case NS_THEME_TREEVIEW:
case NS_THEME_MENUITEMTEXT:
@ -2353,15 +2353,15 @@ nsNativeThemeWin::GetMinimumWidgetSize(nsPresContext* aPresContext, nsIFrame* aF
// Windows appears to always use metrics when drawing standard scrollbars)
THEMESIZE sizeReq = TS_TRUE; // Best-fit size
switch (aWidgetType) {
case NS_THEME_SCROLLBAR_THUMB_VERTICAL:
case NS_THEME_SCROLLBAR_THUMB_HORIZONTAL:
case NS_THEME_SCROLLBAR_BUTTON_UP:
case NS_THEME_SCROLLBAR_BUTTON_DOWN:
case NS_THEME_SCROLLBAR_BUTTON_LEFT:
case NS_THEME_SCROLLBAR_BUTTON_RIGHT:
case NS_THEME_SCROLLBARTHUMB_VERTICAL:
case NS_THEME_SCROLLBARTHUMB_HORIZONTAL:
case NS_THEME_SCROLLBARBUTTON_UP:
case NS_THEME_SCROLLBARBUTTON_DOWN:
case NS_THEME_SCROLLBARBUTTON_LEFT:
case NS_THEME_SCROLLBARBUTTON_RIGHT:
case NS_THEME_SCROLLBAR_HORIZONTAL:
case NS_THEME_SCROLLBAR_VERTICAL:
case NS_THEME_DROPDOWN_BUTTON: {
case NS_THEME_MENULIST_BUTTON: {
rv = ClassicGetMinimumWidgetSize(aFrame, aWidgetType, aResult, aIsOverridable);
ScaleForFrameDPI(aResult, aFrame);
return rv;
@ -2407,14 +2407,14 @@ nsNativeThemeWin::GetMinimumWidgetSize(nsPresContext* aPresContext, nsIFrame* aF
break;
case NS_THEME_RANGE_THUMB:
case NS_THEME_SCALE_THUMB_HORIZONTAL:
case NS_THEME_SCALE_THUMB_VERTICAL:
case NS_THEME_SCALETHUMB_HORIZONTAL:
case NS_THEME_SCALETHUMB_VERTICAL:
{
*aIsOverridable = false;
// on Vista, GetThemePartAndState returns odd values for
// scale thumbs, so use a hardcoded size instead.
if (IsVistaOrLater()) {
if (aWidgetType == NS_THEME_SCALE_THUMB_HORIZONTAL ||
if (aWidgetType == NS_THEME_SCALETHUMB_HORIZONTAL ||
(aWidgetType == NS_THEME_RANGE_THUMB && IsRangeHorizontal(aFrame))) {
aResult->width = 12;
aResult->height = 20;
@ -2441,7 +2441,7 @@ nsNativeThemeWin::GetMinimumWidgetSize(nsPresContext* aPresContext, nsIFrame* aF
break;
}
case NS_THEME_TOOLBAR_SEPARATOR:
case NS_THEME_SEPARATOR:
// that's 2px left margin, 2px right margin and 2px separator
// (the margin is drawn as part of the separator, though)
aResult->width = 6;
@ -2553,8 +2553,8 @@ nsNativeThemeWin::GetMinimumWidgetSize(nsPresContext* aPresContext, nsIFrame* aF
aResult->height = sz.cy;
switch(aWidgetType) {
case NS_THEME_SPINNER_UP_BUTTON:
case NS_THEME_SPINNER_DOWN_BUTTON:
case NS_THEME_SPINNER_UPBUTTON:
case NS_THEME_SPINNER_DOWNBUTTON:
aResult->width++;
aResult->height = aResult->height / 2 + 1;
break;
@ -2590,18 +2590,18 @@ nsNativeThemeWin::WidgetStateChanged(nsIFrame* aFrame, uint8_t aWidgetType,
if (aWidgetType == NS_THEME_TOOLBOX ||
aWidgetType == NS_THEME_WIN_MEDIA_TOOLBOX ||
aWidgetType == NS_THEME_WIN_COMMUNICATIONS_TOOLBOX ||
aWidgetType == NS_THEME_WIN_BROWSER_TAB_BAR_TOOLBOX ||
aWidgetType == NS_THEME_WIN_BROWSERTABBAR_TOOLBOX ||
aWidgetType == NS_THEME_TOOLBAR ||
aWidgetType == NS_THEME_STATUSBAR || aWidgetType == NS_THEME_STATUSBAR_PANEL ||
aWidgetType == NS_THEME_STATUSBAR_RESIZER_PANEL ||
aWidgetType == NS_THEME_PROGRESSBAR_CHUNK ||
aWidgetType == NS_THEME_PROGRESSBAR_CHUNK_VERTICAL ||
aWidgetType == NS_THEME_STATUSBAR || aWidgetType == NS_THEME_STATUSBARPANEL ||
aWidgetType == NS_THEME_RESIZER_PANEL ||
aWidgetType == NS_THEME_PROGRESSCHUNK ||
aWidgetType == NS_THEME_PROGRESSCHUNK_VERTICAL ||
aWidgetType == NS_THEME_PROGRESSBAR ||
aWidgetType == NS_THEME_PROGRESSBAR_VERTICAL ||
aWidgetType == NS_THEME_TOOLTIP ||
aWidgetType == NS_THEME_TAB_PANELS ||
aWidgetType == NS_THEME_TAB_PANEL ||
aWidgetType == NS_THEME_TOOLBAR_SEPARATOR ||
aWidgetType == NS_THEME_TABPANELS ||
aWidgetType == NS_THEME_TABPANEL ||
aWidgetType == NS_THEME_SEPARATOR ||
aWidgetType == NS_THEME_WIN_GLASS ||
aWidgetType == NS_THEME_WIN_BORDERLESS_GLASS) {
*aShouldRepaint = false;
@ -2632,7 +2632,7 @@ nsNativeThemeWin::WidgetStateChanged(nsIFrame* aFrame, uint8_t aWidgetType,
// We need to repaint the dropdown arrow in vista HTML combobox controls when
// the control is closed to get rid of the hover effect.
if (IsVistaOrLater() &&
(aWidgetType == NS_THEME_DROPDOWN || aWidgetType == NS_THEME_DROPDOWN_BUTTON) &&
(aWidgetType == NS_THEME_MENULIST || aWidgetType == NS_THEME_MENULIST_BUTTON) &&
IsHTMLContent(aFrame))
{
*aShouldRepaint = true;
@ -2708,7 +2708,7 @@ bool
nsNativeThemeWin::WidgetIsContainer(uint8_t aWidgetType)
{
// XXXdwh At some point flesh all of this out.
if (aWidgetType == NS_THEME_DROPDOWN_BUTTON ||
if (aWidgetType == NS_THEME_MENULIST_BUTTON ||
aWidgetType == NS_THEME_RADIO ||
aWidgetType == NS_THEME_CHECKBOX)
return false;
@ -2783,8 +2783,8 @@ nsNativeThemeWin::GetWidgetTransparency(nsIFrame* aFrame, uint8_t aWidgetType)
case NS_THEME_SCALE_VERTICAL:
case NS_THEME_PROGRESSBAR:
case NS_THEME_PROGRESSBAR_VERTICAL:
case NS_THEME_PROGRESSBAR_CHUNK:
case NS_THEME_PROGRESSBAR_CHUNK_VERTICAL:
case NS_THEME_PROGRESSCHUNK:
case NS_THEME_PROGRESSCHUNK_VERTICAL:
case NS_THEME_RANGE:
return eTransparent;
}
@ -2844,37 +2844,37 @@ nsNativeThemeWin::ClassicThemeSupportsWidget(nsIFrame* aFrame,
case NS_THEME_RANGE:
case NS_THEME_RANGE_THUMB:
case NS_THEME_GROUPBOX:
case NS_THEME_SCROLLBAR_BUTTON_UP:
case NS_THEME_SCROLLBAR_BUTTON_DOWN:
case NS_THEME_SCROLLBAR_BUTTON_LEFT:
case NS_THEME_SCROLLBAR_BUTTON_RIGHT:
case NS_THEME_SCROLLBAR_THUMB_VERTICAL:
case NS_THEME_SCROLLBAR_THUMB_HORIZONTAL:
case NS_THEME_SCROLLBARBUTTON_UP:
case NS_THEME_SCROLLBARBUTTON_DOWN:
case NS_THEME_SCROLLBARBUTTON_LEFT:
case NS_THEME_SCROLLBARBUTTON_RIGHT:
case NS_THEME_SCROLLBARTHUMB_VERTICAL:
case NS_THEME_SCROLLBARTHUMB_HORIZONTAL:
case NS_THEME_SCROLLBAR_VERTICAL:
case NS_THEME_SCROLLBAR_HORIZONTAL:
case NS_THEME_SCROLLBAR_NON_DISAPPEARING:
case NS_THEME_SCALE_HORIZONTAL:
case NS_THEME_SCALE_VERTICAL:
case NS_THEME_SCALE_THUMB_HORIZONTAL:
case NS_THEME_SCALE_THUMB_VERTICAL:
case NS_THEME_DROPDOWN_BUTTON:
case NS_THEME_SPINNER_UP_BUTTON:
case NS_THEME_SPINNER_DOWN_BUTTON:
case NS_THEME_SCALETHUMB_HORIZONTAL:
case NS_THEME_SCALETHUMB_VERTICAL:
case NS_THEME_MENULIST_BUTTON:
case NS_THEME_SPINNER_UPBUTTON:
case NS_THEME_SPINNER_DOWNBUTTON:
case NS_THEME_LISTBOX:
case NS_THEME_TREEVIEW:
case NS_THEME_DROPDOWN_TEXTFIELD:
case NS_THEME_DROPDOWN:
case NS_THEME_MENULIST_TEXTFIELD:
case NS_THEME_MENULIST:
case NS_THEME_TOOLTIP:
case NS_THEME_STATUSBAR:
case NS_THEME_STATUSBAR_PANEL:
case NS_THEME_STATUSBAR_RESIZER_PANEL:
case NS_THEME_STATUSBARPANEL:
case NS_THEME_RESIZER_PANEL:
case NS_THEME_PROGRESSBAR:
case NS_THEME_PROGRESSBAR_VERTICAL:
case NS_THEME_PROGRESSBAR_CHUNK:
case NS_THEME_PROGRESSBAR_CHUNK_VERTICAL:
case NS_THEME_PROGRESSCHUNK:
case NS_THEME_PROGRESSCHUNK_VERTICAL:
case NS_THEME_TAB:
case NS_THEME_TAB_PANEL:
case NS_THEME_TAB_PANELS:
case NS_THEME_TABPANEL:
case NS_THEME_TABPANELS:
case NS_THEME_MENUITEM:
case NS_THEME_CHECKMENUITEM:
case NS_THEME_RADIOMENUITEM:
@ -2916,8 +2916,8 @@ nsNativeThemeWin::ClassicGetWidgetBorder(nsDeviceContext* aContext,
break;
case NS_THEME_LISTBOX:
case NS_THEME_TREEVIEW:
case NS_THEME_DROPDOWN:
case NS_THEME_DROPDOWN_TEXTFIELD:
case NS_THEME_MENULIST:
case NS_THEME_MENULIST_TEXTFIELD:
case NS_THEME_TAB:
case NS_THEME_NUMBER_INPUT:
case NS_THEME_TEXTFIELD:
@ -2925,8 +2925,8 @@ nsNativeThemeWin::ClassicGetWidgetBorder(nsDeviceContext* aContext,
case NS_THEME_FOCUS_OUTLINE:
(*aResult).top = (*aResult).left = (*aResult).bottom = (*aResult).right = 2;
break;
case NS_THEME_STATUSBAR_PANEL:
case NS_THEME_STATUSBAR_RESIZER_PANEL: {
case NS_THEME_STATUSBARPANEL:
case NS_THEME_RESIZER_PANEL: {
(*aResult).top = 1;
(*aResult).left = 1;
(*aResult).bottom = 1;
@ -3013,20 +3013,20 @@ nsNativeThemeWin::ClassicGetMinimumWidgetSize(nsIFrame* aFrame,
(*aResult).width = ::GetSystemMetrics(SM_CXMENUCHECK);
(*aResult).height = ::GetSystemMetrics(SM_CYMENUCHECK);
break;
case NS_THEME_SPINNER_UP_BUTTON:
case NS_THEME_SPINNER_DOWN_BUTTON:
case NS_THEME_SPINNER_UPBUTTON:
case NS_THEME_SPINNER_DOWNBUTTON:
(*aResult).width = ::GetSystemMetrics(SM_CXVSCROLL);
(*aResult).height = 8; // No good metrics available for this
*aIsOverridable = false;
break;
case NS_THEME_SCROLLBAR_BUTTON_UP:
case NS_THEME_SCROLLBAR_BUTTON_DOWN:
case NS_THEME_SCROLLBARBUTTON_UP:
case NS_THEME_SCROLLBARBUTTON_DOWN:
(*aResult).width = ::GetSystemMetrics(SM_CXVSCROLL);
(*aResult).height = ::GetSystemMetrics(SM_CYVSCROLL);
*aIsOverridable = false;
break;
case NS_THEME_SCROLLBAR_BUTTON_LEFT:
case NS_THEME_SCROLLBAR_BUTTON_RIGHT:
case NS_THEME_SCROLLBARBUTTON_LEFT:
case NS_THEME_SCROLLBARBUTTON_RIGHT:
(*aResult).width = ::GetSystemMetrics(SM_CXHSCROLL);
(*aResult).height = ::GetSystemMetrics(SM_CYHSCROLL);
*aIsOverridable = false;
@ -3055,20 +3055,20 @@ nsNativeThemeWin::ClassicGetMinimumWidgetSize(nsIFrame* aFrame,
*aIsOverridable = false;
break;
}
case NS_THEME_SCALE_THUMB_HORIZONTAL:
case NS_THEME_SCALETHUMB_HORIZONTAL:
(*aResult).width = 12;
(*aResult).height = 20;
*aIsOverridable = false;
break;
case NS_THEME_SCALE_THUMB_VERTICAL:
case NS_THEME_SCALETHUMB_VERTICAL:
(*aResult).width = 20;
(*aResult).height = 12;
*aIsOverridable = false;
break;
case NS_THEME_DROPDOWN_BUTTON:
case NS_THEME_MENULIST_BUTTON:
(*aResult).width = ::GetSystemMetrics(SM_CXVSCROLL);
break;
case NS_THEME_DROPDOWN:
case NS_THEME_MENULIST:
case NS_THEME_BUTTON:
case NS_THEME_GROUPBOX:
case NS_THEME_LISTBOX:
@ -3076,18 +3076,18 @@ nsNativeThemeWin::ClassicGetMinimumWidgetSize(nsIFrame* aFrame,
case NS_THEME_NUMBER_INPUT:
case NS_THEME_TEXTFIELD:
case NS_THEME_TEXTFIELD_MULTILINE:
case NS_THEME_DROPDOWN_TEXTFIELD:
case NS_THEME_MENULIST_TEXTFIELD:
case NS_THEME_STATUSBAR:
case NS_THEME_STATUSBAR_PANEL:
case NS_THEME_STATUSBAR_RESIZER_PANEL:
case NS_THEME_PROGRESSBAR_CHUNK:
case NS_THEME_PROGRESSBAR_CHUNK_VERTICAL:
case NS_THEME_STATUSBARPANEL:
case NS_THEME_RESIZER_PANEL:
case NS_THEME_PROGRESSCHUNK:
case NS_THEME_PROGRESSCHUNK_VERTICAL:
case NS_THEME_TOOLTIP:
case NS_THEME_PROGRESSBAR:
case NS_THEME_PROGRESSBAR_VERTICAL:
case NS_THEME_TAB:
case NS_THEME_TAB_PANEL:
case NS_THEME_TAB_PANELS:
case NS_THEME_TABPANEL:
case NS_THEME_TABPANELS:
// no minimum widget size
break;
case NS_THEME_RESIZER: {
@ -3099,7 +3099,7 @@ nsNativeThemeWin::ClassicGetMinimumWidgetSize(nsIFrame* aFrame,
(*aResult).width = (*aResult).height = 15;
*aIsOverridable = false;
break;
case NS_THEME_SCROLLBAR_THUMB_VERTICAL:
case NS_THEME_SCROLLBARTHUMB_VERTICAL:
(*aResult).width = ::GetSystemMetrics(SM_CXVSCROLL);
(*aResult).height = ::GetSystemMetrics(SM_CYVTHUMB);
// Without theming, divide the thumb size by two in order to look more
@ -3108,7 +3108,7 @@ nsNativeThemeWin::ClassicGetMinimumWidgetSize(nsIFrame* aFrame,
(*aResult).height >>= 1;
*aIsOverridable = false;
break;
case NS_THEME_SCROLLBAR_THUMB_HORIZONTAL:
case NS_THEME_SCROLLBARTHUMB_HORIZONTAL:
(*aResult).width = ::GetSystemMetrics(SM_CXHTHUMB);
(*aResult).height = ::GetSystemMetrics(SM_CYHSCROLL);
// Without theming, divide the thumb size by two in order to look more
@ -3316,35 +3316,35 @@ nsresult nsNativeThemeWin::ClassicGetThemePartAndState(nsIFrame* aFrame, uint8_t
case NS_THEME_FOCUS_OUTLINE:
case NS_THEME_TEXTFIELD:
case NS_THEME_TEXTFIELD_MULTILINE:
case NS_THEME_DROPDOWN:
case NS_THEME_DROPDOWN_TEXTFIELD:
case NS_THEME_MENULIST:
case NS_THEME_MENULIST_TEXTFIELD:
case NS_THEME_RANGE:
case NS_THEME_RANGE_THUMB:
case NS_THEME_SCROLLBAR_THUMB_VERTICAL:
case NS_THEME_SCROLLBAR_THUMB_HORIZONTAL:
case NS_THEME_SCROLLBARTHUMB_VERTICAL:
case NS_THEME_SCROLLBARTHUMB_HORIZONTAL:
case NS_THEME_SCROLLBAR_VERTICAL:
case NS_THEME_SCROLLBAR_HORIZONTAL:
case NS_THEME_SCALE_HORIZONTAL:
case NS_THEME_SCALE_VERTICAL:
case NS_THEME_SCALE_THUMB_HORIZONTAL:
case NS_THEME_SCALE_THUMB_VERTICAL:
case NS_THEME_SCALETHUMB_HORIZONTAL:
case NS_THEME_SCALETHUMB_VERTICAL:
case NS_THEME_STATUSBAR:
case NS_THEME_STATUSBAR_PANEL:
case NS_THEME_STATUSBAR_RESIZER_PANEL:
case NS_THEME_PROGRESSBAR_CHUNK:
case NS_THEME_PROGRESSBAR_CHUNK_VERTICAL:
case NS_THEME_STATUSBARPANEL:
case NS_THEME_RESIZER_PANEL:
case NS_THEME_PROGRESSCHUNK:
case NS_THEME_PROGRESSCHUNK_VERTICAL:
case NS_THEME_TOOLTIP:
case NS_THEME_PROGRESSBAR:
case NS_THEME_PROGRESSBAR_VERTICAL:
case NS_THEME_TAB:
case NS_THEME_TAB_PANEL:
case NS_THEME_TAB_PANELS:
case NS_THEME_TABPANEL:
case NS_THEME_TABPANELS:
case NS_THEME_MENUBAR:
case NS_THEME_MENUPOPUP:
case NS_THEME_GROUPBOX:
// these don't use DrawFrameControl
return NS_OK;
case NS_THEME_DROPDOWN_BUTTON: {
case NS_THEME_MENULIST_BUTTON: {
aPart = DFC_SCROLL;
aState = DFCS_SCROLLCOMBOBOX;
@ -3383,24 +3383,24 @@ nsresult nsNativeThemeWin::ClassicGetThemePartAndState(nsIFrame* aFrame, uint8_t
return NS_OK;
}
case NS_THEME_SCROLLBAR_BUTTON_UP:
case NS_THEME_SCROLLBAR_BUTTON_DOWN:
case NS_THEME_SCROLLBAR_BUTTON_LEFT:
case NS_THEME_SCROLLBAR_BUTTON_RIGHT: {
case NS_THEME_SCROLLBARBUTTON_UP:
case NS_THEME_SCROLLBARBUTTON_DOWN:
case NS_THEME_SCROLLBARBUTTON_LEFT:
case NS_THEME_SCROLLBARBUTTON_RIGHT: {
EventStates contentState = GetContentState(aFrame, aWidgetType);
aPart = DFC_SCROLL;
switch (aWidgetType) {
case NS_THEME_SCROLLBAR_BUTTON_UP:
case NS_THEME_SCROLLBARBUTTON_UP:
aState = DFCS_SCROLLUP;
break;
case NS_THEME_SCROLLBAR_BUTTON_DOWN:
case NS_THEME_SCROLLBARBUTTON_DOWN:
aState = DFCS_SCROLLDOWN;
break;
case NS_THEME_SCROLLBAR_BUTTON_LEFT:
case NS_THEME_SCROLLBARBUTTON_LEFT:
aState = DFCS_SCROLLLEFT;
break;
case NS_THEME_SCROLLBAR_BUTTON_RIGHT:
case NS_THEME_SCROLLBARBUTTON_RIGHT:
aState = DFCS_SCROLLRIGHT;
break;
}
@ -3414,16 +3414,16 @@ nsresult nsNativeThemeWin::ClassicGetThemePartAndState(nsIFrame* aFrame, uint8_t
return NS_OK;
}
case NS_THEME_SPINNER_UP_BUTTON:
case NS_THEME_SPINNER_DOWN_BUTTON: {
case NS_THEME_SPINNER_UPBUTTON:
case NS_THEME_SPINNER_DOWNBUTTON: {
EventStates contentState = GetContentState(aFrame, aWidgetType);
aPart = DFC_SCROLL;
switch (aWidgetType) {
case NS_THEME_SPINNER_UP_BUTTON:
case NS_THEME_SPINNER_UPBUTTON:
aState = DFCS_SCROLLUP;
break;
case NS_THEME_SPINNER_DOWN_BUTTON:
case NS_THEME_SPINNER_DOWNBUTTON:
aState = DFCS_SCROLLDOWN;
break;
}
@ -3719,13 +3719,13 @@ RENDER_AGAIN:
// Draw controls supported by DrawFrameControl
case NS_THEME_CHECKBOX:
case NS_THEME_RADIO:
case NS_THEME_SCROLLBAR_BUTTON_UP:
case NS_THEME_SCROLLBAR_BUTTON_DOWN:
case NS_THEME_SCROLLBAR_BUTTON_LEFT:
case NS_THEME_SCROLLBAR_BUTTON_RIGHT:
case NS_THEME_SPINNER_UP_BUTTON:
case NS_THEME_SPINNER_DOWN_BUTTON:
case NS_THEME_DROPDOWN_BUTTON:
case NS_THEME_SCROLLBARBUTTON_UP:
case NS_THEME_SCROLLBARBUTTON_DOWN:
case NS_THEME_SCROLLBARBUTTON_LEFT:
case NS_THEME_SCROLLBARBUTTON_RIGHT:
case NS_THEME_SPINNER_UPBUTTON:
case NS_THEME_SPINNER_DOWNBUTTON:
case NS_THEME_MENULIST_BUTTON:
case NS_THEME_RESIZER: {
int32_t oldTA;
// setup DC to make DrawFrameControl draw correctly
@ -3753,8 +3753,8 @@ RENDER_AGAIN:
case NS_THEME_TEXTFIELD:
case NS_THEME_TEXTFIELD_MULTILINE:
case NS_THEME_LISTBOX:
case NS_THEME_DROPDOWN:
case NS_THEME_DROPDOWN_TEXTFIELD: {
case NS_THEME_MENULIST:
case NS_THEME_MENULIST_TEXTFIELD: {
// Draw inset edge
::DrawEdge(hdc, &widgetRect, EDGE_SUNKEN, BF_RECT | BF_ADJUST);
EventStates eventState = GetContentState(aFrame, aWidgetType);
@ -3796,15 +3796,15 @@ RENDER_AGAIN:
::DrawEdge(hdc, &widgetRect, BDR_SUNKENOUTER, BF_RECT | BF_MIDDLE);
InflateRect(&widgetRect, -1, -1);
// fall through
case NS_THEME_TAB_PANEL:
case NS_THEME_TABPANEL:
case NS_THEME_STATUSBAR:
case NS_THEME_STATUSBAR_RESIZER_PANEL: {
case NS_THEME_RESIZER_PANEL: {
::FillRect(hdc, &widgetRect, (HBRUSH) (COLOR_BTNFACE+1));
break;
}
// Draw 3D inset statusbar panel
case NS_THEME_STATUSBAR_PANEL: {
case NS_THEME_STATUSBARPANEL: {
if (aFrame->GetNextSibling())
widgetRect.right -= 2; // space between sibling status panels
@ -3813,14 +3813,14 @@ RENDER_AGAIN:
break;
}
// Draw scrollbar thumb
case NS_THEME_SCROLLBAR_THUMB_VERTICAL:
case NS_THEME_SCROLLBAR_THUMB_HORIZONTAL:
case NS_THEME_SCROLLBARTHUMB_VERTICAL:
case NS_THEME_SCROLLBARTHUMB_HORIZONTAL:
::DrawEdge(hdc, &widgetRect, EDGE_RAISED, BF_RECT | BF_MIDDLE);
break;
case NS_THEME_RANGE_THUMB:
case NS_THEME_SCALE_THUMB_VERTICAL:
case NS_THEME_SCALE_THUMB_HORIZONTAL: {
case NS_THEME_SCALETHUMB_VERTICAL:
case NS_THEME_SCALETHUMB_HORIZONTAL: {
EventStates eventState = GetContentState(aFrame, aWidgetType);
::DrawEdge(hdc, &widgetRect, EDGE_RAISED, BF_RECT | BF_SOFT | BF_MIDDLE | BF_ADJUST);
@ -3883,17 +3883,17 @@ RENDER_AGAIN:
break;
}
case NS_THEME_PROGRESSBAR_CHUNK_VERTICAL:
case NS_THEME_PROGRESSCHUNK_VERTICAL:
::FillRect(hdc, &widgetRect, (HBRUSH) (COLOR_HIGHLIGHT+1));
break;
case NS_THEME_PROGRESSBAR_CHUNK: {
case NS_THEME_PROGRESSCHUNK: {
nsIFrame* stateFrame = aFrame->GetParent();
EventStates eventStates = GetContentState(stateFrame, aWidgetType);
bool indeterminate = IsIndeterminateProgress(stateFrame, eventStates);
bool vertical = IsVerticalProgress(stateFrame) ||
aWidgetType == NS_THEME_PROGRESSBAR_CHUNK_VERTICAL;
aWidgetType == NS_THEME_PROGRESSCHUNK_VERTICAL;
nsIContent* content = aFrame->GetContent();
if (!indeterminate || !content) {
@ -3923,7 +3923,7 @@ RENDER_AGAIN:
break;
}
case NS_THEME_TAB_PANELS:
case NS_THEME_TABPANELS:
::DrawEdge(hdc, &widgetRect, EDGE_RAISED, BF_SOFT | BF_MIDDLE |
BF_LEFT | BF_RIGHT | BF_BOTTOM);
@ -4119,8 +4119,8 @@ nsNativeThemeWin::GetWidgetNativeDrawingFlags(uint8_t aWidgetType)
case NS_THEME_TEXTFIELD:
case NS_THEME_TEXTFIELD_MULTILINE:
case NS_THEME_DROPDOWN:
case NS_THEME_DROPDOWN_TEXTFIELD:
case NS_THEME_MENULIST:
case NS_THEME_MENULIST_TEXTFIELD:
return
gfxWindowsNativeDrawing::CANNOT_DRAW_TO_COLOR_ALPHA |
gfxWindowsNativeDrawing::CAN_AXIS_ALIGNED_SCALE |
@ -4129,34 +4129,34 @@ nsNativeThemeWin::GetWidgetNativeDrawingFlags(uint8_t aWidgetType)
// need to check these others
case NS_THEME_RANGE:
case NS_THEME_RANGE_THUMB:
case NS_THEME_SCROLLBAR_BUTTON_UP:
case NS_THEME_SCROLLBAR_BUTTON_DOWN:
case NS_THEME_SCROLLBAR_BUTTON_LEFT:
case NS_THEME_SCROLLBAR_BUTTON_RIGHT:
case NS_THEME_SCROLLBAR_THUMB_VERTICAL:
case NS_THEME_SCROLLBAR_THUMB_HORIZONTAL:
case NS_THEME_SCROLLBARBUTTON_UP:
case NS_THEME_SCROLLBARBUTTON_DOWN:
case NS_THEME_SCROLLBARBUTTON_LEFT:
case NS_THEME_SCROLLBARBUTTON_RIGHT:
case NS_THEME_SCROLLBARTHUMB_VERTICAL:
case NS_THEME_SCROLLBARTHUMB_HORIZONTAL:
case NS_THEME_SCROLLBAR_VERTICAL:
case NS_THEME_SCROLLBAR_HORIZONTAL:
case NS_THEME_SCALE_HORIZONTAL:
case NS_THEME_SCALE_VERTICAL:
case NS_THEME_SCALE_THUMB_HORIZONTAL:
case NS_THEME_SCALE_THUMB_VERTICAL:
case NS_THEME_SPINNER_UP_BUTTON:
case NS_THEME_SPINNER_DOWN_BUTTON:
case NS_THEME_SCALETHUMB_HORIZONTAL:
case NS_THEME_SCALETHUMB_VERTICAL:
case NS_THEME_SPINNER_UPBUTTON:
case NS_THEME_SPINNER_DOWNBUTTON:
case NS_THEME_LISTBOX:
case NS_THEME_TREEVIEW:
case NS_THEME_TOOLTIP:
case NS_THEME_STATUSBAR:
case NS_THEME_STATUSBAR_PANEL:
case NS_THEME_STATUSBAR_RESIZER_PANEL:
case NS_THEME_STATUSBARPANEL:
case NS_THEME_RESIZER_PANEL:
case NS_THEME_RESIZER:
case NS_THEME_PROGRESSBAR:
case NS_THEME_PROGRESSBAR_VERTICAL:
case NS_THEME_PROGRESSBAR_CHUNK:
case NS_THEME_PROGRESSBAR_CHUNK_VERTICAL:
case NS_THEME_PROGRESSCHUNK:
case NS_THEME_PROGRESSCHUNK_VERTICAL:
case NS_THEME_TAB:
case NS_THEME_TAB_PANEL:
case NS_THEME_TAB_PANELS:
case NS_THEME_TABPANEL:
case NS_THEME_TABPANELS:
case NS_THEME_MENUBAR:
case NS_THEME_MENUPOPUP:
case NS_THEME_MENUITEM:
@ -4165,7 +4165,7 @@ nsNativeThemeWin::GetWidgetNativeDrawingFlags(uint8_t aWidgetType)
// the dropdown button /almost/ renders correctly with scaling,
// except that the graphic in the dropdown button (the downward arrow)
// doesn't get scaled up.
case NS_THEME_DROPDOWN_BUTTON:
case NS_THEME_MENULIST_BUTTON:
// these are definitely no; they're all graphics that don't get scaled up
case NS_THEME_CHECKBOX:
case NS_THEME_RADIO: