mirror of
https://github.com/storytold/lightcraft.git
synced 2026-10-30 13:07:43 -06:00
LRC-LIB-KEYWORDS: idle controls in the Keyword List say nothing
With nothing selected a tick box still offered "Add to Selected Photos", and while a filter holds the levels open the triangle lit up on hover though a click does nothing. Neither does now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
decebccb89
commit
228561d4c9
@@ -186,7 +186,9 @@ fn row(app: &mut LightcraftApp, ui: &mut egui::Ui, r: &Row, selection: &[PhotoId
|
||||
} else {
|
||||
vec![c + vec2(-2.0, -4.0), c + vec2(3.0, 0.0), c + vec2(-2.0, 4.0)]
|
||||
};
|
||||
ui.painter().add(egui::Shape::convex_polygon(pts, if tr.hovered() { t.text } else { t.text_dim }, Stroke::NONE));
|
||||
// while a filter opens the levels the triangle does nothing: it doesn't light up either
|
||||
let lit = tr.hovered() && can_fold;
|
||||
ui.painter().add(egui::Shape::convex_polygon(pts, if lit { t.text } else { t.text_dim }, Stroke::NONE));
|
||||
if tr.clicked() && can_fold {
|
||||
let key = r.path.to_lowercase();
|
||||
if r.open {
|
||||
@@ -219,10 +221,15 @@ fn row(app: &mut LightcraftApp, ui: &mut egui::Ui, r: &Row, selection: &[PhotoId
|
||||
ui.painter().rect_stroke(boxr, 2.0, Stroke::new(1.0, edge), StrokeKind::Inside);
|
||||
}
|
||||
}
|
||||
let tb = tb.on_hover_text(crate::i18n::tr(match state {
|
||||
Tick::All => "Remove from Selected Photos",
|
||||
_ => "Add to Selected Photos",
|
||||
}));
|
||||
// (with nothing selected it does nothing, and says nothing)
|
||||
let tb = if on {
|
||||
tb.on_hover_text(crate::i18n::tr(match state {
|
||||
Tick::All => "Remove from Selected Photos",
|
||||
_ => "Add to Selected Photos",
|
||||
}))
|
||||
} else {
|
||||
tb
|
||||
};
|
||||
if tb.clicked() {
|
||||
let key = if state == Tick::All { "removeKeywords" } else { "addKeywords" };
|
||||
let _ = app.run("photo.setMeta", json!({key: [r.path]}));
|
||||
|
||||
Reference in New Issue
Block a user