mirror of
https://github.com/storytold/photocraft.git
synced 2026-11-07 10:54:10 +00:00
ui: larger Align icons and overflow button; Save for Web keeps its width on an invalid Matte
- Move tool Align buttons: 16 px glyph in the 24 px box (was 12 px) - Document/panel overflow button: 16 px glyph in the normal text colour (was 12 px, dim) - Save for Web: a failed preview no longer draws its error beside the pane, which widened the dialog; the same message stays on the row above the panes
This commit is contained in:
1 parent
1df36facbd
commit
aedab302b2
3 files changed
+5
-6
No files matched your search
@@ -35,7 +35,7 @@ pub fn options(app: &mut PhotocraftApp, ui: &mut egui::Ui) {
|
||||
for (cmd, icon, label) in ALIGN {
|
||||
let tip = format!("{}: {}", tl!("Align"), tl!(label));
|
||||
let on = app.session.is_enabled(cmd);
|
||||
if ui.add_enabled_ui(on, |ui| icons::button(ui, icon, 24.0, false, &tip)).inner.clicked() {
|
||||
if ui.add_enabled_ui(on, |ui| icons::button_with_icon_size(ui, icon, 24.0, 16.0, false, &tip)).inner.clicked() {
|
||||
let _ = app.run(cmd, json!({}));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -331,10 +331,9 @@ fn web_pane(app: &PhotocraftApp, ui: &mut egui::Ui, size: egui::Vec2, p: Option<
|
||||
None => (px.iter().flat_map(|q| q.map(|v| (v.clamp(0.0, 1.0) * 255.0).round() as u8)).collect::<Vec<u8>>(), None),
|
||||
Some(p) => match web_preview::optimized(ui, key, &format!("{}|{rev}|{frame:?}|{size_sig}", doc.id.0), p, &px, w, h) {
|
||||
Ok((preview, bytes, colors, ext)) => (preview, Some(((bytes as f64 * ratio) as usize, colors, ext))),
|
||||
Err(error) => {
|
||||
ui.label(error);
|
||||
(vec![0; (w * h * 4) as usize], None)
|
||||
}
|
||||
// The error shows on the row above the panes; a label here sat beside the pane
|
||||
// and widened the dialog (#8830).
|
||||
Err(_) => (vec![0; (w * h * 4) as usize], None),
|
||||
},
|
||||
};
|
||||
let img = egui::ColorImage::from_rgba_unmultiplied([w as usize, h as usize], &rgba);
|
||||
|
||||
@@ -65,7 +65,7 @@ pub fn overflow_button(ui: &mut Ui, id: egui::Id, r: Rect, tip: &str, labels: &[
|
||||
if resp.hovered() {
|
||||
paint_ui.painter().rect_filled(r.shrink2(vec2(1.0, 3.0)), t.radius_sm, t.hover.gamma_multiply(0.6));
|
||||
}
|
||||
crate::icons::paint(&paint_ui, r, "chevrons-right", 12.0, if resp.hovered() { t.text } else { t.text_dim });
|
||||
crate::icons::paint(&paint_ui, r, "chevrons-right", 16.0, t.text);
|
||||
resp.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::Button, ui.is_enabled(), tip));
|
||||
let resp = resp.on_hover_text(tip);
|
||||
egui::Popup::menu(&resp).show(|ui| {
|
||||
|
||||
Reference in new issue
Block a user