summaryrefslogtreecommitdiffstats
path: root/widget/windows/nsLookAndFeel.h
diff options
context:
space:
mode:
Diffstat (limited to 'widget/windows/nsLookAndFeel.h')
-rw-r--r--widget/windows/nsLookAndFeel.h40
1 files changed, 28 insertions, 12 deletions
diff --git a/widget/windows/nsLookAndFeel.h b/widget/windows/nsLookAndFeel.h
index bc2d158b6..a77808322 100644
--- a/widget/windows/nsLookAndFeel.h
+++ b/widget/windows/nsLookAndFeel.h
@@ -5,7 +5,9 @@
#ifndef __nsLookAndFeel
#define __nsLookAndFeel
+
#include "nsXPLookAndFeel.h"
+#include "nsIWindowsRegKey.h"
/*
* Gesture System Metrics
@@ -27,18 +29,6 @@
#ifndef SM_SYSTEMDOCKED
#define SM_CONVERTIBLESLATEMODE 0x00002003
#define SM_SYSTEMDOCKED 0x00002004
-typedef enum _AR_STATE
-{
- AR_ENABLED = 0x0,
- AR_DISABLED = 0x1,
- AR_SUPPRESSED = 0x2,
- AR_REMOTESESSION = 0x4,
- AR_MULTIMON = 0x8,
- AR_NOSENSOR = 0x10,
- AR_NOT_SUPPORTED = 0x20,
- AR_DOCKED = 0x40,
- AR_LAPTOP = 0x80
-} AR_STATE, *PAR_STATE;
#endif
class nsLookAndFeel: public nsXPLookAndFeel {
@@ -59,7 +49,33 @@ public:
virtual void SetIntCacheImpl(const nsTArray<LookAndFeelInt>& aLookAndFeelIntCache);
private:
+ /**
+ * Fetches the Windows accent color from the Windows settings if
+ * the accent color is set to apply to the title bar, otherwise
+ * returns an error code.
+ */
+ nsresult GetAccentColor(nscolor& aColor);
+
+ /**
+ * Determines whether the Windows accent color is considered dark
+ * with a threshhold value and formula that are specified in the
+ * UWP guidelines.
+ * See: https://docs.microsoft.com/en-us/windows/uwp/style/color
+ */
+ bool AccentColorIsDark(nscolor aColor);
+
+ /**
+ * If the Windows accent color from the Windows settings is set
+ * to apply to the title bar, this computes the color that should
+ * be used for text that is to be written over a background that has
+ * the accent color. Otherwise, (if the accent color should not
+ * apply to the title bar) this returns an error code.
+ */
+ nsresult GetAccentColorText(nscolor& aColor);
+
int32_t mUseAccessibilityTheme;
+
+ nsCOMPtr<nsIWindowsRegKey> mDwmKey;
};
#endif