2018-11-30 22:52:05 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2006-12-07 01:31:17 +03:00
|
|
|
|
2007-01-18 09:34:07 +03:00
|
|
|
#ifndef nsLookAndFeel_h_
|
|
|
|
#define nsLookAndFeel_h_
|
2006-12-07 01:31:17 +03:00
|
|
|
#include "nsXPLookAndFeel.h"
|
|
|
|
|
2017-06-30 04:34:15 +03:00
|
|
|
class nsLookAndFeel final : public nsXPLookAndFeel {
|
2006-12-07 01:31:17 +03:00
|
|
|
public:
|
2020-12-16 07:17:36 +03:00
|
|
|
explicit nsLookAndFeel(const LookAndFeelCache* aCache);
|
2006-12-07 01:31:17 +03:00
|
|
|
virtual ~nsLookAndFeel();
|
|
|
|
|
2018-02-09 08:22:43 +03:00
|
|
|
void NativeInit() final;
|
2017-11-06 06:37:28 +03:00
|
|
|
virtual void RefreshImpl() override;
|
2020-11-21 02:52:47 +03:00
|
|
|
nsresult NativeGetColor(ColorID aID, nscolor& aResult) override;
|
|
|
|
nsresult NativeGetInt(IntID aID, int32_t& aResult) override;
|
|
|
|
nsresult NativeGetFloat(FloatID aID, float& aResult) override;
|
|
|
|
bool NativeGetFont(FontID aID, nsString& aFontName,
|
|
|
|
gfxFontStyle& aFontStyle) override;
|
2017-11-06 06:37:28 +03:00
|
|
|
|
|
|
|
virtual char16_t GetPasswordCharacterImpl() override {
|
2011-09-09 06:27:13 +04:00
|
|
|
// unicode value for the bullet character, used for password textfields.
|
|
|
|
return 0x2022;
|
|
|
|
}
|
2006-12-07 01:31:17 +03:00
|
|
|
|
2013-06-07 23:44:24 +04:00
|
|
|
static bool UseOverlayScrollbars();
|
|
|
|
|
2020-07-31 19:21:44 +03:00
|
|
|
LookAndFeelCache GetCacheImpl() override;
|
|
|
|
void SetCacheImpl(const LookAndFeelCache& aCache) override;
|
2015-04-22 17:58:48 +03:00
|
|
|
|
2016-06-15 00:02:58 +03:00
|
|
|
protected:
|
2020-12-16 07:17:36 +03:00
|
|
|
void DoSetCache(const LookAndFeelCache& aCache);
|
2013-05-24 01:14:00 +04:00
|
|
|
static bool AllowOverlayScrollbarsOverlap();
|
2015-04-22 17:58:48 +03:00
|
|
|
|
2018-06-27 20:59:21 +03:00
|
|
|
static bool SystemWantsDarkTheme();
|
2018-12-11 01:41:46 +03:00
|
|
|
static nscolor ProcessSelectionBackground(nscolor aColor);
|
2018-06-27 20:59:21 +03:00
|
|
|
|
2015-04-22 17:58:48 +03:00
|
|
|
private:
|
|
|
|
int32_t mUseOverlayScrollbars;
|
|
|
|
bool mUseOverlayScrollbarsCached;
|
|
|
|
|
|
|
|
int32_t mAllowOverlayScrollbarsOverlap;
|
|
|
|
bool mAllowOverlayScrollbarsOverlapCached;
|
2017-10-03 03:13:48 +03:00
|
|
|
|
2019-03-01 21:09:19 +03:00
|
|
|
int32_t mSystemUsesDarkTheme;
|
|
|
|
bool mSystemUsesDarkThemeCached;
|
|
|
|
|
2020-05-21 20:02:06 +03:00
|
|
|
int32_t mPrefersReducedMotion = -1;
|
|
|
|
bool mPrefersReducedMotionCached = false;
|
|
|
|
|
2021-02-10 20:52:56 +03:00
|
|
|
int32_t mUseAccessibilityTheme;
|
|
|
|
bool mUseAccessibilityThemeCached;
|
|
|
|
|
2017-10-03 03:13:48 +03:00
|
|
|
nscolor mColorTextSelectBackground;
|
|
|
|
nscolor mColorTextSelectBackgroundDisabled;
|
|
|
|
nscolor mColorHighlight;
|
|
|
|
nscolor mColorTextSelectForeground;
|
|
|
|
nscolor mColorMenuHoverText;
|
|
|
|
nscolor mColorButtonText;
|
|
|
|
nscolor mColorButtonHoverText;
|
|
|
|
nscolor mColorText;
|
|
|
|
nscolor mColorWindowText;
|
|
|
|
nscolor mColorActiveCaption;
|
|
|
|
nscolor mColorActiveBorder;
|
|
|
|
nscolor mColorGrayText;
|
|
|
|
nscolor mColorInactiveBorder;
|
|
|
|
nscolor mColorInactiveCaption;
|
|
|
|
nscolor mColorScrollbar;
|
|
|
|
nscolor mColorThreeDHighlight;
|
|
|
|
nscolor mColorMenu;
|
|
|
|
nscolor mColorWindowFrame;
|
|
|
|
nscolor mColorFieldText;
|
|
|
|
nscolor mColorDialog;
|
|
|
|
nscolor mColorDialogText;
|
|
|
|
nscolor mColorDragTargetZone;
|
|
|
|
nscolor mColorChromeActive;
|
|
|
|
nscolor mColorChromeInactive;
|
|
|
|
nscolor mColorFocusRing;
|
|
|
|
nscolor mColorTextSelect;
|
|
|
|
nscolor mColorDisabledToolbarText;
|
|
|
|
nscolor mColorMenuSelect;
|
|
|
|
nscolor mColorCellHighlight;
|
|
|
|
nscolor mColorEvenTreeRow;
|
|
|
|
nscolor mColorOddTreeRow;
|
2021-03-17 19:50:10 +03:00
|
|
|
nscolor mColorMenuFontSmoothingBg;
|
|
|
|
nscolor mColorSourceListFontSmoothingBg;
|
|
|
|
nscolor mColorSourceListSelectionFontSmoothingBg;
|
|
|
|
nscolor mColorActiveSourceListSelectionFontSmoothingBg;
|
2017-10-03 03:13:48 +03:00
|
|
|
|
|
|
|
bool mInitialized;
|
|
|
|
|
|
|
|
void EnsureInit();
|
2006-12-07 01:31:17 +03:00
|
|
|
};
|
|
|
|
|
2007-01-18 09:34:07 +03:00
|
|
|
#endif // nsLookAndFeel_h_
|