Skip to content

Commit 51d387e

Browse files
committed
Update prompt shows the app icon: UPDATE_APP carries the 128 px icon
craft-update's App gains icon_png here: the updater, the self-update helper and craft-update's startup prompt all get it through crate::UPDATE_APP. The prompt draws it once craft-libs includes storytold/craft-libs#434; AppImage menu entries get it now. Clippy fixes for Rust 1.99 in untouched code (same logic): - crates/svg/src/import/fx.rs - crates/tools/src/text/tool.rs
1 parent a5da285 commit 51d387e

5 files changed

Lines changed: 11 additions & 6 deletions

File tree

‎apps/vectorcraft/src/main.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ Without a window (converting, scripting, the MCP server), use vectorcraft-cli:
128128
fn main() -> std::process::ExitCode {
129129
// Windows: the update helper is a copy of this program started with `--finish-update`.
130130
#[cfg(windows)]
131-
if let Some(result) = craft_update::self_update::finish(&craft_update::suite::VECTORCRAFT, &std::env::args_os().skip(1).collect::<Vec<_>>()) {
131+
if let Some(result) = craft_update::self_update::finish(&vectorcraft_ui_egui::UPDATE_APP, &std::env::args_os().skip(1).collect::<Vec<_>>()) {
132132
std::process::exit(i32::from(result.is_err()));
133133
}
134134
// Before any thread starts: the pointer must find a cursor theme on Wayland (#2450).

‎crates/svg/src/import/fx.rs‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,9 +362,7 @@ pub(super) fn effects(filters: &[Arc<Filter>], ts: Affine, blends: &HashMap<Stri
362362
}
363363
// A fixed subtraction before blur maps to Darkness; proportional intermediate
364364
// color filters must not be reinterpreted as a different-looking effect.
365-
[V::Shade { sd, linear, dx, dy, keep, subtract, opacity }, V::Graphic]
366-
if (!*linear || *keep == 0.0) && (*keep == 0.0 || *keep == 1.0) =>
367-
{
365+
[V::Shade { sd, linear, dx, dy, keep, subtract, opacity }, V::Graphic] if *keep == 0.0 || !*linear && *keep == 1.0 => {
368366
let v = along(*dx, *dy);
369367
let (darkness, opacity) = (num(if *keep == 0.0 { 100.0 } else { *subtract as f64 * 100.0 }), num(*opacity as f64 * 100.0));
370368
let p = json!({ "x": num(v.x), "y": num(v.y), "blur": blur(*sd), "shade": "darkness", "darkness": darkness, "opacity": opacity, "mode": mode });

‎crates/tools/src/text/tool.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ impl Tool for TypeTool {
145145
return false;
146146
}
147147
let clip: String = self.clipboard.iter().map(|r| r.text.as_str()).collect();
148-
!(self.preedit.is_none() && !normalized.is_empty() && normalized == clip && !cx.paste_plain_text)
148+
self.preedit.is_some() || normalized.is_empty() || normalized != clip || cx.paste_plain_text
149149
}
150150
/// Whether the typing session still describes the edited document; a session ended by an outside
151151
/// command reports false until a replacement commit starts a new one.

‎crates/ui-egui/src/lib.rs‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@
55
//! shortcuts, the ⌘K palette and the control channel ([`control`]).
66
#![forbid(unsafe_code)]
77

8+
/// VectorCraft as craft-update knows it, with its 128 px icon: the update prompt shows the icon,
9+
/// and an AppImage's menu entry gets it.
10+
pub const UPDATE_APP: craft_update::app::App = craft_update::app::App {
11+
icon_png: Some(include_bytes!("../../../assets/app-icon/hicolor/128x128/apps/ai.storyteller.vectorcraft.png")),
12+
..craft_update::suite::VECTORCRAFT
13+
};
14+
815
/// Translate a UI string literal into the language the UI is drawn in (see [`i18n`]).
916
#[macro_export]
1017
macro_rules! tl {

‎crates/ui-egui/src/updates_ui.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ impl Default for Runtime {
2626
fn default() -> Self {
2727
Self {
2828
#[cfg(not(target_arch = "wasm32"))]
29-
updater: Updater::new(&craft_update::suite::VECTORCRAFT, env!("CARGO_PKG_VERSION")),
29+
updater: Updater::new(&crate::UPDATE_APP, env!("CARGO_PKG_VERSION")),
3030
#[cfg(not(target_arch = "wasm32"))]
3131
startup_check: false,
3232
#[cfg(not(target_arch = "wasm32"))]

0 commit comments

Comments
 (0)