forked from mirrors/gecko-dev
Bug 1858349 - Remove now-unused menuarrow code. r=spohl,mac-reviewers,win-reviewers,rkraesig
The windows bits were already unused. Depends on D190663 Differential Revision: https://phabricator.services.mozilla.com/D190664
This commit is contained in:
parent
251ed99a11
commit
0cc423b3e3
8 changed files with 122 additions and 120 deletions
|
|
@ -45,7 +45,6 @@ const NON_CONTENT_ACCESSIBLE_VALUES = {
|
||||||
"menucheckbox",
|
"menucheckbox",
|
||||||
"menuradio",
|
"menuradio",
|
||||||
"menuseparator",
|
"menuseparator",
|
||||||
"menuarrow",
|
|
||||||
"menuimage",
|
"menuimage",
|
||||||
"-moz-menulist-arrow-button",
|
"-moz-menulist-arrow-button",
|
||||||
"checkbox-container",
|
"checkbox-container",
|
||||||
|
|
|
||||||
|
|
@ -1491,9 +1491,6 @@ pub enum Appearance {
|
||||||
/// Menu Popup background.
|
/// Menu Popup background.
|
||||||
#[parse(condition = "ParserContext::chrome_rules_enabled")]
|
#[parse(condition = "ParserContext::chrome_rules_enabled")]
|
||||||
Menupopup,
|
Menupopup,
|
||||||
/// Menu item arrow.
|
|
||||||
#[parse(condition = "ParserContext::chrome_rules_enabled")]
|
|
||||||
Menuarrow,
|
|
||||||
/// The meter bar's meter indicator.
|
/// The meter bar's meter indicator.
|
||||||
#[parse(condition = "ParserContext::chrome_rules_enabled")]
|
#[parse(condition = "ParserContext::chrome_rules_enabled")]
|
||||||
Meterchunk,
|
Meterchunk,
|
||||||
|
|
|
||||||
|
|
@ -761,25 +761,17 @@ enum class PhysicalArrowDirection {
|
||||||
Bottom,
|
Bottom,
|
||||||
};
|
};
|
||||||
|
|
||||||
void Theme::PaintMenuArrow(StyleAppearance aAppearance, nsIFrame* aFrame,
|
void Theme::PaintMenulistArrow(nsIFrame* aFrame, DrawTarget& aDrawTarget,
|
||||||
DrawTarget& aDrawTarget,
|
const LayoutDeviceRect& aRect) {
|
||||||
const LayoutDeviceRect& aRect) {
|
|
||||||
// not const: these may be negated in-place below
|
// not const: these may be negated in-place below
|
||||||
float polygonX[] = {-4.0f, -0.5f, 0.5f, 4.0f, 4.0f,
|
float polygonX[] = {-4.0f, -0.5f, 0.5f, 4.0f, 4.0f,
|
||||||
3.0f, 0.0f, 0.0f, -3.0f, -4.0f};
|
3.0f, 0.0f, 0.0f, -3.0f, -4.0f};
|
||||||
float polygonY[] = {-1, 3.0f, 3.0f, -1.0f, -2.0f,
|
float polygonY[] = {-1, 3.0f, 3.0f, -1.0f, -2.0f,
|
||||||
-2.0f, 1.5f, 1.5f, -2.0f, -2.0f};
|
-2.0f, 1.5f, 1.5f, -2.0f, -2.0f};
|
||||||
|
|
||||||
const bool isMenuList =
|
|
||||||
aAppearance == StyleAppearance::MozMenulistArrowButton;
|
|
||||||
const float kPolygonSize = kMinimumDropdownArrowButtonWidth;
|
const float kPolygonSize = kMinimumDropdownArrowButtonWidth;
|
||||||
|
|
||||||
const auto direction = [&] {
|
const auto direction = [&] {
|
||||||
const auto wm = aFrame->GetWritingMode();
|
const auto wm = aFrame->GetWritingMode();
|
||||||
if (!isMenuList) {
|
|
||||||
return wm.IsPhysicalRTL() ? PhysicalArrowDirection::Left
|
|
||||||
: PhysicalArrowDirection::Right;
|
|
||||||
}
|
|
||||||
switch (wm.GetBlockDir()) {
|
switch (wm.GetBlockDir()) {
|
||||||
case WritingMode::BlockDir::eBlockLR:
|
case WritingMode::BlockDir::eBlockLR:
|
||||||
return PhysicalArrowDirection::Right;
|
return PhysicalArrowDirection::Right;
|
||||||
|
|
@ -1225,13 +1217,12 @@ bool Theme::DoDrawWidgetBackground(PaintBackendData& aPaintData,
|
||||||
case StyleAppearance::Menulist:
|
case StyleAppearance::Menulist:
|
||||||
PaintMenulist(aPaintData, devPxRect, elementState, colors, dpiRatio);
|
PaintMenulist(aPaintData, devPxRect, elementState, colors, dpiRatio);
|
||||||
break;
|
break;
|
||||||
case StyleAppearance::Menuarrow:
|
|
||||||
case StyleAppearance::MozMenulistArrowButton:
|
case StyleAppearance::MozMenulistArrowButton:
|
||||||
if constexpr (std::is_same_v<PaintBackendData, WebRenderBackendData>) {
|
if constexpr (std::is_same_v<PaintBackendData, WebRenderBackendData>) {
|
||||||
// TODO: Need to figure out how to best draw this using WR.
|
// TODO: Need to figure out how to best draw this using WR.
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
PaintMenuArrow(aAppearance, aFrame, aPaintData, devPxRect);
|
PaintMenulistArrow(aFrame, aPaintData, devPxRect);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case StyleAppearance::Tooltip: {
|
case StyleAppearance::Tooltip: {
|
||||||
|
|
@ -1696,7 +1687,6 @@ bool Theme::ThemeSupportsWidget(nsPresContext* aPresContext, nsIFrame* aFrame,
|
||||||
case StyleAppearance::MenulistButton:
|
case StyleAppearance::MenulistButton:
|
||||||
case StyleAppearance::NumberInput:
|
case StyleAppearance::NumberInput:
|
||||||
case StyleAppearance::MozMenulistArrowButton:
|
case StyleAppearance::MozMenulistArrowButton:
|
||||||
case StyleAppearance::Menuarrow:
|
|
||||||
case StyleAppearance::SpinnerUpbutton:
|
case StyleAppearance::SpinnerUpbutton:
|
||||||
case StyleAppearance::SpinnerDownbutton:
|
case StyleAppearance::SpinnerDownbutton:
|
||||||
case StyleAppearance::Menuitem:
|
case StyleAppearance::Menuitem:
|
||||||
|
|
|
||||||
|
|
@ -171,8 +171,7 @@ class Theme : protected nsNativeTheme, public nsITheme {
|
||||||
template <typename PaintBackendData>
|
template <typename PaintBackendData>
|
||||||
void PaintMenulist(PaintBackendData&, const LayoutDeviceRect&,
|
void PaintMenulist(PaintBackendData&, const LayoutDeviceRect&,
|
||||||
const ElementState&, const Colors&, DPIRatio);
|
const ElementState&, const Colors&, DPIRatio);
|
||||||
void PaintMenuArrow(StyleAppearance, nsIFrame*, DrawTarget&,
|
void PaintMenulistArrow(nsIFrame*, DrawTarget&, const LayoutDeviceRect&);
|
||||||
const LayoutDeviceRect&);
|
|
||||||
void PaintSpinnerButton(nsIFrame*, DrawTarget&, const LayoutDeviceRect&,
|
void PaintSpinnerButton(nsIFrame*, DrawTarget&, const LayoutDeviceRect&,
|
||||||
const ElementState&, StyleAppearance, const Colors&,
|
const ElementState&, StyleAppearance, const Colors&,
|
||||||
DPIRatio);
|
DPIRatio);
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,6 @@ class nsNativeThemeCocoa : public mozilla::widget::ThemeCocoa {
|
||||||
public:
|
public:
|
||||||
enum class MenuIcon : uint8_t {
|
enum class MenuIcon : uint8_t {
|
||||||
eCheckmark,
|
eCheckmark,
|
||||||
eMenuArrow,
|
|
||||||
eMenuDownScrollArrow,
|
eMenuDownScrollArrow,
|
||||||
eMenuUpScrollArrow
|
eMenuUpScrollArrow
|
||||||
};
|
};
|
||||||
|
|
@ -61,7 +60,11 @@ class nsNativeThemeCocoa : public mozilla::widget::ThemeCocoa {
|
||||||
|
|
||||||
struct ControlParams {
|
struct ControlParams {
|
||||||
ControlParams()
|
ControlParams()
|
||||||
: disabled(false), insideActiveWindow(false), pressed(false), focused(false), rtl(false) {}
|
: disabled(false),
|
||||||
|
insideActiveWindow(false),
|
||||||
|
pressed(false),
|
||||||
|
focused(false),
|
||||||
|
rtl(false) {}
|
||||||
|
|
||||||
bool disabled : 1;
|
bool disabled : 1;
|
||||||
bool insideActiveWindow : 1;
|
bool insideActiveWindow : 1;
|
||||||
|
|
@ -229,10 +232,18 @@ class nsNativeThemeCocoa : public mozilla::widget::ThemeCocoa {
|
||||||
static WidgetInfo Segment(const SegmentParams& aParams) {
|
static WidgetInfo Segment(const SegmentParams& aParams) {
|
||||||
return WidgetInfo(Widget::eSegment, aParams);
|
return WidgetInfo(Widget::eSegment, aParams);
|
||||||
}
|
}
|
||||||
static WidgetInfo Separator() { return WidgetInfo(Widget::eSeparator, false); }
|
static WidgetInfo Separator() {
|
||||||
static WidgetInfo Toolbar(bool aParams) { return WidgetInfo(Widget::eToolbar, aParams); }
|
return WidgetInfo(Widget::eSeparator, false);
|
||||||
static WidgetInfo StatusBar(bool aParams) { return WidgetInfo(Widget::eStatusBar, aParams); }
|
}
|
||||||
static WidgetInfo GroupBox() { return WidgetInfo(Widget::eGroupBox, false); }
|
static WidgetInfo Toolbar(bool aParams) {
|
||||||
|
return WidgetInfo(Widget::eToolbar, aParams);
|
||||||
|
}
|
||||||
|
static WidgetInfo StatusBar(bool aParams) {
|
||||||
|
return WidgetInfo(Widget::eStatusBar, aParams);
|
||||||
|
}
|
||||||
|
static WidgetInfo GroupBox() {
|
||||||
|
return WidgetInfo(Widget::eGroupBox, false);
|
||||||
|
}
|
||||||
static WidgetInfo TextField(const TextFieldParams& aParams) {
|
static WidgetInfo TextField(const TextFieldParams& aParams) {
|
||||||
return WidgetInfo(Widget::eTextField, aParams);
|
return WidgetInfo(Widget::eTextField, aParams);
|
||||||
}
|
}
|
||||||
|
|
@ -261,7 +272,9 @@ class nsNativeThemeCocoa : public mozilla::widget::ThemeCocoa {
|
||||||
static WidgetInfo InactiveSourceListSelection(bool aParams) {
|
static WidgetInfo InactiveSourceListSelection(bool aParams) {
|
||||||
return WidgetInfo(Widget::eInactiveSourceListSelection, aParams);
|
return WidgetInfo(Widget::eInactiveSourceListSelection, aParams);
|
||||||
}
|
}
|
||||||
static WidgetInfo TabPanel(bool aParams) { return WidgetInfo(Widget::eTabPanel, aParams); }
|
static WidgetInfo TabPanel(bool aParams) {
|
||||||
|
return WidgetInfo(Widget::eTabPanel, aParams);
|
||||||
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T Params() const {
|
T Params() const {
|
||||||
|
|
@ -273,11 +286,14 @@ class nsNativeThemeCocoa : public mozilla::widget::ThemeCocoa {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
template <typename T>
|
template <typename T>
|
||||||
WidgetInfo(enum Widget aWidget, const T& aParams) : mVariant(aParams), mWidget(aWidget) {}
|
WidgetInfo(enum Widget aWidget, const T& aParams)
|
||||||
|
: mVariant(aParams), mWidget(aWidget) {}
|
||||||
|
|
||||||
mozilla::Variant<mozilla::gfx::sRGBColor, MenuIconParams, MenuItemParams, CheckboxOrRadioParams,
|
mozilla::Variant<mozilla::gfx::sRGBColor, MenuIconParams, MenuItemParams,
|
||||||
ButtonParams, DropdownParams, SpinButtonParams, SegmentParams, TextFieldParams,
|
CheckboxOrRadioParams, ButtonParams, DropdownParams,
|
||||||
ProgressParams, MeterParams, TreeHeaderCellParams, ScaleParams, bool>
|
SpinButtonParams, SegmentParams, TextFieldParams,
|
||||||
|
ProgressParams, MeterParams, TreeHeaderCellParams,
|
||||||
|
ScaleParams, bool>
|
||||||
mVariant;
|
mVariant;
|
||||||
|
|
||||||
enum Widget mWidget;
|
enum Widget mWidget;
|
||||||
|
|
@ -289,108 +305,140 @@ class nsNativeThemeCocoa : public mozilla::widget::ThemeCocoa {
|
||||||
|
|
||||||
// The nsITheme interface.
|
// The nsITheme interface.
|
||||||
NS_IMETHOD DrawWidgetBackground(gfxContext* aContext, nsIFrame* aFrame,
|
NS_IMETHOD DrawWidgetBackground(gfxContext* aContext, nsIFrame* aFrame,
|
||||||
StyleAppearance aAppearance, const nsRect& aRect,
|
StyleAppearance aAppearance,
|
||||||
const nsRect& aDirtyRect, DrawOverflow) override;
|
const nsRect& aRect, const nsRect& aDirtyRect,
|
||||||
bool CreateWebRenderCommandsForWidget(mozilla::wr::DisplayListBuilder& aBuilder,
|
DrawOverflow) override;
|
||||||
mozilla::wr::IpcResourceUpdateQueue& aResources,
|
bool CreateWebRenderCommandsForWidget(
|
||||||
const mozilla::layers::StackingContextHelper& aSc,
|
mozilla::wr::DisplayListBuilder& aBuilder,
|
||||||
mozilla::layers::RenderRootStateManager* aManager,
|
mozilla::wr::IpcResourceUpdateQueue& aResources,
|
||||||
nsIFrame* aFrame, StyleAppearance aAppearance,
|
const mozilla::layers::StackingContextHelper& aSc,
|
||||||
const nsRect& aRect) override;
|
mozilla::layers::RenderRootStateManager* aManager, nsIFrame* aFrame,
|
||||||
[[nodiscard]] LayoutDeviceIntMargin GetWidgetBorder(nsDeviceContext* aContext, nsIFrame* aFrame,
|
StyleAppearance aAppearance, const nsRect& aRect) override;
|
||||||
StyleAppearance aAppearance) override;
|
[[nodiscard]] LayoutDeviceIntMargin GetWidgetBorder(
|
||||||
|
nsDeviceContext* aContext, nsIFrame* aFrame,
|
||||||
|
StyleAppearance aAppearance) override;
|
||||||
|
|
||||||
bool GetWidgetPadding(nsDeviceContext* aContext, nsIFrame* aFrame, StyleAppearance aAppearance,
|
bool GetWidgetPadding(nsDeviceContext* aContext, nsIFrame* aFrame,
|
||||||
|
StyleAppearance aAppearance,
|
||||||
LayoutDeviceIntMargin* aResult) override;
|
LayoutDeviceIntMargin* aResult) override;
|
||||||
|
|
||||||
virtual bool GetWidgetOverflow(nsDeviceContext* aContext, nsIFrame* aFrame,
|
virtual bool GetWidgetOverflow(nsDeviceContext* aContext, nsIFrame* aFrame,
|
||||||
StyleAppearance aAppearance, nsRect* aOverflowRect) override;
|
StyleAppearance aAppearance,
|
||||||
|
nsRect* aOverflowRect) override;
|
||||||
|
|
||||||
LayoutDeviceIntSize GetMinimumWidgetSize(nsPresContext*, nsIFrame*, StyleAppearance) override;
|
LayoutDeviceIntSize GetMinimumWidgetSize(nsPresContext*, nsIFrame*,
|
||||||
NS_IMETHOD WidgetStateChanged(nsIFrame* aFrame, StyleAppearance aAppearance, nsAtom* aAttribute,
|
StyleAppearance) override;
|
||||||
bool* aShouldRepaint, const nsAttrValue* aOldValue) override;
|
NS_IMETHOD WidgetStateChanged(nsIFrame* aFrame, StyleAppearance aAppearance,
|
||||||
|
nsAtom* aAttribute, bool* aShouldRepaint,
|
||||||
|
const nsAttrValue* aOldValue) override;
|
||||||
NS_IMETHOD ThemeChanged() override;
|
NS_IMETHOD ThemeChanged() override;
|
||||||
bool ThemeSupportsWidget(nsPresContext* aPresContext, nsIFrame* aFrame,
|
bool ThemeSupportsWidget(nsPresContext* aPresContext, nsIFrame* aFrame,
|
||||||
StyleAppearance aAppearance) override;
|
StyleAppearance aAppearance) override;
|
||||||
bool WidgetIsContainer(StyleAppearance aAppearance) override;
|
bool WidgetIsContainer(StyleAppearance aAppearance) override;
|
||||||
bool ThemeDrawsFocusForWidget(nsIFrame*, StyleAppearance) override;
|
bool ThemeDrawsFocusForWidget(nsIFrame*, StyleAppearance) override;
|
||||||
bool ThemeNeedsComboboxDropmarker() override;
|
bool ThemeNeedsComboboxDropmarker() override;
|
||||||
virtual bool WidgetAppearanceDependsOnWindowFocus(StyleAppearance aAppearance) override;
|
virtual bool WidgetAppearanceDependsOnWindowFocus(
|
||||||
virtual ThemeGeometryType ThemeGeometryTypeForWidget(nsIFrame* aFrame,
|
StyleAppearance aAppearance) override;
|
||||||
StyleAppearance aAppearance) override;
|
virtual ThemeGeometryType ThemeGeometryTypeForWidget(
|
||||||
virtual Transparency GetWidgetTransparency(nsIFrame* aFrame,
|
nsIFrame* aFrame, StyleAppearance aAppearance) override;
|
||||||
StyleAppearance aAppearance) override;
|
virtual Transparency GetWidgetTransparency(
|
||||||
mozilla::Maybe<WidgetInfo> ComputeWidgetInfo(nsIFrame* aFrame, StyleAppearance aAppearance,
|
nsIFrame* aFrame, StyleAppearance aAppearance) override;
|
||||||
|
mozilla::Maybe<WidgetInfo> ComputeWidgetInfo(nsIFrame* aFrame,
|
||||||
|
StyleAppearance aAppearance,
|
||||||
const nsRect& aRect);
|
const nsRect& aRect);
|
||||||
void DrawProgress(CGContextRef context, const HIRect& inBoxRect, const ProgressParams& aParams);
|
void DrawProgress(CGContextRef context, const HIRect& inBoxRect,
|
||||||
|
const ProgressParams& aParams);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ~nsNativeThemeCocoa();
|
virtual ~nsNativeThemeCocoa();
|
||||||
|
|
||||||
LayoutDeviceIntMargin DirectionAwareMargin(const LayoutDeviceIntMargin& aMargin,
|
LayoutDeviceIntMargin DirectionAwareMargin(
|
||||||
nsIFrame* aFrame);
|
const LayoutDeviceIntMargin& aMargin, nsIFrame* aFrame);
|
||||||
nsIFrame* SeparatorResponsibility(nsIFrame* aBefore, nsIFrame* aAfter);
|
nsIFrame* SeparatorResponsibility(nsIFrame* aBefore, nsIFrame* aAfter);
|
||||||
ControlParams ComputeControlParams(nsIFrame* aFrame, mozilla::dom::ElementState aEventState);
|
ControlParams ComputeControlParams(nsIFrame* aFrame,
|
||||||
MenuIconParams ComputeMenuIconParams(nsIFrame* aParams, mozilla::dom::ElementState aEventState,
|
mozilla::dom::ElementState aEventState);
|
||||||
|
MenuIconParams ComputeMenuIconParams(nsIFrame* aParams,
|
||||||
|
mozilla::dom::ElementState aEventState,
|
||||||
MenuIcon aIcon);
|
MenuIcon aIcon);
|
||||||
MenuItemParams ComputeMenuItemParams(nsIFrame* aFrame, mozilla::dom::ElementState aEventState,
|
MenuItemParams ComputeMenuItemParams(nsIFrame* aFrame,
|
||||||
|
mozilla::dom::ElementState aEventState,
|
||||||
bool aIsChecked);
|
bool aIsChecked);
|
||||||
SegmentParams ComputeSegmentParams(nsIFrame* aFrame, mozilla::dom::ElementState aEventState,
|
SegmentParams ComputeSegmentParams(nsIFrame* aFrame,
|
||||||
|
mozilla::dom::ElementState aEventState,
|
||||||
SegmentType aSegmentType);
|
SegmentType aSegmentType);
|
||||||
TextFieldParams ComputeTextFieldParams(nsIFrame* aFrame, mozilla::dom::ElementState aEventState);
|
TextFieldParams ComputeTextFieldParams(
|
||||||
ProgressParams ComputeProgressParams(nsIFrame* aFrame, mozilla::dom::ElementState aEventState,
|
nsIFrame* aFrame, mozilla::dom::ElementState aEventState);
|
||||||
|
ProgressParams ComputeProgressParams(nsIFrame* aFrame,
|
||||||
|
mozilla::dom::ElementState aEventState,
|
||||||
bool aIsHorizontal);
|
bool aIsHorizontal);
|
||||||
MeterParams ComputeMeterParams(nsIFrame* aFrame);
|
MeterParams ComputeMeterParams(nsIFrame* aFrame);
|
||||||
TreeHeaderCellParams ComputeTreeHeaderCellParams(nsIFrame* aFrame,
|
TreeHeaderCellParams ComputeTreeHeaderCellParams(
|
||||||
mozilla::dom::ElementState aEventState);
|
nsIFrame* aFrame, mozilla::dom::ElementState aEventState);
|
||||||
mozilla::Maybe<ScaleParams> ComputeHTMLScaleParams(nsIFrame* aFrame,
|
mozilla::Maybe<ScaleParams> ComputeHTMLScaleParams(
|
||||||
mozilla::dom::ElementState aEventState);
|
nsIFrame* aFrame, mozilla::dom::ElementState aEventState);
|
||||||
|
|
||||||
// HITheme drawing routines
|
// HITheme drawing routines
|
||||||
void DrawMeter(CGContextRef context, const HIRect& inBoxRect, const MeterParams& aParams);
|
void DrawMeter(CGContextRef context, const HIRect& inBoxRect,
|
||||||
void DrawSegment(CGContextRef cgContext, const HIRect& inBoxRect, const SegmentParams& aParams);
|
const MeterParams& aParams);
|
||||||
|
void DrawSegment(CGContextRef cgContext, const HIRect& inBoxRect,
|
||||||
|
const SegmentParams& aParams);
|
||||||
void DrawSegmentBackground(CGContextRef cgContext, const HIRect& inBoxRect,
|
void DrawSegmentBackground(CGContextRef cgContext, const HIRect& inBoxRect,
|
||||||
const SegmentParams& aParams);
|
const SegmentParams& aParams);
|
||||||
void DrawTabPanel(CGContextRef context, const HIRect& inBoxRect, bool aIsInsideActiveWindow);
|
void DrawTabPanel(CGContextRef context, const HIRect& inBoxRect,
|
||||||
void DrawScale(CGContextRef context, const HIRect& inBoxRect, const ScaleParams& aParams);
|
bool aIsInsideActiveWindow);
|
||||||
void DrawCheckboxOrRadio(CGContextRef cgContext, bool inCheckbox, const HIRect& inBoxRect,
|
void DrawScale(CGContextRef context, const HIRect& inBoxRect,
|
||||||
|
const ScaleParams& aParams);
|
||||||
|
void DrawCheckboxOrRadio(CGContextRef cgContext, bool inCheckbox,
|
||||||
|
const HIRect& inBoxRect,
|
||||||
const CheckboxOrRadioParams& aParams);
|
const CheckboxOrRadioParams& aParams);
|
||||||
void DrawSearchField(CGContextRef cgContext, const HIRect& inBoxRect,
|
void DrawSearchField(CGContextRef cgContext, const HIRect& inBoxRect,
|
||||||
const TextFieldParams& aParams);
|
const TextFieldParams& aParams);
|
||||||
void DrawTextField(CGContextRef cgContext, const HIRect& inBoxRect,
|
void DrawTextField(CGContextRef cgContext, const HIRect& inBoxRect,
|
||||||
const TextFieldParams& aParams);
|
const TextFieldParams& aParams);
|
||||||
void DrawPushButton(CGContextRef cgContext, const HIRect& inBoxRect, ButtonType aButtonType,
|
void DrawPushButton(CGContextRef cgContext, const HIRect& inBoxRect,
|
||||||
ControlParams aControlParams);
|
ButtonType aButtonType, ControlParams aControlParams);
|
||||||
void DrawSquareBezelPushButton(CGContextRef cgContext, const HIRect& inBoxRect,
|
void DrawSquareBezelPushButton(CGContextRef cgContext,
|
||||||
|
const HIRect& inBoxRect,
|
||||||
ControlParams aControlParams);
|
ControlParams aControlParams);
|
||||||
void DrawHelpButton(CGContextRef cgContext, const HIRect& inBoxRect,
|
void DrawHelpButton(CGContextRef cgContext, const HIRect& inBoxRect,
|
||||||
ControlParams aControlParams);
|
ControlParams aControlParams);
|
||||||
void DrawDisclosureButton(CGContextRef cgContext, const HIRect& inBoxRect,
|
void DrawDisclosureButton(CGContextRef cgContext, const HIRect& inBoxRect,
|
||||||
ControlParams aControlParams, NSControlStateValue aState);
|
ControlParams aControlParams,
|
||||||
|
NSControlStateValue aState);
|
||||||
NSString* GetMenuIconName(const MenuIconParams& aParams);
|
NSString* GetMenuIconName(const MenuIconParams& aParams);
|
||||||
NSSize GetMenuIconSize(MenuIcon aIcon);
|
NSSize GetMenuIconSize(MenuIcon aIcon);
|
||||||
void DrawMenuIcon(CGContextRef cgContext, const CGRect& aRect, const MenuIconParams& aParams);
|
void DrawMenuIcon(CGContextRef cgContext, const CGRect& aRect,
|
||||||
void DrawMenuItem(CGContextRef cgContext, const CGRect& inBoxRect, const MenuItemParams& aParams);
|
const MenuIconParams& aParams);
|
||||||
void DrawHIThemeButton(CGContextRef cgContext, const HIRect& aRect, ThemeButtonKind aKind,
|
void DrawMenuItem(CGContextRef cgContext, const CGRect& inBoxRect,
|
||||||
ThemeButtonValue aValue, ThemeDrawState aState,
|
const MenuItemParams& aParams);
|
||||||
ThemeButtonAdornment aAdornment, const ControlParams& aParams);
|
void DrawHIThemeButton(CGContextRef cgContext, const HIRect& aRect,
|
||||||
void DrawButton(CGContextRef context, const HIRect& inBoxRect, const ButtonParams& aParams);
|
ThemeButtonKind aKind, ThemeButtonValue aValue,
|
||||||
|
ThemeDrawState aState, ThemeButtonAdornment aAdornment,
|
||||||
|
const ControlParams& aParams);
|
||||||
|
void DrawButton(CGContextRef context, const HIRect& inBoxRect,
|
||||||
|
const ButtonParams& aParams);
|
||||||
void DrawTreeHeaderCell(CGContextRef context, const HIRect& inBoxRect,
|
void DrawTreeHeaderCell(CGContextRef context, const HIRect& inBoxRect,
|
||||||
const TreeHeaderCellParams& aParams);
|
const TreeHeaderCellParams& aParams);
|
||||||
void DrawDropdown(CGContextRef context, const HIRect& inBoxRect, const DropdownParams& aParams);
|
void DrawDropdown(CGContextRef context, const HIRect& inBoxRect,
|
||||||
HIThemeButtonDrawInfo SpinButtonDrawInfo(ThemeButtonKind aKind, const SpinButtonParams& aParams);
|
const DropdownParams& aParams);
|
||||||
|
HIThemeButtonDrawInfo SpinButtonDrawInfo(ThemeButtonKind aKind,
|
||||||
|
const SpinButtonParams& aParams);
|
||||||
void DrawSpinButtons(CGContextRef context, const HIRect& inBoxRect,
|
void DrawSpinButtons(CGContextRef context, const HIRect& inBoxRect,
|
||||||
const SpinButtonParams& aParams);
|
const SpinButtonParams& aParams);
|
||||||
void DrawSpinButton(CGContextRef context, const HIRect& inBoxRect, SpinButton aDrawnButton,
|
void DrawSpinButton(CGContextRef context, const HIRect& inBoxRect,
|
||||||
const SpinButtonParams& aParams);
|
SpinButton aDrawnButton, const SpinButtonParams& aParams);
|
||||||
void DrawToolbar(CGContextRef cgContext, const CGRect& inBoxRect, bool aIsMain);
|
void DrawToolbar(CGContextRef cgContext, const CGRect& inBoxRect,
|
||||||
void DrawStatusBar(CGContextRef cgContext, const HIRect& inBoxRect, bool aIsMain);
|
bool aIsMain);
|
||||||
void DrawMultilineTextField(CGContextRef cgContext, const CGRect& inBoxRect, bool aIsFocused);
|
void DrawStatusBar(CGContextRef cgContext, const HIRect& inBoxRect,
|
||||||
void DrawSourceListSelection(CGContextRef aContext, const CGRect& aRect, bool aWindowIsActive,
|
bool aIsMain);
|
||||||
bool aSelectionIsActive);
|
void DrawMultilineTextField(CGContextRef cgContext, const CGRect& inBoxRect,
|
||||||
|
bool aIsFocused);
|
||||||
|
void DrawSourceListSelection(CGContextRef aContext, const CGRect& aRect,
|
||||||
|
bool aWindowIsActive, bool aSelectionIsActive);
|
||||||
|
|
||||||
void RenderWidget(const WidgetInfo& aWidgetInfo, mozilla::ColorScheme,
|
void RenderWidget(const WidgetInfo& aWidgetInfo, mozilla::ColorScheme,
|
||||||
mozilla::gfx::DrawTarget& aDrawTarget, const mozilla::gfx::Rect& aWidgetRect,
|
mozilla::gfx::DrawTarget& aDrawTarget,
|
||||||
|
const mozilla::gfx::Rect& aWidgetRect,
|
||||||
const mozilla::gfx::Rect& aDirtyRect, float aScale);
|
const mozilla::gfx::Rect& aDirtyRect, float aScale);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
|
|
@ -1108,11 +1108,8 @@ void nsNativeThemeCocoa::DrawSearchField(CGContextRef cgContext,
|
||||||
}
|
}
|
||||||
|
|
||||||
static const NSSize kCheckmarkSize = NSMakeSize(11, 11);
|
static const NSSize kCheckmarkSize = NSMakeSize(11, 11);
|
||||||
static const NSSize kMenuarrowSize = NSMakeSize(9, 10);
|
|
||||||
static const NSSize kMenuScrollArrowSize = NSMakeSize(10, 8);
|
static const NSSize kMenuScrollArrowSize = NSMakeSize(10, 8);
|
||||||
static NSString* kCheckmarkImage = @"MenuOnState";
|
static NSString* kCheckmarkImage = @"MenuOnState";
|
||||||
static NSString* kMenuarrowRightImage = @"MenuSubmenu";
|
|
||||||
static NSString* kMenuarrowLeftImage = @"MenuSubmenuLeft";
|
|
||||||
static NSString* kMenuDownScrollArrowImage = @"MenuScrollDown";
|
static NSString* kMenuDownScrollArrowImage = @"MenuScrollDown";
|
||||||
static NSString* kMenuUpScrollArrowImage = @"MenuScrollUp";
|
static NSString* kMenuUpScrollArrowImage = @"MenuScrollUp";
|
||||||
static const CGFloat kMenuIconIndent = 6.0f;
|
static const CGFloat kMenuIconIndent = 6.0f;
|
||||||
|
|
@ -1121,8 +1118,6 @@ NSString* nsNativeThemeCocoa::GetMenuIconName(const MenuIconParams& aParams) {
|
||||||
switch (aParams.icon) {
|
switch (aParams.icon) {
|
||||||
case MenuIcon::eCheckmark:
|
case MenuIcon::eCheckmark:
|
||||||
return kCheckmarkImage;
|
return kCheckmarkImage;
|
||||||
case MenuIcon::eMenuArrow:
|
|
||||||
return aParams.rtl ? kMenuarrowLeftImage : kMenuarrowRightImage;
|
|
||||||
case MenuIcon::eMenuDownScrollArrow:
|
case MenuIcon::eMenuDownScrollArrow:
|
||||||
return kMenuDownScrollArrowImage;
|
return kMenuDownScrollArrowImage;
|
||||||
case MenuIcon::eMenuUpScrollArrow:
|
case MenuIcon::eMenuUpScrollArrow:
|
||||||
|
|
@ -1134,8 +1129,6 @@ NSSize nsNativeThemeCocoa::GetMenuIconSize(MenuIcon aIcon) {
|
||||||
switch (aIcon) {
|
switch (aIcon) {
|
||||||
case MenuIcon::eCheckmark:
|
case MenuIcon::eCheckmark:
|
||||||
return kCheckmarkSize;
|
return kCheckmarkSize;
|
||||||
case MenuIcon::eMenuArrow:
|
|
||||||
return kMenuarrowSize;
|
|
||||||
case MenuIcon::eMenuDownScrollArrow:
|
case MenuIcon::eMenuDownScrollArrow:
|
||||||
case MenuIcon::eMenuUpScrollArrow:
|
case MenuIcon::eMenuUpScrollArrow:
|
||||||
return kMenuScrollArrowSize;
|
return kMenuScrollArrowSize;
|
||||||
|
|
@ -2354,10 +2347,6 @@ Maybe<nsNativeThemeCocoa::WidgetInfo> nsNativeThemeCocoa::ComputeWidgetInfo(
|
||||||
case StyleAppearance::Menupopup:
|
case StyleAppearance::Menupopup:
|
||||||
return Nothing();
|
return Nothing();
|
||||||
|
|
||||||
case StyleAppearance::Menuarrow:
|
|
||||||
return Some(WidgetInfo::MenuIcon(
|
|
||||||
ComputeMenuIconParams(aFrame, elementState, MenuIcon::eMenuArrow)));
|
|
||||||
|
|
||||||
case StyleAppearance::Menuitem:
|
case StyleAppearance::Menuitem:
|
||||||
case StyleAppearance::Checkmenuitem:
|
case StyleAppearance::Checkmenuitem:
|
||||||
return Some(WidgetInfo::MenuItem(ComputeMenuItemParams(
|
return Some(WidgetInfo::MenuItem(ComputeMenuItemParams(
|
||||||
|
|
@ -2919,7 +2908,6 @@ bool nsNativeThemeCocoa::CreateWebRenderCommandsForWidget(
|
||||||
// - If the case in DrawWidgetBackground draws something complicated for the
|
// - If the case in DrawWidgetBackground draws something complicated for the
|
||||||
// given widget type, return false here.
|
// given widget type, return false here.
|
||||||
switch (aAppearance) {
|
switch (aAppearance) {
|
||||||
case StyleAppearance::Menuarrow:
|
|
||||||
case StyleAppearance::Menuitem:
|
case StyleAppearance::Menuitem:
|
||||||
case StyleAppearance::Checkmenuitem:
|
case StyleAppearance::Checkmenuitem:
|
||||||
case StyleAppearance::ButtonArrowUp:
|
case StyleAppearance::ButtonArrowUp:
|
||||||
|
|
@ -3021,12 +3009,6 @@ LayoutDeviceIntMargin nsNativeThemeCocoa::GetWidgetBorder(
|
||||||
result = DirectionAwareMargin(kAquaDropdownBorder, aFrame);
|
result = DirectionAwareMargin(kAquaDropdownBorder, aFrame);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case StyleAppearance::Menuarrow:
|
|
||||||
if (nsCocoaFeatures::OnBigSurOrLater()) {
|
|
||||||
result.SizeTo(0, 0, 0, 28);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case StyleAppearance::NumberInput:
|
case StyleAppearance::NumberInput:
|
||||||
case StyleAppearance::Textfield: {
|
case StyleAppearance::Textfield: {
|
||||||
SInt32 frameOutset = 0;
|
SInt32 frameOutset = 0;
|
||||||
|
|
@ -3098,7 +3080,6 @@ bool nsNativeThemeCocoa::GetWidgetPadding(nsDeviceContext* aContext,
|
||||||
aResult->SizeTo(0, 0, 0, 0);
|
aResult->SizeTo(0, 0, 0, 0);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case StyleAppearance::Menuarrow:
|
|
||||||
case StyleAppearance::Searchfield:
|
case StyleAppearance::Searchfield:
|
||||||
if (nsCocoaFeatures::OnBigSurOrLater()) {
|
if (nsCocoaFeatures::OnBigSurOrLater()) {
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -3198,11 +3179,6 @@ LayoutDeviceIntSize nsNativeThemeCocoa::GetMinimumWidgetSize(
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case StyleAppearance::Menuarrow: {
|
|
||||||
result.SizeTo(kMenuarrowSize.width, kMenuarrowSize.height);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case StyleAppearance::MozMacDisclosureButtonOpen:
|
case StyleAppearance::MozMacDisclosureButtonOpen:
|
||||||
case StyleAppearance::MozMacDisclosureButtonClosed: {
|
case StyleAppearance::MozMacDisclosureButtonClosed: {
|
||||||
result.SizeTo(kDisclosureButtonSize.width, kDisclosureButtonSize.height);
|
result.SizeTo(kDisclosureButtonSize.width, kDisclosureButtonSize.height);
|
||||||
|
|
@ -3411,7 +3387,6 @@ bool nsNativeThemeCocoa::ThemeSupportsWidget(nsPresContext* aPresContext,
|
||||||
case StyleAppearance::MozWindowTitlebar:
|
case StyleAppearance::MozWindowTitlebar:
|
||||||
case StyleAppearance::Checkmenuitem:
|
case StyleAppearance::Checkmenuitem:
|
||||||
case StyleAppearance::Menupopup:
|
case StyleAppearance::Menupopup:
|
||||||
case StyleAppearance::Menuarrow:
|
|
||||||
case StyleAppearance::Menuitem:
|
case StyleAppearance::Menuitem:
|
||||||
case StyleAppearance::Tooltip:
|
case StyleAppearance::Tooltip:
|
||||||
|
|
||||||
|
|
@ -3517,7 +3492,6 @@ bool nsNativeThemeCocoa::WidgetAppearanceDependsOnWindowFocus(
|
||||||
case StyleAppearance::ButtonArrowDown:
|
case StyleAppearance::ButtonArrowDown:
|
||||||
case StyleAppearance::Checkmenuitem:
|
case StyleAppearance::Checkmenuitem:
|
||||||
case StyleAppearance::Menupopup:
|
case StyleAppearance::Menupopup:
|
||||||
case StyleAppearance::Menuarrow:
|
|
||||||
case StyleAppearance::Menuitem:
|
case StyleAppearance::Menuitem:
|
||||||
case StyleAppearance::Tooltip:
|
case StyleAppearance::Tooltip:
|
||||||
case StyleAppearance::Spinner:
|
case StyleAppearance::Spinner:
|
||||||
|
|
|
||||||
|
|
@ -572,6 +572,5 @@ bool nsNativeTheme::IsWidgetAlwaysNonNative(nsIFrame* aFrame,
|
||||||
StyleAppearance aAppearance) {
|
StyleAppearance aAppearance) {
|
||||||
return IsWidgetScrollbarPart(aAppearance) ||
|
return IsWidgetScrollbarPart(aAppearance) ||
|
||||||
aAppearance == StyleAppearance::FocusOutline ||
|
aAppearance == StyleAppearance::FocusOutline ||
|
||||||
aAppearance == StyleAppearance::Menuarrow ||
|
|
||||||
(aFrame && aFrame->StyleUI()->mMozTheme == StyleMozTheme::NonNative);
|
(aFrame && aFrame->StyleUI()->mMozTheme == StyleMozTheme::NonNative);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1554,10 +1554,6 @@ LayoutDeviceIntSize nsNativeThemeWin::ClassicGetMinimumWidgetSize(
|
||||||
nsIFrame* aFrame, StyleAppearance aAppearance) {
|
nsIFrame* aFrame, StyleAppearance aAppearance) {
|
||||||
LayoutDeviceIntSize result;
|
LayoutDeviceIntSize result;
|
||||||
switch (aAppearance) {
|
switch (aAppearance) {
|
||||||
case StyleAppearance::Menuarrow:
|
|
||||||
result.width = ::GetSystemMetrics(SM_CXMENUCHECK);
|
|
||||||
result.height = ::GetSystemMetrics(SM_CYMENUCHECK);
|
|
||||||
break;
|
|
||||||
case StyleAppearance::RangeThumb: {
|
case StyleAppearance::RangeThumb: {
|
||||||
if (IsRangeHorizontal(aFrame)) {
|
if (IsRangeHorizontal(aFrame)) {
|
||||||
result.width = 12;
|
result.width = 12;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue