Bug 1673503 - Simplify NSScroller.preferredScrollerStyle API usage. r=spohl

This API has been available since 10.7.

Differential Revision: https://phabricator.services.mozilla.com/D94796
This commit is contained in:
Markus Stange 2020-10-27 21:35:10 +00:00
Родитель 42c41f450a
Коммит 31f1bafb71
2 изменённых файлов: 1 добавлений и 14 удалений

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

@ -31,7 +31,6 @@ class nsLookAndFeel final : public nsXPLookAndFeel {
void SetCacheImpl(const LookAndFeelCache& aCache) override;
protected:
static bool SystemWantsOverlayScrollbars();
static bool AllowOverlayScrollbarsOverlap();
static bool SystemWantsDarkTheme();

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

@ -22,13 +22,6 @@
// This must be included last:
#include "nsObjCExceptions.h"
enum { mozNSScrollerStyleLegacy = 0, mozNSScrollerStyleOverlay = 1 };
typedef NSInteger mozNSScrollerStyle;
@interface NSScroller (AvailableSinceLion)
+ (mozNSScrollerStyle)preferredScrollerStyle;
@end
// Available from 10.12 onwards; test availability at runtime before using
@interface NSWorkspace (AvailableSinceSierra)
@property(readonly) BOOL accessibilityDisplayShouldReduceMotion;
@ -473,7 +466,7 @@ nsresult nsLookAndFeel::GetIntImpl(IntID aID, int32_t& aResult) {
break;
case IntID::UseOverlayScrollbars:
if (!mUseOverlayScrollbarsCached) {
mUseOverlayScrollbars = SystemWantsOverlayScrollbars() ? 1 : 0;
mUseOverlayScrollbars = NSScroller.preferredScrollerStyle == NSScrollerStyleOverlay ? 1 : 0;
mUseOverlayScrollbarsCached = true;
}
aResult = mUseOverlayScrollbars;
@ -614,11 +607,6 @@ nsresult nsLookAndFeel::GetFloatImpl(FloatID aID, float& aResult) {
bool nsLookAndFeel::UseOverlayScrollbars() { return GetInt(IntID::UseOverlayScrollbars) != 0; }
bool nsLookAndFeel::SystemWantsOverlayScrollbars() {
return ([NSScroller respondsToSelector:@selector(preferredScrollerStyle)] &&
[NSScroller preferredScrollerStyle] == mozNSScrollerStyleOverlay);
}
bool nsLookAndFeel::AllowOverlayScrollbarsOverlap() { return (UseOverlayScrollbars()); }
bool nsLookAndFeel::SystemWantsDarkTheme() {