refactor: group ui/ statusbar and window subdirs
Continue tidying the flat ui/ root: - ui/statusbar/: statusbar.rs becomes statusbar/mod.rs (its crate::ui::statusbar::* paths are preserved) and absorbs statusbar_config.rs + statusbar_menu.rs. - ui/window/: the standalone manager/dialog windows move here — about, layout_manager, page_setup, plugin_manager, shortcuts, layers, update_notice, open_progress. The crate::ui::LayerPanel re-export is repointed so callers are unchanged. Call sites repointed to the new paths; no compat re-exports beyond the existing LayerPanel one. ui/ root drops from 21 to 10 flat files with five subdirs (ribbon, style, popup, statusbar, window). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
9b8ee94c0c
commit
a502379048
17 changed files with 29 additions and 27 deletions
|
|
@ -221,7 +221,7 @@ pub(super) struct OpenCADStudio {
|
||||||
/// When set, the cycling list box is open: (canvas point, candidates).
|
/// When set, the cycling list box is open: (canvas point, candidates).
|
||||||
cycle_candidates: Option<(iced::Point, Vec<acadrust::Handle>)>,
|
cycle_candidates: Option<(iced::Point, Vec<acadrust::Handle>)>,
|
||||||
/// Which status-bar pills the user has chosen to show (persisted).
|
/// Which status-bar pills the user has chosen to show (persisted).
|
||||||
statusbar_config: crate::ui::statusbar_config::StatusBarConfig,
|
statusbar_config: crate::ui::statusbar::statusbar_config::StatusBarConfig,
|
||||||
/// Last persisted user preferences (DYN/OSNAP/OTRACK/POLAR/…). Compared
|
/// Last persisted user preferences (DYN/OSNAP/OTRACK/POLAR/…). Compared
|
||||||
/// after each message so a change is written to disk exactly once.
|
/// after each message so a change is written to disk exactly once.
|
||||||
last_saved_settings: Option<settings::UserSettings>,
|
last_saved_settings: Option<settings::UserSettings>,
|
||||||
|
|
@ -1095,7 +1095,7 @@ pub enum Message {
|
||||||
LayerToggleLock(usize),
|
LayerToggleLock(usize),
|
||||||
LayerToggleFreeze(usize),
|
LayerToggleFreeze(usize),
|
||||||
/// Sort the Layer Manager table by a clicked column header.
|
/// Sort the Layer Manager table by a clicked column header.
|
||||||
LayerSort(crate::ui::layers::LayerSortCol),
|
LayerSort(crate::ui::window::layers::LayerSortCol),
|
||||||
/// Toggle per-viewport freeze: (layer_index, vp_col_index)
|
/// Toggle per-viewport freeze: (layer_index, vp_col_index)
|
||||||
LayerToggleVpFreeze(usize, usize),
|
LayerToggleVpFreeze(usize, usize),
|
||||||
LayerNew,
|
LayerNew,
|
||||||
|
|
@ -1186,7 +1186,7 @@ pub enum Message {
|
||||||
/// Close the status-bar customization menu.
|
/// Close the status-bar customization menu.
|
||||||
CloseStatusBarMenu,
|
CloseStatusBarMenu,
|
||||||
/// Show/hide a single status-bar pill.
|
/// Show/hide a single status-bar pill.
|
||||||
ToggleStatusPill(crate::ui::statusbar_config::StatusPill),
|
ToggleStatusPill(crate::ui::statusbar::statusbar_config::StatusPill),
|
||||||
/// Toggle clean-screen mode (hide ribbon + side panels).
|
/// Toggle clean-screen mode (hide ribbon + side panels).
|
||||||
ToggleCleanScreen,
|
ToggleCleanScreen,
|
||||||
/// Toggle whether entity transparency is shown on screen.
|
/// Toggle whether entity transparency is shown on screen.
|
||||||
|
|
@ -1763,7 +1763,7 @@ impl OpenCADStudio {
|
||||||
units_popup_open: false,
|
units_popup_open: false,
|
||||||
isolate_popup_open: false,
|
isolate_popup_open: false,
|
||||||
selection_filter_popup_open: false,
|
selection_filter_popup_open: false,
|
||||||
statusbar_config: crate::ui::statusbar_config::StatusBarConfig::load(),
|
statusbar_config: crate::ui::statusbar::statusbar_config::StatusBarConfig::load(),
|
||||||
last_saved_settings: None,
|
last_saved_settings: None,
|
||||||
otrack_active: None,
|
otrack_active: None,
|
||||||
clean_screen: false,
|
clean_screen: false,
|
||||||
|
|
|
||||||
|
|
@ -954,7 +954,7 @@ impl OpenCADStudio {
|
||||||
if let Some(dl) = self.tabs[i].scene.document.layers.get_mut(&name) {
|
if let Some(dl) = self.tabs[i].scene.document.layers.get_mut(&name) {
|
||||||
dl.color = AcadColor::Index(aci);
|
dl.color = AcadColor::Index(aci);
|
||||||
}
|
}
|
||||||
use crate::ui::layers::iced_color_from_acad;
|
use crate::ui::window::layers::iced_color_from_acad;
|
||||||
let new_color = iced_color_from_acad(&AcadColor::Index(aci));
|
let new_color = iced_color_from_acad(&AcadColor::Index(aci));
|
||||||
if let Some(pl) = self.tabs[i].layers.layers.get_mut(idx) {
|
if let Some(pl) = self.tabs[i].layers.layers.get_mut(idx) {
|
||||||
pl.color = new_color;
|
pl.color = new_color;
|
||||||
|
|
|
||||||
|
|
@ -1083,7 +1083,7 @@ impl OpenCADStudio {
|
||||||
};
|
};
|
||||||
|
|
||||||
let statusbar_menu_layer: Element<'_, Message> = if self.statusbar_menu_open {
|
let statusbar_menu_layer: Element<'_, Message> = if self.statusbar_menu_open {
|
||||||
crate::ui::statusbar_menu::statusbar_menu_overlay(&self.statusbar_config)
|
crate::ui::statusbar::statusbar_menu::statusbar_menu_overlay(&self.statusbar_config)
|
||||||
} else {
|
} else {
|
||||||
iced::widget::Space::new().width(0).height(0).into()
|
iced::widget::Space::new().width(0).height(0).into()
|
||||||
};
|
};
|
||||||
|
|
@ -1141,7 +1141,7 @@ impl OpenCADStudio {
|
||||||
};
|
};
|
||||||
|
|
||||||
let open_progress_layer: Element<'_, Message> = if let Some(p) = &self.opening {
|
let open_progress_layer: Element<'_, Message> = if let Some(p) = &self.opening {
|
||||||
crate::ui::open_progress::view(p, iced::time::Instant::now())
|
crate::ui::window::open_progress::view(p, iced::time::Instant::now())
|
||||||
} else {
|
} else {
|
||||||
iced::widget::Space::new().width(0).height(0).into()
|
iced::widget::Space::new().width(0).height(0).into()
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -17,16 +17,16 @@ impl OpenCADStudio {
|
||||||
.into()
|
.into()
|
||||||
}
|
}
|
||||||
Some(match self.active_modal? {
|
Some(match self.active_modal? {
|
||||||
super::super::ModalKind::About => crate::ui::about::view_window(),
|
super::super::ModalKind::About => crate::ui::window::about::view_window(),
|
||||||
super::super::ModalKind::Shortcuts => {
|
super::super::ModalKind::Shortcuts => {
|
||||||
sized(crate::ui::shortcuts::view_window(&self.shortcut_overrides), 720, 520)
|
sized(crate::ui::window::shortcuts::view_window(&self.shortcut_overrides), 720, 520)
|
||||||
}
|
}
|
||||||
super::super::ModalKind::PluginManager => sized(
|
super::super::ModalKind::PluginManager => sized(
|
||||||
crate::ui::plugin_manager::view_window(
|
crate::ui::window::plugin_manager::view_window(
|
||||||
&self.disabled_plugins,
|
&self.disabled_plugins,
|
||||||
&self.external_plugins,
|
&self.external_plugins,
|
||||||
&self.loaded_plugin_ids,
|
&self.loaded_plugin_ids,
|
||||||
crate::ui::plugin_manager::MarketView {
|
crate::ui::window::plugin_manager::MarketView {
|
||||||
registry: &self.plugin_registry,
|
registry: &self.plugin_registry,
|
||||||
input: &self.plugin_repo_input,
|
input: &self.plugin_repo_input,
|
||||||
repos: &self.plugin_repos,
|
repos: &self.plugin_repos,
|
||||||
|
|
@ -41,14 +41,14 @@ impl OpenCADStudio {
|
||||||
super::super::ModalKind::UpdateNotice => {
|
super::super::ModalKind::UpdateNotice => {
|
||||||
let latest = self.update_notice_version.as_deref().unwrap_or("?");
|
let latest = self.update_notice_version.as_deref().unwrap_or("?");
|
||||||
let body = self.update_notice_body.as_deref().unwrap_or("");
|
let body = self.update_notice_body.as_deref().unwrap_or("");
|
||||||
sized(crate::ui::update_notice::view_window(latest, body), 560, 460)
|
sized(crate::ui::window::update_notice::view_window(latest, body), 560, 460)
|
||||||
}
|
}
|
||||||
super::super::ModalKind::Layers => {
|
super::super::ModalKind::Layers => {
|
||||||
let tab = &self.tabs[self.active_tab];
|
let tab = &self.tabs[self.active_tab];
|
||||||
sized(tab.layers.view_window(), 900, 360)
|
sized(tab.layers.view_window(), 900, 360)
|
||||||
}
|
}
|
||||||
super::super::ModalKind::PageSetup => sized(
|
super::super::ModalKind::PageSetup => sized(
|
||||||
crate::ui::page_setup::view_window(
|
crate::ui::window::page_setup::view_window(
|
||||||
&self.page_setup_w,
|
&self.page_setup_w,
|
||||||
&self.page_setup_h,
|
&self.page_setup_h,
|
||||||
&self.page_setup_plot_area,
|
&self.page_setup_plot_area,
|
||||||
|
|
@ -66,7 +66,7 @@ impl OpenCADStudio {
|
||||||
let layouts = self.tabs[i].scene.layout_names();
|
let layouts = self.tabs[i].scene.layout_names();
|
||||||
let current = self.tabs[i].scene.current_layout.clone();
|
let current = self.tabs[i].scene.current_layout.clone();
|
||||||
sized(
|
sized(
|
||||||
crate::ui::layout_manager::view_window(
|
crate::ui::window::layout_manager::view_window(
|
||||||
layouts,
|
layouts,
|
||||||
&self.layout_manager_selected,
|
&self.layout_manager_selected,
|
||||||
&self.layout_manager_rename_buf,
|
&self.layout_manager_rename_buf,
|
||||||
|
|
|
||||||
|
|
@ -2,33 +2,24 @@
|
||||||
/// Change this to scale the ribbon, layer manager rows, and property panel rows uniformly.
|
/// Change this to scale the ribbon, layer manager rows, and property panel rows uniformly.
|
||||||
pub const ROW_H: f32 = 26.0;
|
pub const ROW_H: f32 = 26.0;
|
||||||
|
|
||||||
pub mod about;
|
|
||||||
pub mod app_menu;
|
pub mod app_menu;
|
||||||
pub mod color_select;
|
pub mod color_select;
|
||||||
pub mod command_line;
|
pub mod command_line;
|
||||||
pub mod icons;
|
pub mod icons;
|
||||||
pub mod layers;
|
|
||||||
pub mod layout_manager;
|
|
||||||
pub mod modal;
|
pub mod modal;
|
||||||
pub mod open_progress;
|
|
||||||
pub mod overlay;
|
pub mod overlay;
|
||||||
pub mod page_setup;
|
|
||||||
pub mod plugin_manager;
|
|
||||||
pub mod popup;
|
pub mod popup;
|
||||||
pub mod properties;
|
pub mod properties;
|
||||||
pub mod ribbon;
|
pub mod ribbon;
|
||||||
pub mod side_toolbar;
|
pub mod side_toolbar;
|
||||||
pub mod shortcuts;
|
|
||||||
pub mod statusbar;
|
pub mod statusbar;
|
||||||
pub mod statusbar_config;
|
|
||||||
pub mod statusbar_menu;
|
|
||||||
pub mod style;
|
pub mod style;
|
||||||
pub mod text_util;
|
pub mod text_util;
|
||||||
pub mod update_notice;
|
pub mod window;
|
||||||
|
|
||||||
pub use app_menu::AppMenu;
|
pub use app_menu::AppMenu;
|
||||||
pub use command_line::CommandLine;
|
pub use command_line::CommandLine;
|
||||||
pub use layers::LayerPanel;
|
|
||||||
pub use properties::PropertiesPanel;
|
pub use properties::PropertiesPanel;
|
||||||
pub use ribbon::Ribbon;
|
pub use ribbon::Ribbon;
|
||||||
pub use statusbar::StatusBar;
|
pub use statusbar::StatusBar;
|
||||||
|
pub use window::layers::LayerPanel;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
//! Bottom status bar — Model/Layout tabs + OSNAP toggle + status info
|
//! Bottom status bar — Model/Layout tabs + OSNAP toggle + status info
|
||||||
|
|
||||||
|
pub mod statusbar_config;
|
||||||
|
pub mod statusbar_menu;
|
||||||
|
|
||||||
use iced::widget::tooltip::Position as TipPos;
|
use iced::widget::tooltip::Position as TipPos;
|
||||||
use iced::widget::{button, column, container, mouse_area, row, text, text_input, tooltip, Row};
|
use iced::widget::{button, column, container, mouse_area, row, text, text_input, tooltip, Row};
|
||||||
use iced::{Background, Border, Color, Element, Length, Theme};
|
use iced::{Background, Border, Color, Element, Length, Theme};
|
||||||
|
|
@ -10,7 +13,7 @@ pub const LAYOUT_RENAME_INPUT_ID: &str = "layout_rename_input";
|
||||||
|
|
||||||
use crate::app::Message;
|
use crate::app::Message;
|
||||||
use crate::snap::Snapper;
|
use crate::snap::Snapper;
|
||||||
use crate::ui::statusbar_config::{StatusBarConfig, StatusPill};
|
use crate::ui::statusbar::statusbar_config::{StatusBarConfig, StatusPill};
|
||||||
|
|
||||||
#[derive(Clone, Default)]
|
#[derive(Clone, Default)]
|
||||||
pub struct StatusBar {
|
pub struct StatusBar {
|
||||||
|
|
@ -6,7 +6,7 @@ use iced::widget::{button, column, container, mouse_area, row, text};
|
||||||
use iced::{Background, Border, Color, Element, Fill, Length, Padding, Theme};
|
use iced::{Background, Border, Color, Element, Fill, Length, Padding, Theme};
|
||||||
|
|
||||||
use crate::app::Message;
|
use crate::app::Message;
|
||||||
use crate::ui::statusbar_config::{StatusBarConfig, StatusPill};
|
use crate::ui::statusbar::statusbar_config::{StatusBarConfig, StatusPill};
|
||||||
|
|
||||||
/// Full-screen overlay: transparent click-catcher + the menu panel pinned to
|
/// Full-screen overlay: transparent click-catcher + the menu panel pinned to
|
||||||
/// the bottom-right, just above the status bar.
|
/// the bottom-right, just above the status bar.
|
||||||
8
src/ui/window/mod.rs
Normal file
8
src/ui/window/mod.rs
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
pub mod about;
|
||||||
|
pub mod layout_manager;
|
||||||
|
pub mod page_setup;
|
||||||
|
pub mod plugin_manager;
|
||||||
|
pub mod shortcuts;
|
||||||
|
pub mod layers;
|
||||||
|
pub mod update_notice;
|
||||||
|
pub mod open_progress;
|
||||||
Loading…
Reference in a new issue