mirror of
https://github.com/storytold/deckcraft.git
synced 2026-12-01 10:47:56 +01:00
Format pane colour rows open their colour menu on a click of the opener
The popover hung from the opener with the manual trigger, so a click on a kept-binding colour row never opened it; it now opens on a click as every other kept popover does, under a salt of its own so it does not share the row field's id. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5ca353dfbc
commit
6ed8efc56a
1 file changed
+3
-3
@@ -2,7 +2,7 @@
|
||||
|
||||
use craft::color_ui::ui::{ColorPick, ThemeColorMenu};
|
||||
use craft::ui::buttons::Button;
|
||||
use craft::ui::contract::{Bind, BodyCx, FieldLayout, Props as _, Show as _, ShowContainer as _};
|
||||
use craft::ui::contract::{Bind, BodyCx, FieldLayout, Props as _, Show as _, ShowContainer as _, Trigger};
|
||||
use craft::ui::controls::disclosure::DisclosureGlyph;
|
||||
use craft::ui::form::Field;
|
||||
use craft::ui::popover::Popover;
|
||||
@@ -80,8 +80,8 @@ pub(crate) fn color_row_named(
|
||||
});
|
||||
field.settle(|_, output| {
|
||||
let mut popup = Popover::new(Word::plain("Color"), Bind::kept().reset(false))
|
||||
.id_salt(&key)
|
||||
.opened_by(&output.response)
|
||||
.id_salt(&format!("{key}:menu"))
|
||||
.overlay(|overlay| overlay.opened_by(&output.response, Trigger::Click))
|
||||
.show(ui, |ui, cx| color_menu(app, ui, cx, &key, none));
|
||||
let picked = popup.settle(|_, pick| pick.take()).flatten();
|
||||
let answer = take_color_answer(app, &key);
|
||||
|
||||
Reference in new issue
Block a user