forked from 1b-agent/opencadstudio-upstream
Merge pull request #1353 from HakanSeven12/ui/options-ok-apply-close
feat(options): OK / Apply / Close with a discard guard # Conflicts: # src/app/view/modal.rs # src/ui/window/options.rs
This commit is contained in:
commit
1c0ef9d7a0
8 files changed
+365
-55
No files matched your search
@@ -18,6 +18,7 @@ mod dimension_preview_tests;
|
||||
mod document;
|
||||
mod drafting_settings;
|
||||
pub(crate) mod expr_eval;
|
||||
mod options_session;
|
||||
mod find_replace;
|
||||
pub(crate) mod helpers;
|
||||
mod history;
|
||||
@@ -570,6 +571,10 @@ pub(super) struct OpenCADStudio {
|
||||
dyn_input: bool,
|
||||
/// Currently visible page in the application Options dialog.
|
||||
options_tab: crate::ui::window::options::OptionsTab,
|
||||
/// The Options window's commit point (see `options_session`).
|
||||
options_saved: Option<options_session::OptionsSnapshot>,
|
||||
/// Close was pressed with unapplied changes; the discard guard is up.
|
||||
options_close_confirm: bool,
|
||||
spacemouse: crate::input::spacemouse::Service,
|
||||
spacemouse_preferences: crate::input::spacemouse::Preferences,
|
||||
spacemouse_paused: bool,
|
||||
@@ -2860,6 +2865,14 @@ pub enum Message {
|
||||
DraftingSettingsClose,
|
||||
DraftingSettingsCloseDiscard,
|
||||
DraftingSettingsCloseKeep,
|
||||
/// Options window: commit the changes made so far.
|
||||
OptionsApply,
|
||||
/// Options window: commit and close.
|
||||
OptionsOk,
|
||||
/// Options window: close, asking first when changes would be lost.
|
||||
OptionsClose,
|
||||
OptionsCloseDiscard,
|
||||
OptionsCloseKeep,
|
||||
AutoConstrainSelectRow(usize),
|
||||
AutoConstrainToggleKind(settings::AutoConstraintKind),
|
||||
AutoConstrainMoveUp,
|
||||
@@ -3900,6 +3913,8 @@ impl OpenCADStudio {
|
||||
grid_beyond_limits: true,
|
||||
dyn_input: true,
|
||||
options_tab: crate::ui::window::options::OptionsTab::General,
|
||||
options_saved: None,
|
||||
options_close_confirm: false,
|
||||
spacemouse: {
|
||||
let service = crate::input::spacemouse::Service::default();
|
||||
service.set_actions(navigation::actions());
|
||||
|
||||
Reference in new issue
Block a user