graphic design tool
git clone https://git.lucas.co/cce-designer.git
refactor: WidgetHostExt; drop the plate_bevel branches
WidgetHost's one-line forwards (color, z_index, set_modifiers, ...) moved to
cce_ui::widget::WidgetHostExt. plate_bevel is gone from cce-ui: nothing
overrode it, so it was always None and these branches never ran.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
src/app.rs | 2 +-
src/render.rs | 7 +++----
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/src/app.rs b/src/app.rs
index 4505fb3..240eccb 100644
--- a/src/app.rs
+++ b/src/app.rs
@@ -7,7 +7,7 @@ use std::io::BufReader;
use serde::{Deserialize, Serialize};
-use cce_ui::widget::{ElementState, MouseButton, MouseScrollDelta, KeyEvent, Key, NamedKey};
+use cce_ui::widget::{ElementState, MouseButton, MouseScrollDelta, KeyEvent, Key, NamedKey, WidgetHostExt};
use smithay_client_toolkit::{
compositor::{CompositorHandler, CompositorState},
diff --git a/src/render.rs b/src/render.rs
index 7ffd9cb..2f22499 100644
--- a/src/render.rs
+++ b/src/render.rs
@@ -1,4 +1,5 @@
+use cce_ui::widget::WidgetHostExt;
use cce_ui::colors;
use cce_ui::widget::WidgetHost;
@@ -445,7 +446,7 @@ impl State {
let opening = rect(wx, wy - self.height, ww2, self.height);
let material = cce_ui::scene::material::Material::from_fill(w.color());
let depth = if cce_ui::layout::control_relief() {
- w.plate_bevel().unwrap_or_else(cce_ui::colors::plate_bevel_width)
+ cce_ui::colors::plate_bevel_width()
} else {
0.0
};
@@ -1940,9 +1941,7 @@ pub(crate) fn uncovered(r: Rect, covers: &[(f32, f32, f32, f32)]) -> Vec<Rect> {
fn append_plate_at(w: &dyn WidgetHost, pc: &mut PaintCtx, r: Rect, tint: Option<[f32; 3]>, radii: (f32, f32, f32, f32)) {
let tint = tint.unwrap_or([1.0, 1.0, 1.0]);
let fill = cce_ui::scene::material::Material::from_fill(w.color());
- if let Some(thickness) = w.plate_bevel() {
- pc.bevel_tinted(r, radii, &fill, thickness, tint);
- } else if let Some((border_color, thickness)) = w.solid_border() {
+ if let Some((border_color, thickness)) = w.solid_border() {
if cce_ui::layout::control_relief() {
pc.bevel_tinted(r, radii, &fill, cce_ui::colors::plate_bevel_width(), tint);
} else {