Skip to content

misterdownloadmanager: The ultimate open-source, clean-room download manager written from scratch in pure Rust for Windows, Mac, and Linux

Crash report window: a long status line stays inside the window (part of #164) (#241)

Ahmed Nefzaoui806be45ff54d
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f44c7407..91dd1217 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -538,6 +538,13 @@ Each release's notes on GitHub come from its section here (`## [X.Y.Z]`, see
### Fixed
+- **The crash report window's status line stays inside the window**
+ ([#164](https://github.com/anefzaoui/misterdownloadmanager/issues/164)): the line above the
+ check box ("The symbols couldn't be fetched: …", an issue's title, a translation) ran past the
+ window's right edge, or its left edge in Persian. It is now cut with "…" at the margin and shown
+ whole under the pointer. Its title ("Mister Download Manager crash report") is now in MDM's
+ language too; it was always in the system's. On Windows that also gives its title bar MDM's
+ light or dark again in every language: outside English it kept Windows' own mode.
- **Three more controls fit their translated text**
([#192](https://github.com/anefzaoui/misterdownloadmanager/issues/192), after #212): in Russian
and a few other languages, Download File Info's **Preview**, Options → Proxy's **Get System**
diff --git a/ROADMAP.md b/ROADMAP.md
index 9b046003..d4acd326 100644
--- a/ROADMAP.md
+++ b/ROADMAP.md
@@ -13,6 +13,10 @@ Everything below ships together, in one release, as version 0.3.0.
### Done
+- ✅ The crash report window's status line (such as "The symbols couldn't be fetched: …") stays
+ inside the window: cut with "…" at its margin and shown whole under the pointer; its title is
+ in MDM's language, and its title bar in MDM's light or dark (part of
+ [#164](https://github.com/anefzaoui/misterdownloadmanager/issues/164))
- ✅ Control MDM from a phone or another computer on the local network: **Options → Remote**, off
by default; a paired device adds links, magnets and torrents, sees the list and pauses, starts
and removes downloads ([#141](https://github.com/anefzaoui/misterdownloadmanager/issues/141))
diff --git a/crates/app/src/crashui.rs b/crates/app/src/crashui.rs
index c4971ebf..4eaf5c3a 100644
--- a/crates/app/src/crashui.rs
+++ b/crates/app/src/crashui.rs
@@ -77,8 +77,11 @@ pub fn monitor_main(m: MonitorArgs) -> eframe::Result {
};
tracing::warn!("crash monitor: {} report", kind.word());
- // The window speaks MDM's language and follows its theme.
+ // The window speaks MDM's language and follows its theme. The language first: the title
+ // below is translated before the window exists, and Windows' caption is found by it
+ // (`win32::caption_dark` in `update`).
let settings = crate::store::load().settings;
+ crate::i18n::set_lang(settings.language.as_deref());
let builder = crate::quiet(
ViewportBuilder::default()
.with_title(crate::i18n::t("Mister Download Manager crash report"))
@@ -109,7 +112,6 @@ pub fn monitor_main(m: MonitorArgs) -> eframe::Result {
crate::renderer::run("misterdownloadmanager-crash", &plan, options, move |cc| {
crate::theme::select(&crate::theme::startup_id(&settings.theme), &cc.egui_ctx);
crate::theme::apply(&cc.egui_ctx);
- crate::i18n::set_lang(settings.language.as_deref());
crate::theme::language_fonts(&cc.egui_ctx);
crate::theme::update(
settings.dark_mode_support,
@@ -471,7 +473,14 @@ impl ReportWindow {
None
};
if let Some(s) = self.told.clone().or(status) {
- winui::text(&p, o.x + 16.0, o.y + 452.0, &s, winui::TEXT());
+ // One line between the report and the check box: a long one (the symbols' note, a
+ // translation, an issue's title) is cut at the window's right margin with "...",
+ // and shown whole under the pointer (#164).
+ let (rc, cut) =
+ winui::text_fit(&p, o.x + 16.0, o.y + 452.0, &s, winui::TEXT(), o.x + 604.0);
+ if cut {
+ winui::full_on_hover(ui, rc, "crash-status", &s);
+ }
}
if let Some(d) = made.as_ref().and_then(|m| m.dump.as_ref())
&& d.exists()