opacity & additive & curvature works

This commit is contained in:
galister
2025-11-13 15:40:08 +09:00
parent d435fdb473
commit 595324814a
13 changed files with 397 additions and 56 deletions

View File

@@ -15,11 +15,11 @@ use crate::{
util,
},
widget::{
ConstructEssentials, EventResult,
div::WidgetDiv,
label::{WidgetLabel, WidgetLabelParams},
rectangle::{WidgetRectangle, WidgetRectangleParams},
util::WLength,
ConstructEssentials, EventResult,
},
};
@@ -113,7 +113,8 @@ impl ComponentSlider {
pub fn get_value(&self) -> f32 {
self.state.borrow().values.value
}
pub fn set_value(&mut self, common: &mut CallbackDataCommon, value: f32) {
pub fn set_value(&self, common: &mut CallbackDataCommon, value: f32) {
let mut state = self.state.borrow_mut();
state.set_value(common, &self.data, value);
}

View File

@@ -9,7 +9,7 @@ use crate::{
event::EventAlterables,
globals::Globals,
layout::Widget,
renderer_vk::text::{TextShadow, custom_glyph::CustomGlyph},
renderer_vk::text::{custom_glyph::CustomGlyph, TextShadow},
stack::{self, ScissorBoundary, ScissorStack, TransformStack},
widget::{self, ScrollbarInfo, WidgetState},
};
@@ -264,7 +264,7 @@ fn draw_widget(
state.primitives.push(primitive_debug_rect(
&boundary,
&state.transform_stack.get().transform,
Color::new(0.0, 1.0, 1.0, 0.5),
Color::new(0.0, 1.0, 1.0, 0.5 * params.alpha),
));
}
@@ -277,7 +277,7 @@ fn draw_widget(
state.primitives.push(primitive_debug_rect(
&boundary_relative,
&state.transform_stack.get().transform,
Color::new(1.0, 0.0, 1.0, 1.0),
Color::new(1.0, 0.0, 1.0, params.alpha),
));
}

View File

@@ -11,11 +11,13 @@ use crate::{
i18n::I18n,
};
#[derive(Clone)]
pub struct Defaults {
pub dark_mode: bool,
pub text_color: drawing::Color,
pub button_color: drawing::Color,
pub accent_color: drawing::Color,
pub danger_color: drawing::Color,
}
impl Default for Defaults {
@@ -25,6 +27,7 @@ impl Default for Defaults {
text_color: drawing::Color::new(1.0, 1.0, 1.0, 1.0),
button_color: drawing::Color::new(1.0, 1.0, 1.0, 0.05),
accent_color: drawing::Color::new(0.0, 0.54, 1.0, 1.0),
danger_color: drawing::Color::new(0.8, 0.0, 0.0, 1.0),
}
}
}

View File

@@ -2,21 +2,21 @@ use std::{cell::RefCell, rc::Rc, sync::Arc};
use cosmic_text::Buffer;
use glam::{Mat4, Vec2, Vec3};
use slotmap::{SlotMap, new_key_type};
use slotmap::{new_key_type, SlotMap};
use vulkano::pipeline::graphics::viewport;
use crate::{
drawing::{self},
font_config,
gfx::{WGfx, cmd::GfxCommandBuffer},
gfx::{cmd::GfxCommandBuffer, WGfx},
};
use super::{
rect::{RectPipeline, RectRenderer},
text::{
DEFAULT_METRICS, SWASH_CACHE, TextArea, TextBounds,
text_atlas::{TextAtlas, TextPipeline},
text_renderer::TextRenderer,
TextArea, TextBounds, DEFAULT_METRICS, SWASH_CACHE,
},
viewport::Viewport,
};