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