From e171b0e42abdf881829b95cba75a1eecfa6c9d17 Mon Sep 17 00:00:00 2001
From: Collin Kemper <collin.kemper@protonmail.com>
Date: Wed, 30 Mar 2022 16:00:05 -0400
Subject: [PATCH 1/5] placed dark-light behind a feature gate in eframe and
 egui_glow

---
 Cargo.lock           | 1 +
 eframe/Cargo.toml    | 2 ++
 egui_glow/Cargo.toml | 2 +-
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/Cargo.lock b/Cargo.lock
index 2d4bb847919b..aca1dd5c3f5d 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1104,6 +1104,7 @@ name = "egui_glow"
 version = "0.17.0"
 dependencies = [
  "bytemuck",
+ "dark-light",
  "egui",
  "egui-winit",
  "epi",
diff --git a/eframe/Cargo.toml b/eframe/Cargo.toml
index 5b2f4b40fbfc..f1a50935f553 100644
--- a/eframe/Cargo.toml
+++ b/eframe/Cargo.toml
@@ -42,6 +42,8 @@ screen_reader = [
   "egui_web/screen_reader",
 ]
 
+dark-light = [ "egui-winit/dark-light"]              # detect dark mode system preference
+
 
 [dependencies]
 egui = { version = "0.17.0", path = "../egui", default-features = false }
diff --git a/egui_glow/Cargo.toml b/egui_glow/Cargo.toml
index 717d8d7bcd5c..23d0f748c7a4 100644
--- a/egui_glow/Cargo.toml
+++ b/egui_glow/Cargo.toml
@@ -67,10 +67,10 @@ tracing = "0.1"
 
 [target.'cfg(not(target_arch = "wasm32"))'.dependencies]
 egui-winit = { version = "0.17.0", path = "../egui-winit", optional = true, default-features = false, features = [
-  "dark-light",
   "epi_backend",
 ] }
 glutin = { version = "0.28.0", optional = true }
+dark-light = { version = "0.2.1", optional = true }                 # detect dark mode system preference
 
 [target.'cfg(target_arch = "wasm32")'.dependencies]
 web-sys = { version = "0.3", features = ["console"] }

From 413a1112274bca70faf28dd187eebab606143926 Mon Sep 17 00:00:00 2001
From: Collin Kemper <collin.kemper@protonmail.com>
Date: Wed, 30 Mar 2022 16:18:40 -0400
Subject: [PATCH 2/5] placed dark-light behind a feature gate in eframe and
 egui_glow

---
 Cargo.lock           | 1 -
 egui_glow/Cargo.toml | 3 ++-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Cargo.lock b/Cargo.lock
index aca1dd5c3f5d..2d4bb847919b 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1104,7 +1104,6 @@ name = "egui_glow"
 version = "0.17.0"
 dependencies = [
  "bytemuck",
- "dark-light",
  "egui",
  "egui-winit",
  "epi",
diff --git a/egui_glow/Cargo.toml b/egui_glow/Cargo.toml
index 23d0f748c7a4..3d62c53e76d7 100644
--- a/egui_glow/Cargo.toml
+++ b/egui_glow/Cargo.toml
@@ -53,6 +53,8 @@ screen_reader = ["egui-winit/screen_reader"]
 # if you want to use glow painter on web disable this feature.
 winit = ["egui-winit", "glutin"]
 
+dark-light = ["egui-winit/dark-light"]                 # detect dark mode system preference
+
 
 [dependencies]
 egui = { version = "0.17.0", path = "../egui", default-features = false, features = [
@@ -70,7 +72,6 @@ egui-winit = { version = "0.17.0", path = "../egui-winit", optional = true, defa
   "epi_backend",
 ] }
 glutin = { version = "0.28.0", optional = true }
-dark-light = { version = "0.2.1", optional = true }                 # detect dark mode system preference
 
 [target.'cfg(target_arch = "wasm32")'.dependencies]
 web-sys = { version = "0.3", features = ["console"] }

From 9d7bbff388b67670b7327809dc4994c96fb49d68 Mon Sep 17 00:00:00 2001
From: Collin Kemper <collin.kemper@protonmail.com>
Date: Wed, 30 Mar 2022 16:54:31 -0400
Subject: [PATCH 3/5] updated changelog to reflect changes

---
 CHANGELOG.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4965ec97ebc2..fc57dd5d3327 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -17,6 +17,7 @@ NOTE: [`epaint`](epaint/CHANGELOG.md), [`eframe`](eframe/CHANGELOG.md), [`egui_w
 * `ClippedMesh` has been replaced with `ClippedPrimitive` ([#1351](https://github.com/emilk/egui/pull/1351)).
 * Renamed `Frame::margin` to `Frame::inner_margin`.
 * Renamed `AlphaImage` to `FontImage` to discourage any other use for it ([#1412](https://github.com/emilk/egui/pull/1412)).
+* `dark-light` is not an opt-in feature for `eframe` and `egui_glow`.
 
 ### Fixed 🐛
 * Fixed ComboBoxes always being rendered left-aligned ([#1304](https://github.com/emilk/egui/pull/1304)).

From ec9a8fe28dd4b22bc0490429e3e7398f9470bad5 Mon Sep 17 00:00:00 2001
From: Collin Kemper <collin.kemper@protonmail.com>
Date: Wed, 30 Mar 2022 17:06:55 -0400
Subject: [PATCH 4/5] updated changelog to reflect changes

---
 CHANGELOG.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index fc57dd5d3327..12cc1115702b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -17,7 +17,7 @@ NOTE: [`epaint`](epaint/CHANGELOG.md), [`eframe`](eframe/CHANGELOG.md), [`egui_w
 * `ClippedMesh` has been replaced with `ClippedPrimitive` ([#1351](https://github.com/emilk/egui/pull/1351)).
 * Renamed `Frame::margin` to `Frame::inner_margin`.
 * Renamed `AlphaImage` to `FontImage` to discourage any other use for it ([#1412](https://github.com/emilk/egui/pull/1412)).
-* `dark-light` is not an opt-in feature for `eframe` and `egui_glow`.
+* `dark-light` is now an opt-in feature for `eframe` and `egui_glow`.
 
 ### Fixed 🐛
 * Fixed ComboBoxes always being rendered left-aligned ([#1304](https://github.com/emilk/egui/pull/1304)).

From d7e8dab93d6f28298e3185809a460583e7f29ac2 Mon Sep 17 00:00:00 2001
From: Collin Kemper <55854132+collin-kemper@users.noreply.github.com>
Date: Thu, 31 Mar 2022 07:52:11 -0400
Subject: [PATCH 5/5] Update CHANGELOG.md

---
 CHANGELOG.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 12cc1115702b..6ded790d2df2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -17,7 +17,7 @@ NOTE: [`epaint`](epaint/CHANGELOG.md), [`eframe`](eframe/CHANGELOG.md), [`egui_w
 * `ClippedMesh` has been replaced with `ClippedPrimitive` ([#1351](https://github.com/emilk/egui/pull/1351)).
 * Renamed `Frame::margin` to `Frame::inner_margin`.
 * Renamed `AlphaImage` to `FontImage` to discourage any other use for it ([#1412](https://github.com/emilk/egui/pull/1412)).
-* `dark-light` is now an opt-in feature for `eframe` and `egui_glow`.
+* `dark-light` (dark mode detection) is now an opt-in feature for `eframe` and `egui_glow` ([#1437](https://github.com/emilk/egui/pull/1437)).
 
 ### Fixed 🐛
 * Fixed ComboBoxes always being rendered left-aligned ([#1304](https://github.com/emilk/egui/pull/1304)).