Skip to content

Commit

Permalink
First steps in new update
Browse files Browse the repository at this point in the history
  • Loading branch information
ardura committed Aug 19, 2024
1 parent e4eb3d0 commit 739341f
Show file tree
Hide file tree
Showing 8 changed files with 749 additions and 620 deletions.
373 changes: 212 additions & 161 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ hound = "3.5.0"
lazy_static = "1.4.0"

# Nih plug update
nih_plug = { git = "https://github.com/ardura/nih-plug.git", rev = "cd1c66b054a8ff7d44084369b7022a0272ac690e", features = ["assert_process_allocs"] }
nih_plug_egui = { git = "https://github.com/ardura/nih-plug.git", rev = "cd1c66b054a8ff7d44084369b7022a0272ac690e" }
nih_plug = { git = "https://github.com/ardura/nih-plug.git", rev = "9d9d5f9710daeadfb2eba3859088b4bea196b904", features = ["assert_process_allocs"] }
nih_plug_egui = { git = "https://github.com/ardura/nih-plug.git", rev = "9d9d5f9710daeadfb2eba3859088b4bea196b904" }

# egui_file fork for nih-plug/Actuate
egui_file = { git = "https://github.com/ardura/egui_file.git", rev = "03dd37a395e08d7ed224dee8d05dcd55302d7d79" }
egui_file = { git = "https://github.com/ardura/egui_file.git", rev = "72d857a3689e34f1098e0a4435a82e04746ea9f7" }

num-complex = "0.4.4"
num-traits = "0.2.17"
Expand Down
257 changes: 195 additions & 62 deletions src/CustomWidgets/BeizerButton.rs

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/CustomWidgets/slim_checkbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ impl<'a> Widget for AtomicSlimCheckbox<'a> {
response.widget_info(|| {
WidgetInfo::selected(
WidgetType::Checkbox,
true,
checked.load(Ordering::SeqCst),
text.as_ref().map_or("", |x| x.text()),
)
Expand All @@ -96,6 +97,7 @@ impl<'a> Widget for AtomicSlimCheckbox<'a> {
stroke: visuals.bg_stroke,
fill_texture_id: TextureId::default(),
uv: big_icon_rect.expand(visuals.expansion),
blur_width: 0.0,
});

if checked.load(Ordering::SeqCst) {
Expand Down Expand Up @@ -171,6 +173,7 @@ impl<'a> Widget for SlimCheckbox<'a> {
response.widget_info(|| {
WidgetInfo::selected(
WidgetType::Checkbox,
true,
*checked,
text.as_ref().map_or("", |x| x.text()),
)
Expand All @@ -187,6 +190,7 @@ impl<'a> Widget for SlimCheckbox<'a> {
stroke: visuals.fg_stroke,
fill_texture_id: TextureId::default(),
uv: Rect::ZERO,
blur_width: 0.0,
});

if *checked {
Expand Down
31 changes: 15 additions & 16 deletions src/CustomWidgets/ui_knob.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use lazy_static::lazy_static;
use nih_plug::prelude::{Param, ParamSetter};
use nih_plug_egui::egui::{
self,
epaint::{CircleShape, PathShape},
epaint::{CircleShape, PathShape, PathStroke},
pos2, Align2, Color32, FontId, Pos2, Rect, Response, Rgba, Rounding, Sense, Shape, Stroke, Ui,
Vec2, Widget,
};
Expand Down Expand Up @@ -437,7 +437,7 @@ impl<'a, P: Param> Widget for ArcKnob<'a, P> {
),
closed: false,
fill: self.fill_color.linear_multiply(0.7),
stroke: outline_stroke,
stroke: outline_stroke.into(),
});
painter.add(outline_shape);
}
Expand All @@ -456,7 +456,7 @@ impl<'a, P: Param> Widget for ArcKnob<'a, P> {
),
closed: false,
fill: Color32::TRANSPARENT,
stroke: arc_stroke,
stroke: arc_stroke.into(),
});
painter.add(shape);

Expand Down Expand Up @@ -520,7 +520,7 @@ impl<'a, P: Param> Widget for ArcKnob<'a, P> {
),
closed: false,
fill: Color32::TRANSPARENT,
stroke: Stroke::new(
stroke: PathStroke::new(
ball_width * 3.0,
if g2 > 0.0 {
Color32::DARK_GRAY.gamma_multiply(0.20)
Expand All @@ -540,7 +540,7 @@ impl<'a, P: Param> Widget for ArcKnob<'a, P> {
),
closed: false,
fill: Color32::TRANSPARENT,
stroke: Stroke::new(
stroke: PathStroke::new(
ball_width * 3.0,
if g3 > 0.0 {
Color32::DARK_GRAY.gamma_multiply(0.18)
Expand All @@ -560,7 +560,7 @@ impl<'a, P: Param> Widget for ArcKnob<'a, P> {
),
closed: false,
fill: Color32::TRANSPARENT,
stroke: Stroke::new(
stroke: PathStroke::new(
ball_width * 3.0,
if g4 > 0.0 {
Color32::DARK_GRAY.gamma_multiply(0.16)
Expand All @@ -580,7 +580,7 @@ impl<'a, P: Param> Widget for ArcKnob<'a, P> {
),
closed: false,
fill: Color32::TRANSPARENT,
stroke: Stroke::new(
stroke: PathStroke::new(
ball_width * 3.0,
if g5 > 0.0 {
Color32::DARK_GRAY.gamma_multiply(0.14)
Expand All @@ -600,7 +600,7 @@ impl<'a, P: Param> Widget for ArcKnob<'a, P> {
),
closed: false,
fill: Color32::TRANSPARENT,
stroke: Stroke::new(
stroke: PathStroke::new(
ball_width * 3.0,
if g6 > 0.0 {
Color32::DARK_GRAY.gamma_multiply(0.12)
Expand All @@ -620,7 +620,7 @@ impl<'a, P: Param> Widget for ArcKnob<'a, P> {
),
closed: false,
fill: Color32::TRANSPARENT,
stroke: Stroke::new(
stroke: PathStroke::new(
ball_width * 3.0,
if g7 > 0.0 {
Color32::DARK_GRAY.gamma_multiply(0.10)
Expand All @@ -640,7 +640,7 @@ impl<'a, P: Param> Widget for ArcKnob<'a, P> {
),
closed: false,
fill: Color32::TRANSPARENT,
stroke: Stroke::new(
stroke: PathStroke::new(
ball_width * 3.0,
if g8 > 0.0 {
Color32::DARK_GRAY.gamma_multiply(0.08)
Expand All @@ -660,7 +660,7 @@ impl<'a, P: Param> Widget for ArcKnob<'a, P> {
),
closed: false,
fill: Color32::TRANSPARENT,
stroke: Stroke::new(
stroke: PathStroke::new(
ball_width * 3.0,
if g9 > 0.0 {
Color32::DARK_GRAY.gamma_multiply(0.06)
Expand All @@ -680,7 +680,7 @@ impl<'a, P: Param> Widget for ArcKnob<'a, P> {
),
closed: false,
fill: Color32::TRANSPARENT,
stroke: Stroke::new(
stroke: PathStroke::new(
ball_width * 3.0,
if g10 > 0.0 {
Color32::DARK_GRAY.gamma_multiply(0.04)
Expand All @@ -700,7 +700,7 @@ impl<'a, P: Param> Widget for ArcKnob<'a, P> {
),
closed: false,
fill: Color32::TRANSPARENT,
stroke: Stroke::new(
stroke: PathStroke::new(
ball_width * 3.0,
if g11 > 0.0 {
Color32::DARK_GRAY.gamma_multiply(0.02)
Expand All @@ -721,7 +721,7 @@ impl<'a, P: Param> Widget for ArcKnob<'a, P> {
),
closed: false,
fill: self.line_color,
stroke: Stroke::new(ball_width * 3.0, self.line_color),
stroke: PathStroke::new(ball_width * 3.0, self.line_color),
});
painter.add(line_shape);

Expand All @@ -741,8 +741,7 @@ impl<'a, P: Param> Widget for ArcKnob<'a, P> {
ui.allocate_rect(
Rect::from_center_size(center, Vec2::new(self.radius * 2.0, self.radius * 2.0)),
Sense::hover(),
)
.on_hover_text_at_pointer(self.hover_text_content);
).on_hover_text_at_pointer(self.hover_text_content);
}

// Label text from response rect bound
Expand Down
Loading

0 comments on commit 739341f

Please sign in to comment.