mirror of
https://github.com/storytold/photocraft.git
synced 2026-11-21 09:26:43 +00:00
style(ui): satisfy rustfmt for the color HUD
This commit is contained in:
1 parent
274d133353
commit
35dc0d1bee
3 files changed
+13
-4
No files matched your search
@@ -145,7 +145,12 @@ pub fn show(app: &mut PhotocraftApp, ctx: &egui::Context) {
|
||||
return;
|
||||
}
|
||||
let (released, esc, pressed_left, hover) = ctx.input(|i| {
|
||||
(i.pointer.button_released(PointerButton::Secondary), i.key_pressed(egui::Key::Escape), i.pointer.button_pressed(PointerButton::Primary), i.pointer.hover_pos())
|
||||
(
|
||||
i.pointer.button_released(PointerButton::Secondary),
|
||||
i.key_pressed(egui::Key::Escape),
|
||||
i.pointer.button_pressed(PointerButton::Primary),
|
||||
i.pointer.hover_pos(),
|
||||
)
|
||||
});
|
||||
if esc {
|
||||
let start = hud.start;
|
||||
@@ -257,7 +262,8 @@ mod tests {
|
||||
let style = h.ctx.global_style();
|
||||
let m = style.spacing.menu_margin;
|
||||
let w = style.visuals.window_stroke().width;
|
||||
let inner = Rect::from_min_max(area.min + vec2(f32::from(m.left) + w, f32::from(m.top) + w), area.max - vec2(f32::from(m.right) + w, f32::from(m.bottom) + w));
|
||||
let inner =
|
||||
Rect::from_min_max(area.min + vec2(f32::from(m.left) + w, f32::from(m.top) + w), area.max - vec2(f32::from(m.right) + w, f32::from(m.bottom) + w));
|
||||
let strip = Rect::from_min_size(inner.min, vec2(HUE_W, SQUARE));
|
||||
(strip, Rect::from_min_max(inner.min + vec2(HUE_W + GAP, 0.0), inner.max))
|
||||
}
|
||||
|
||||
@@ -54,9 +54,9 @@ pub mod channels_panel;
|
||||
pub mod chrome_ui;
|
||||
pub mod cjk_fonts;
|
||||
pub mod clip_line_ui;
|
||||
pub mod color_hud;
|
||||
pub mod color_picker_ui;
|
||||
pub mod color_range_ui;
|
||||
pub mod color_hud;
|
||||
pub mod comps_ui;
|
||||
pub mod control;
|
||||
pub mod corner_radius;
|
||||
|
||||
@@ -117,7 +117,10 @@ pub fn canvas_buttons(app: &mut PhotocraftApp, response: &Response, tool: Tool)
|
||||
let sticky = crate::workspace_ui::sticky_mods(app, mods);
|
||||
let hud_gesture = has_brush_picker(tool) && !layer_menu && !erase && sticky.shift && sticky.alt;
|
||||
let right_press = response.ctx.input(|i| i.pointer.button_pressed(PointerButton::Secondary)) && response.contains_pointer();
|
||||
if hud_gesture && right_press && let Some(p) = response.ctx.input(|i| i.pointer.hover_pos()) {
|
||||
if hud_gesture
|
||||
&& right_press
|
||||
&& let Some(p) = response.ctx.input(|i| i.pointer.hover_pos())
|
||||
{
|
||||
crate::color_hud::open(app, [p.x, p.y], true);
|
||||
}
|
||||
let right_stroke = erase && app.drag.is_some();
|
||||
|
||||
Reference in new issue
Block a user