1 /* -*- Mode: C++; tab-width: 40; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef ScrollbarUtil_h
7 #define ScrollbarUtil_h
10 #include "nsNativeTheme.h"
14 static bool IsScrollbarWidthThin(mozilla::ComputedStyle
* aStyle
);
15 static bool IsScrollbarWidthThin(nsIFrame
* aFrame
);
17 // Returns the style for custom scrollbar if the scrollbar part frame should
18 // use the custom drawing path, nullptr otherwise.
20 // Optionally the caller can pass a pointer to aDarkScrollbar for whether
21 // custom scrollbar may be drawn due to dark background.
22 static mozilla::ComputedStyle
* GetCustomScrollbarStyle(
23 nsIFrame
* aFrame
, bool* aDarkScrollbar
= nullptr);
25 static nscolor
GetScrollbarButtonColor(nscolor aTrackColor
,
26 mozilla::EventStates aStates
);
27 static nscolor
GetScrollbarArrowColor(nscolor aButtonColor
);
28 static nscolor
GetScrollbarTrackColor(nsIFrame
* aFrame
);
29 static nscolor
GetScrollbarThumbColor(nsIFrame
* aFrame
,
30 mozilla::EventStates aEventStates
);
31 static mozilla::Maybe
<nsITheme::Transparency
> GetScrollbarPartTransparency(
32 nsIFrame
* aFrame
, mozilla::StyleAppearance aAppearance
);
35 ScrollbarUtil() = default;
36 virtual ~ScrollbarUtil() = default;