Bug 1802314 - Use non-native tooltips in the cocoa non-native theme too. r=spohl

We implemented a basic ThemeGeometry-based tooltip in
https://hg.mozilla.org/integration/autoland/rev/e8d65866112f, but now
that we have non-native theme support for these it seems ok to just use
it.

Differential Revision: https://phabricator.services.mozilla.com/D163023
This commit is contained in:
Emilio Cobos Álvarez 2022-12-07 18:47:53 +00:00
Родитель 799823f5d7
Коммит be6bc3a575
3 изменённых файлов: 9 добавлений и 29 удалений

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

@ -1580,9 +1580,15 @@ LayoutDeviceIntSize Theme::GetMinimumWidgetSize(nsPresContext* aPresContext,
nsITheme::Transparency Theme::GetWidgetTransparency(
nsIFrame* aFrame, StyleAppearance aAppearance) {
return GetScrollbarDrawing()
.GetScrollbarPartTransparency(aFrame, aAppearance)
.valueOr(eUnknownTransparency);
if (auto scrollbar = GetScrollbarDrawing().GetScrollbarPartTransparency(
aFrame, aAppearance)) {
return *scrollbar;
}
if (aAppearance == StyleAppearance::Tooltip) {
// We draw a rounded rect, so we need transparency.
return eTransparent;
}
return eUnknownTransparency;
}
NS_IMETHODIMP

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

@ -26,26 +26,4 @@ LayoutDeviceIntSize ThemeCocoa::GetMinimumWidgetSize(
return Theme::GetMinimumWidgetSize(aPresContext, aFrame, aAppearance);
}
nsITheme::ThemeGeometryType ThemeCocoa::ThemeGeometryTypeForWidget(
nsIFrame* aFrame, StyleAppearance aAppearance) {
switch (aAppearance) {
case StyleAppearance::Tooltip:
return eThemeGeometryTypeTooltip;
default:
break;
}
return Theme::ThemeGeometryTypeForWidget(aFrame, aAppearance);
}
bool ThemeCocoa::ThemeSupportsWidget(nsPresContext* aPc, nsIFrame* aFrame,
StyleAppearance aAppearance) {
switch (aAppearance) {
case StyleAppearance::Tooltip:
return true;
default:
break;
}
return Theme::ThemeSupportsWidget(aPc, aFrame, aAppearance);
}
} // namespace mozilla::widget

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

@ -22,10 +22,6 @@ class ThemeCocoa : public Theme {
nsPresContext* aPresContext, nsIFrame* aFrame,
StyleAppearance aAppearance) override;
ThemeGeometryType ThemeGeometryTypeForWidget(nsIFrame*,
StyleAppearance) override;
bool ThemeSupportsWidget(nsPresContext*, nsIFrame*, StyleAppearance) override;
protected:
virtual ~ThemeCocoa() = default;
};