forked from 1b-agent/opencadstudio-upstream
refactor(ui): remove the viewport navigation bar
Sağ kenardaki dikey orbit/pan/zoom/zoom-extents araç çubuğu tümüyle kaldırıldı: viewport render'ı, overlay::nav_toolbar fonksiyonu, show_navbar state + ToggleNavbar mesajı/handler'ı, NAVBAR komutu, View şeridindeki "Navigation Bar" aracı ve navbar modülü/ikonu. Aynı gezinme işlemleri komutlar (3DORBIT, PAN, ZOOM*) ve ViewCube üzerinden erişilebilir durumda. Co-Authored-By: Claude Opus 4.7 <[email protected]>
This commit is contained in:
1 parent
6483566c5d
commit
fda0f2dbb9
8 files changed
+3
-114
No files matched your search
+3
-62
@@ -1,10 +1,9 @@
|
||||
//! Viewport overlay widgets:
|
||||
//! • nav_toolbar() — vertical orbit/pan/zoom buttons on the right
|
||||
//! Viewport overlay widgets.
|
||||
|
||||
use glam::{Mat4, Vec3};
|
||||
use iced::mouse;
|
||||
use iced::widget::{button, canvas, column, container, text};
|
||||
use iced::{Background, Border, Color, Element, Length, Point, Size, Theme};
|
||||
use iced::widget::canvas;
|
||||
use iced::{Color, Element, Length, Point, Size, Theme};
|
||||
|
||||
use crate::app::Message;
|
||||
use crate::scene::object::GripShape;
|
||||
@@ -29,64 +28,6 @@ pub struct GripMarker {
|
||||
pub is_hot: bool,
|
||||
}
|
||||
|
||||
// ── Nav toolbar ───────────────────────────────────────────────────────────
|
||||
|
||||
pub fn nav_toolbar<'a>() -> Element<'a, Message> {
|
||||
let b = |icon: &'a str, cmd: &'a str| -> Element<'a, Message> {
|
||||
button(text(icon).size(14).color(Color::WHITE))
|
||||
.on_press(Message::Command(cmd.into()))
|
||||
.style(|_: &Theme, status| button::Style {
|
||||
background: Some(Background::Color(match status {
|
||||
button::Status::Hovered => Color {
|
||||
r: 0.32,
|
||||
g: 0.32,
|
||||
b: 0.32,
|
||||
a: 0.95,
|
||||
},
|
||||
button::Status::Pressed => Color {
|
||||
r: 0.18,
|
||||
g: 0.42,
|
||||
b: 0.70,
|
||||
a: 1.00,
|
||||
},
|
||||
_ => Color {
|
||||
r: 0.20,
|
||||
g: 0.20,
|
||||
b: 0.20,
|
||||
a: 0.85,
|
||||
},
|
||||
})),
|
||||
border: Border {
|
||||
color: Color {
|
||||
r: 0.30,
|
||||
g: 0.30,
|
||||
b: 0.30,
|
||||
a: 1.0,
|
||||
},
|
||||
width: 1.0,
|
||||
radius: 2.0.into(),
|
||||
},
|
||||
text_color: Color::WHITE,
|
||||
shadow: iced::Shadow::default(),
|
||||
snap: false,
|
||||
})
|
||||
.padding([6, 8])
|
||||
.into()
|
||||
};
|
||||
container(
|
||||
column![
|
||||
b("⟳", "3DORBIT"),
|
||||
b("✥", "PAN"),
|
||||
b("⊕", "ZOOMIN"),
|
||||
b("⊖", "ZOOMOUT"),
|
||||
b("⊡", "ZOOMEXTENTS")
|
||||
]
|
||||
.spacing(2),
|
||||
)
|
||||
.padding(4)
|
||||
.into()
|
||||
}
|
||||
|
||||
// ── Grid display params ───────────────────────────────────────────────────
|
||||
|
||||
/// Which world-space plane the grid is drawn on — switches with camera angle.
|
||||
|
||||
Reference in new issue
Block a user