forked from 1b-agent/opencadstudio-upstream
feat(ui): migrate dialogs across application to shared dialog_button and form_radio builders
This commit is contained in:
1 parent
1a6279e841
commit
6b37476687
36 files changed
+214
-197
No files matched your search
@@ -12,6 +12,7 @@ use iced::{Background, Border, Element, Fill, Length, Theme};
|
||||
use crate::app::Message;
|
||||
use crate::modules::draw::layers::laytrans::{Mapping, TargetLayer};
|
||||
use crate::t;
|
||||
use crate::ui::style::form::{dialog_button, dialog_button_styled_opt};
|
||||
|
||||
/// The dialog's working state: what was loaded, what is selected, and the
|
||||
/// mappings built so far. None of it touches the drawing until Translate.
|
||||
@@ -183,15 +184,12 @@ pub fn view_window<'a>(
|
||||
.on_press(Message::LayerTranslatorLoadMappings)
|
||||
.padding([4, 10]),
|
||||
Space::new().width(Fill),
|
||||
button(text(t!("Cancel")).size(12))
|
||||
.on_press(Message::CloseModal)
|
||||
.padding([4, 12]),
|
||||
button(text(t!("Translate")).size(12))
|
||||
.on_press_maybe(
|
||||
(!state.mappings.is_empty()).then_some(Message::LayerTranslatorTranslate)
|
||||
)
|
||||
.style(button::primary)
|
||||
.padding([4, 12]),
|
||||
dialog_button(t!("Cancel"), Message::CloseModal, false),
|
||||
dialog_button_styled_opt(
|
||||
t!("Translate"),
|
||||
(!state.mappings.is_empty()).then_some(Message::LayerTranslatorTranslate),
|
||||
button::primary,
|
||||
),
|
||||
]
|
||||
.spacing(6)
|
||||
.align_y(iced::Center);
|
||||
|
||||
Reference in new issue
Block a user