forked from 1b-agent/opencadstudio-upstream
[IMP] OneBSpace rebrand of OpenCADStudio -> OneCAD Draft (wordmark, about, crash banner, 23 locales; strip SW/manifest; air-gap: update check, donations, discussions, external help links)
This commit is contained in:
1 parent
c9e763006e
commit
193f2ae9ab
57 files changed
+760
-1091
No files matched your search
+20
-206
@@ -3669,7 +3669,7 @@ fn start_page_content<'a>(
|
||||
action_width_out: std::sync::Arc<std::sync::atomic::AtomicU32>,
|
||||
active: super::StartSection,
|
||||
) -> Element<'a, Message> {
|
||||
let headline = text("Open CAD Studio").size(40).style(start_primary_style);
|
||||
let headline = text("OneCAD Draft").size(40).style(start_primary_style); // OneBSpace (OneCAD Draft): rebranded wordmark
|
||||
|
||||
// Plain outlined button (Open / New / Help / Contribute).
|
||||
let outline_btn = |label: String, msg: Message| {
|
||||
@@ -3695,23 +3695,8 @@ fn start_page_content<'a>(
|
||||
})
|
||||
};
|
||||
|
||||
// Donate — the prominent call-to-action, using the theme's danger role.
|
||||
let donate_btn = {
|
||||
button(
|
||||
row![
|
||||
crate::ui::icons::themed_danger_text(crate::ui::icons::HEART, 14.0),
|
||||
text(crate::tr!("start", "donate")).size(14),
|
||||
]
|
||||
.spacing(5)
|
||||
.align_y(iced::Center),
|
||||
)
|
||||
.on_press(Message::RibbonToolClick {
|
||||
tool_id: "DONATE".to_string(),
|
||||
event: crate::modules::ModuleEvent::Command("DONATE".to_string()),
|
||||
})
|
||||
.padding([10, 22])
|
||||
.style(|theme: &Theme, status| start_action_shape(button::danger(theme, status)))
|
||||
};
|
||||
// OneBSpace (OneCAD Draft): the donation call-to-action was removed —
|
||||
// air-gapped build, no external fundraising links.
|
||||
|
||||
let primary_row = WrapFlow::new(vec![
|
||||
outline_btn(crate::tr!("start", "new-drawing"), Message::TabNew).into(),
|
||||
@@ -3725,7 +3710,6 @@ fn start_page_content<'a>(
|
||||
)
|
||||
.into(),
|
||||
outline_btn(crate::tr!("start", "open-file"), Message::OpenFile).into(),
|
||||
donate_btn.into(),
|
||||
])
|
||||
.spacing_x(12.0)
|
||||
.row_h(48.0)
|
||||
@@ -3745,90 +3729,15 @@ fn start_page_content<'a>(
|
||||
];
|
||||
secondary_items
|
||||
.push(outline_btn(crate::tr!("action", "plugins"), Message::PluginManagerOpen).into());
|
||||
// The web build is already in the browser, so only the desktop offers a
|
||||
// link to the web version.
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
{
|
||||
// Filled with the active theme's primary colour.
|
||||
secondary_items.push(
|
||||
button(text(crate::t!("OCS Web")).size(14))
|
||||
.on_press(Message::RibbonToolClick {
|
||||
tool_id: "WEBVERSION".to_string(),
|
||||
event: crate::modules::ModuleEvent::Command("WEBVERSION".to_string()),
|
||||
})
|
||||
.padding([10, 22])
|
||||
.style(|theme: &Theme, status| start_action_shape(button::primary(theme, status)))
|
||||
.into(),
|
||||
);
|
||||
}
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
secondary_items.push(
|
||||
button(text(crate::t!("OCS Desktop")).size(14))
|
||||
.on_press(Message::OpenUrl(
|
||||
"https://github.com/HakanSeven12/OpenCADStudio/releases/latest".to_string(),
|
||||
))
|
||||
.padding([10, 22])
|
||||
.style(|theme: &Theme, status| start_action_shape(button::primary(theme, status)))
|
||||
.into(),
|
||||
);
|
||||
// OneBSpace (OneCAD Draft): the "OCS Web" / "OCS Desktop" cross-promotion
|
||||
// buttons were removed — no external download or website links.
|
||||
let secondary_row = WrapFlow::new(secondary_items)
|
||||
.spacing_x(12.0)
|
||||
.row_h(44.0)
|
||||
.report_natural_width(action_width_out.clone());
|
||||
|
||||
let reddit_btn = button(
|
||||
row![
|
||||
iced::widget::svg(iced::widget::svg::Handle::from_memory(include_bytes!(
|
||||
"../../../assets/icons/reddit.svg"
|
||||
)))
|
||||
.width(20)
|
||||
.height(20),
|
||||
text("r/OpenCADStudio").size(14),
|
||||
]
|
||||
.spacing(7)
|
||||
.align_y(iced::Center),
|
||||
)
|
||||
.on_press(Message::OpenUrl(
|
||||
"https://www.reddit.com/r/OpenCADStudio/".to_string(),
|
||||
))
|
||||
.padding([10, 22])
|
||||
.style(|theme: &Theme, status| {
|
||||
let palette = theme.palette();
|
||||
let pair = match status {
|
||||
button::Status::Hovered => palette.background.strong,
|
||||
_ => palette.background.weak,
|
||||
};
|
||||
start_action_shape(button::Style {
|
||||
background: Some(Background::Color(pair.color)),
|
||||
text_color: pair.text,
|
||||
border: Border {
|
||||
color: Color::from_rgb8(255, 69, 0),
|
||||
width: 1.0,
|
||||
..Default::default()
|
||||
},
|
||||
..Default::default()
|
||||
})
|
||||
});
|
||||
|
||||
let sponsors = column![
|
||||
text(crate::tr!("start", "sponsors")).size(15),
|
||||
mouse_area(
|
||||
container(
|
||||
iced::widget::svg(iced::widget::svg::Handle::from_memory(include_bytes!(
|
||||
"../../../assets/sponsors/openaec-logo-dark-on-light.svg"
|
||||
)))
|
||||
.width(Fill)
|
||||
.height(iced::Length::Fixed(120.0))
|
||||
.content_fit(iced::ContentFit::Contain),
|
||||
)
|
||||
.width(Fill.max(300.0)),
|
||||
)
|
||||
.interaction(iced::mouse::Interaction::Pointer)
|
||||
.on_press(Message::OpenUrl("https://open-aec.com/".to_string())),
|
||||
]
|
||||
.spacing(10)
|
||||
.align_x(iced::alignment::Horizontal::Center)
|
||||
.width(Fill);
|
||||
// OneBSpace (OneCAD Draft): the community Reddit link and the Open-AEC
|
||||
// sponsor block were removed — no external links in the Start page.
|
||||
|
||||
let content = column![
|
||||
Space::new().height(iced::Length::Fixed(28.0)),
|
||||
@@ -3837,10 +3746,6 @@ fn start_page_content<'a>(
|
||||
container(primary_row).center_x(Fill),
|
||||
Space::new().height(iced::Length::Fixed(10.0)),
|
||||
container(secondary_row).center_x(Fill),
|
||||
Space::new().height(iced::Length::Fixed(10.0)),
|
||||
container(reddit_btn).center_x(Fill),
|
||||
Space::new().height(iced::Length::Fixed(20.0)),
|
||||
sponsors,
|
||||
Space::new().height(iced::Length::Fixed(52.0)),
|
||||
]
|
||||
.spacing(0)
|
||||
@@ -3908,8 +3813,9 @@ fn start_page_content<'a>(
|
||||
);
|
||||
let welcome = container(content).width(Fill).height(Fill);
|
||||
|
||||
// Tutorial-videos rail: the official playlist, fetched at boot (cached on
|
||||
// disk) — thumbnail card + title per video, click opens the browser.
|
||||
// Tutorial-videos rail: local listing only (cached on disk / bundled
|
||||
// videos.json) — thumbnail card + title per video; OneBSpace (OneCAD
|
||||
// Draft): no click-through, cards are informational (air-gapped build).
|
||||
let videos_panel: Element<'a, Message> = {
|
||||
// Derive the 16:9 cover box from the actual shared list width so the
|
||||
// whole thumbnail remains visible when that width changes.
|
||||
@@ -3946,11 +3852,9 @@ fn start_page_content<'a>(
|
||||
);
|
||||
}
|
||||
card = card.push(text(v.title.clone()).size(12).style(start_muted_style));
|
||||
list = list.push(
|
||||
mouse_area(card)
|
||||
.interaction(iced::mouse::Interaction::Pointer)
|
||||
.on_press(Message::OpenUrl(crate::videos::watch_url(&v.id))),
|
||||
);
|
||||
// OneBSpace (OneCAD Draft): cards are informational only — no
|
||||
// click-through to YouTube (air-gapped build).
|
||||
list = list.push(card);
|
||||
}
|
||||
if videos.is_empty() {
|
||||
let note = if videos_loading {
|
||||
@@ -3960,32 +3864,7 @@ fn start_page_content<'a>(
|
||||
};
|
||||
list = list.push(text(note).size(12).style(start_muted_style));
|
||||
}
|
||||
let playlist_btn = mouse_area(
|
||||
container(text(crate::tr!("start", "open-playlist")).size(12))
|
||||
.padding([6, 10])
|
||||
.width(Fill)
|
||||
.center_x(Fill)
|
||||
.style(|theme: &Theme| {
|
||||
let pair = theme.palette().danger.base;
|
||||
container::Style {
|
||||
background: Some(Background::Color(pair.color)),
|
||||
border: Border {
|
||||
color: Color::TRANSPARENT,
|
||||
width: 0.0,
|
||||
radius: 6.0.into(),
|
||||
},
|
||||
text_color: Some(pair.text),
|
||||
..Default::default()
|
||||
}
|
||||
}),
|
||||
)
|
||||
.interaction(iced::mouse::Interaction::Pointer)
|
||||
.on_press(Message::OpenUrl(crate::videos::PLAYLIST_URL.to_string()));
|
||||
container(column![
|
||||
iced::widget::scrollable(list).height(Fill),
|
||||
Space::new().height(iced::Length::Fixed(12.0)),
|
||||
playlist_btn,
|
||||
])
|
||||
container(column![iced::widget::scrollable(list).height(Fill)])
|
||||
.width(match start_layout {
|
||||
StartLayout::AllPanels => iced::Length::Fixed(panel_w),
|
||||
StartLayout::WithoutVideos
|
||||
@@ -4055,11 +3934,7 @@ fn start_page_content<'a>(
|
||||
..Default::default()
|
||||
}
|
||||
});
|
||||
list = list.push(
|
||||
mouse_area(card)
|
||||
.interaction(iced::mouse::Interaction::Pointer)
|
||||
.on_press(Message::OpenUrl(discussion.url.clone())),
|
||||
);
|
||||
list = list.push(card);
|
||||
}
|
||||
if discussions.is_empty() {
|
||||
let note = if discussions_loading {
|
||||
@@ -4069,34 +3944,7 @@ fn start_page_content<'a>(
|
||||
};
|
||||
list = list.push(text(note).size(12).style(start_muted_style));
|
||||
}
|
||||
let open_btn = mouse_area(
|
||||
container(text(crate::tr!("start", "open-discussions")).size(12))
|
||||
.padding([6, 10])
|
||||
.width(Fill)
|
||||
.center_x(Fill)
|
||||
.style(|theme: &Theme| {
|
||||
let pair = theme.palette().primary.base;
|
||||
container::Style {
|
||||
background: Some(Background::Color(pair.color)),
|
||||
border: Border {
|
||||
color: Color::TRANSPARENT,
|
||||
width: 0.0,
|
||||
radius: 6.0.into(),
|
||||
},
|
||||
text_color: Some(pair.text),
|
||||
..Default::default()
|
||||
}
|
||||
}),
|
||||
)
|
||||
.interaction(iced::mouse::Interaction::Pointer)
|
||||
.on_press(Message::OpenUrl(
|
||||
crate::discussions::DISCUSSIONS_URL.to_string(),
|
||||
));
|
||||
container(column![
|
||||
iced::widget::scrollable(list).height(Fill),
|
||||
Space::new().height(iced::Length::Fixed(12.0)),
|
||||
open_btn,
|
||||
])
|
||||
container(column![iced::widget::scrollable(list).height(Fill)])
|
||||
.width(match start_layout {
|
||||
StartLayout::AllPanels | StartLayout::WithoutVideos => iced::Length::Fixed(panel_w),
|
||||
StartLayout::WithoutVideosAndDiscussions
|
||||
@@ -4120,9 +3968,9 @@ fn start_page_content<'a>(
|
||||
.into()
|
||||
};
|
||||
|
||||
// Right rail: Patreon supporters, fetched at boot. When the list is empty
|
||||
// (no token configured / offline) only the "Support on Patreon" button
|
||||
// shows, so the rail always invites support.
|
||||
// OneBSpace (OneCAD Draft): right rail shows the local supporters list
|
||||
// only — the Patreon fetch and the "Support on Patreon" button were
|
||||
// removed (air-gapped build, no external links).
|
||||
let supporters: Element<'a, Message> = {
|
||||
let mut list = column![
|
||||
text(crate::tr!("start", "supporters")).size(15),
|
||||
@@ -4146,41 +3994,7 @@ fn start_page_content<'a>(
|
||||
.spacing(6),
|
||||
);
|
||||
}
|
||||
let support_btn = mouse_area(
|
||||
container(
|
||||
iced::widget::row![
|
||||
crate::ui::icons::themed_danger_text(crate::ui::icons::HEART, 13.0),
|
||||
text(crate::tr!("start", "support-on-patreon")).size(12),
|
||||
]
|
||||
.spacing(6)
|
||||
.align_y(iced::Center),
|
||||
)
|
||||
.padding([6, 10])
|
||||
.width(Fill)
|
||||
.center_x(Fill)
|
||||
.style(|theme: &Theme| {
|
||||
let pair = theme.palette().danger.base;
|
||||
container::Style {
|
||||
background: Some(Background::Color(pair.color)),
|
||||
border: Border {
|
||||
color: Color::TRANSPARENT,
|
||||
width: 0.0,
|
||||
radius: 6.0.into(),
|
||||
},
|
||||
text_color: Some(pair.text),
|
||||
..Default::default()
|
||||
}
|
||||
}),
|
||||
)
|
||||
.interaction(iced::mouse::Interaction::Pointer)
|
||||
.on_press(Message::OpenUrl(
|
||||
"https://patreon.com/HakanSeven12".to_string(),
|
||||
));
|
||||
container(column![
|
||||
iced::widget::scrollable(list).height(Fill),
|
||||
Space::new().height(iced::Length::Fixed(12.0)),
|
||||
support_btn,
|
||||
])
|
||||
container(column![iced::widget::scrollable(list).height(Fill)])
|
||||
.width(match start_layout {
|
||||
StartLayout::AllPanels
|
||||
| StartLayout::WithoutVideos
|
||||
|
||||
@@ -2589,10 +2589,10 @@ fn donation_dialog_window(sizing: crate::ui::modal::ModalSizing) -> Element<'sta
|
||||
fn default_assoc_dialog_window(sizing: crate::ui::modal::ModalSizing) -> Element<'static, Message> {
|
||||
container(
|
||||
column![
|
||||
text(t!("Make Open CAD Studio your default CAD app?"))
|
||||
text(t!("Make OneCAD Draft your default CAD app?")) /* OneBSpace (OneCAD Draft): rebranded */
|
||||
.size(15),
|
||||
iced::widget::Space::new().height(10),
|
||||
text(t!("Open .dwg and .dxf drawings in Open CAD Studio by default. You can change this later in your system settings."))
|
||||
text(t!("Open .dwg and .dxf drawings in OneCAD Draft by default. You can change this later in your system settings.")) /* OneBSpace (OneCAD Draft): rebranded */
|
||||
.size(12)
|
||||
.style(dialog_muted_text_style),
|
||||
iced::widget::Space::new().height(22),
|
||||
|
||||
Reference in new issue
Block a user