forked from 1b-agent/opencadstudio-upstream
fix(ui): theme remaining interface text
This commit is contained in:
1 parent
28d8246c68
commit
2ac61bf99a
9 files changed
+119
-35
No files matched your search
@@ -152,6 +152,8 @@ pub struct Primitive {
|
||||
pub(in crate::scene) viewports: Vec<ViewportData>,
|
||||
/// Background color used to clear each viewport's MSAA buffer.
|
||||
pub(in crate::scene) bg_color: [f32; 4],
|
||||
/// Active Iced theme text colour for GPU-rendered ViewCube labels.
|
||||
pub(in crate::scene) viewcube_text_color: [f32; 4],
|
||||
/// One input-to-render sample, carried only when PERF tracing is enabled.
|
||||
pub(in crate::scene) nav_perf: Option<NavPerfSample>,
|
||||
}
|
||||
@@ -327,6 +329,7 @@ impl shader::Primitive for Primitive {
|
||||
(vp.screen_rect.width * bounds.width) as u32,
|
||||
(vp.screen_rect.height * bounds.height) as u32,
|
||||
vp.hover_region,
|
||||
self.viewcube_text_color,
|
||||
);
|
||||
}
|
||||
continue;
|
||||
@@ -874,6 +877,7 @@ impl shader::Primitive for Primitive {
|
||||
(vp.screen_rect.width * bounds.width) as u32,
|
||||
(vp.screen_rect.height * bounds.height) as u32,
|
||||
vp.hover_region,
|
||||
self.viewcube_text_color,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1689,6 +1693,7 @@ impl Scene {
|
||||
model_render_mode: acadrust::entities::ViewportRenderMode,
|
||||
_hover_region: Option<usize>,
|
||||
show_viewcube: bool,
|
||||
viewcube_text_color: [f32; 4],
|
||||
) -> Primitive {
|
||||
let nav_build_started = iced::time::Instant::now();
|
||||
let perf_nav = self.take_nav_perf();
|
||||
@@ -1720,6 +1725,7 @@ impl Scene {
|
||||
Primitive {
|
||||
viewports,
|
||||
bg_color,
|
||||
viewcube_text_color,
|
||||
nav_perf: perf_nav,
|
||||
}
|
||||
}
|
||||
@@ -1736,6 +1742,7 @@ impl Scene {
|
||||
tile_idx: usize,
|
||||
model_render_mode: acadrust::entities::ViewportRenderMode,
|
||||
show_viewcube: bool,
|
||||
viewcube_text_color: [f32; 4],
|
||||
) -> Primitive {
|
||||
let hover_region = self.viewcube_hover.get();
|
||||
let canvas = (bounds.width.max(1.0), bounds.height.max(1.0));
|
||||
@@ -1745,6 +1752,7 @@ impl Scene {
|
||||
return Primitive {
|
||||
viewports: vec![],
|
||||
bg_color,
|
||||
viewcube_text_color,
|
||||
nav_perf: None,
|
||||
};
|
||||
};
|
||||
@@ -1792,6 +1800,7 @@ impl Scene {
|
||||
Primitive {
|
||||
viewports,
|
||||
bg_color,
|
||||
viewcube_text_color,
|
||||
nav_perf: perf_nav,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,9 @@ pub struct ViewportPane<'a> {
|
||||
/// per `pane_grid` pane, filling its own bounds). `None` → the unified
|
||||
/// full-canvas path (paper layout, or the whole-canvas Model fallback).
|
||||
pub pane: Option<usize>,
|
||||
/// Active Iced theme text colour, forwarded to the GPU-rendered ViewCube
|
||||
/// face and compass labels.
|
||||
pub viewcube_text_color: [f32; 4],
|
||||
}
|
||||
|
||||
impl<'a> ViewportPane<'a> {
|
||||
@@ -30,12 +33,14 @@ impl<'a> ViewportPane<'a> {
|
||||
scene: &'a Scene,
|
||||
show_viewcube: bool,
|
||||
render_mode: acadrust::entities::ViewportRenderMode,
|
||||
viewcube_text_color: [f32; 4],
|
||||
) -> Self {
|
||||
Self {
|
||||
scene,
|
||||
show_viewcube,
|
||||
render_mode,
|
||||
pane: None,
|
||||
viewcube_text_color,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,12 +51,14 @@ impl<'a> ViewportPane<'a> {
|
||||
show_viewcube: bool,
|
||||
render_mode: acadrust::entities::ViewportRenderMode,
|
||||
tile_idx: usize,
|
||||
viewcube_text_color: [f32; 4],
|
||||
) -> Self {
|
||||
Self {
|
||||
scene,
|
||||
show_viewcube,
|
||||
render_mode,
|
||||
pane: Some(tile_idx),
|
||||
viewcube_text_color,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -74,12 +81,14 @@ impl<'a, Msg: std::fmt::Debug + Clone> shader::Program<Msg> for ViewportPane<'a>
|
||||
idx,
|
||||
self.render_mode,
|
||||
self.show_viewcube,
|
||||
self.viewcube_text_color,
|
||||
),
|
||||
None => self.scene.build_viewports(
|
||||
bounds,
|
||||
self.render_mode,
|
||||
state.hover_region,
|
||||
self.show_viewcube,
|
||||
self.viewcube_text_color,
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user