diff --git a/README.md b/README.md index 0ee953710c..4d06358c33 100644 --- a/README.md +++ b/README.md @@ -137,7 +137,7 @@ Per-application profiles switch with the focused app. An `[apps]` alias lets one
![]() |
- Keyboard
|
+ Keyboard
|
![]() |
diff --git a/crates/openlogi-desktop/src/app.rs b/crates/openlogi-desktop/src/app.rs
index 4da8bacab1..d44505aa96 100644
--- a/crates/openlogi-desktop/src/app.rs
+++ b/crates/openlogi-desktop/src/app.rs
@@ -330,7 +330,7 @@ impl AppView {
let dpi_panel = cx.new(DpiPanel::new);
let smartshift_panel = cx.new(SmartShiftPanel::new);
let momentum_panel = cx.new(|cx| MomentumPanel::new(MomentumScope::SelectedDevice, cx));
- let lighting_panel = cx.new(LightingPanel::new);
+ let lighting_panel = cx.new(|cx| LightingPanel::new(window, cx));
let camera_preview = cx.new(CameraPreview::new);
let camera_controls = cx.new(CameraControlsPanel::new);
let light_panel = cx.new(LightPanel::new);
diff --git a/crates/openlogi-desktop/src/features/lighting/keyboard_rgb.rs b/crates/openlogi-desktop/src/features/lighting/keyboard_rgb.rs
index c2514375c2..6e79f126b6 100644
--- a/crates/openlogi-desktop/src/features/lighting/keyboard_rgb.rs
+++ b/crates/openlogi-desktop/src/features/lighting/keyboard_rgb.rs
@@ -7,11 +7,15 @@
use crate::ui::theme::FocusRingStyle as _;
use gpui::{
- Context, InteractiveElement, IntoElement, ParentElement, Render, Role,
- StatefulInteractiveElement as _, Styled, Subscription, Toggled, Window, div, px, rgb,
+ App, AppContext as _, Context, Entity, Focusable as _, Hsla, InteractiveElement, IntoElement,
+ ParentElement, Render, Rgba, Role, StatefulInteractiveElement as _, Styled, Subscription,
+ Toggled, Window, div, prelude::FluentBuilder as _, px, rgb,
};
use gpui_kit::base::Button as BaseButton;
-use gpui_kit::component::{Selectable as _, h_flex, slider::Slider, v_flex};
+use gpui_kit::component::color_picker::{ColorPicker, ColorPickerEvent, ColorPickerState};
+use gpui_kit::component::{
+ IconName, Selectable as _, Sizable as _, Size, h_flex, slider::Slider, v_flex,
+};
use openlogi_core::color::Rgb;
use openlogi_core::config::Lighting;
@@ -41,13 +45,88 @@ const PALETTE: &[Rgb] = &[
Rgb::WHITE,
];
+/// The color the custom control stands for: the current color when the
+/// lighting is on and it is none of the presets.
+fn custom_color(current: &Lighting) -> Option