forked from 1b-agent/opencadstudio-upstream
Merge pull request #1460 from lalomalvi:codex/missing-font-prompt-hardening-pr
This commit is contained in:
commit
9cf9184d9a
7 files changed
+114
-15
No files matched your search
@@ -17,6 +17,7 @@ fn muted_style(theme: &Theme) -> text::Style {
|
||||
pub fn view_window<'a>(
|
||||
fonts: &'a [String],
|
||||
font_source: &'a str,
|
||||
downloading: bool,
|
||||
sizing: crate::ui::modal::ModalSizing,
|
||||
) -> Element<'a, Message> {
|
||||
let content_width = if matches!(sizing.width, Length::Fill) {
|
||||
@@ -33,16 +34,24 @@ pub fn view_window<'a>(
|
||||
.iter()
|
||||
.map(|name| text(format!(" {name}")).size(12).into())
|
||||
.collect();
|
||||
let download = button(
|
||||
text(if downloading {
|
||||
crate::t!("Downloading...")
|
||||
} else {
|
||||
crate::t!("Download available")
|
||||
})
|
||||
.size(12),
|
||||
)
|
||||
.on_press_maybe((!downloading).then_some(Message::MissingFontsDownload))
|
||||
.style(button::primary)
|
||||
.padding([6, 14]);
|
||||
let actions = row![
|
||||
Space::new().width(content_width),
|
||||
button(text(crate::t!("Skip")).size(12))
|
||||
.on_press(Message::MissingFontsDismiss)
|
||||
.on_press_maybe((!downloading).then_some(Message::MissingFontsDismiss))
|
||||
.style(button::secondary)
|
||||
.padding([6, 14]),
|
||||
button(text(crate::t!("Download")).size(12))
|
||||
.on_press(Message::MissingFontsDownload)
|
||||
.style(button::primary)
|
||||
.padding([6, 14]),
|
||||
download,
|
||||
]
|
||||
.spacing(8);
|
||||
|
||||
@@ -50,7 +59,7 @@ pub fn view_window<'a>(
|
||||
column![
|
||||
text(crate::t!("Missing fonts")).size(20),
|
||||
text(crate::t!(
|
||||
"This drawing uses fonts that are not installed on this machine. Download them from the OpenCADStudio community font repository?"
|
||||
"This drawing uses fonts that are not installed on this machine. OpenCADStudio can download any redistributable fonts that exist in the selected repository; unavailable fonts will keep using a substitute."
|
||||
))
|
||||
.size(11)
|
||||
.style(muted_style),
|
||||
|
||||
Reference in new issue
Block a user