forked from 1b-agent/opencadstudio-upstream
Select Color: gray pipette that takes the accent colour on hover
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013rGmDUNr1hUf4zo1X3dak8
This commit is contained in:
1 file changed
+18
-1
@@ -398,7 +398,24 @@ impl ColorPicker {
|
|||||||
} else {
|
} else {
|
||||||
Some(
|
Some(
|
||||||
// Just the icon, without a button frame.
|
// Just the icon, without a button frame.
|
||||||
button(crate::ui::icons::themed(crate::ui::icons::EYEDROPPER, 24.0))
|
button(
|
||||||
|
// Gray at rest; the accent colour while the pointer is on it.
|
||||||
|
iced::widget::svg(crate::ui::icons::themed_handle(
|
||||||
|
crate::ui::icons::EYEDROPPER,
|
||||||
|
))
|
||||||
|
.width(24)
|
||||||
|
.height(24)
|
||||||
|
.style(|theme: &Theme, status| iced::widget::svg::Style {
|
||||||
|
color: Some(match status {
|
||||||
|
iced::widget::svg::Status::Hovered => {
|
||||||
|
theme.palette().primary.base.color
|
||||||
|
}
|
||||||
|
iced::widget::svg::Status::Idle => {
|
||||||
|
theme.palette().background.base.text.scale_alpha(0.5)
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
}),
|
||||||
|
)
|
||||||
.on_press(picker_msg(ColorPickerMsg::Eyedropper(EyedropperMsg::Start)))
|
.on_press(picker_msg(ColorPickerMsg::Eyedropper(EyedropperMsg::Start)))
|
||||||
.padding(0)
|
.padding(0)
|
||||||
.style(|_theme: &Theme, _status| button::Style::default())
|
.style(|_theme: &Theme, _status| button::Style::default())
|
||||||
|
|||||||
Reference in new issue
Block a user