|
@@ -134,12 +134,14 @@ fn main() {
|
|
|
.position([800.0, 0.0], Condition::Appearing)
|
|
|
.size([200.0, 500.0], Condition::FirstUseEver)
|
|
|
.build(ui, || {
|
|
|
+
|
|
|
for (k, snds) in &soundlib {
|
|
|
- ui.tree_node(&im_str!("{}", k))
|
|
|
+
|
|
|
+ TreeNode::new(&im_str!("{}", k))
|
|
|
.opened(true, Condition::Appearing)
|
|
|
- .build(|| {
|
|
|
+ .build(ui, || {
|
|
|
for s in snds {
|
|
|
- ui.tree_node(&im_str!("{}", s.name)).build(|| {
|
|
|
+ TreeNode::new(&im_str!("{}", s.name)).build(ui, || {
|
|
|
// ui.same_line(0.0);
|
|
|
// if ui.small_button(im_str!("add to pattern")) {
|
|
|
// active_pattern.sounds[pattern_row][pattern_col] = Some(s.clone());
|
|
@@ -162,11 +164,11 @@ fn main() {
|
|
|
.position([800.0, 500.0], Condition::Appearing)
|
|
|
.size([200.0, 300.0], Condition::FirstUseEver)
|
|
|
.build(ui, || {
|
|
|
- ui.tree_node(im_str!("patterns"))
|
|
|
+ TreeNode::new(im_str!("patterns"))
|
|
|
.opened(true, Condition::Appearing)
|
|
|
- .build(|| {
|
|
|
+ .build(ui,|| {
|
|
|
for p in &mut patterns {
|
|
|
- ui.tree_node(&im_str!("{}", p.name)).build(|| {
|
|
|
+ TreeNode::new(&im_str!("{}", p.name)).build(ui,|| {
|
|
|
// ui.same_line(0.0);
|
|
|
if ui.small_button(im_str!("load")) {
|
|
|
*active_pattern = p.clone();
|
|
@@ -216,15 +218,15 @@ fn main() {
|
|
|
active_pattern.name = imstr_name.to_string();
|
|
|
};
|
|
|
|
|
|
- ui.drag_int(im_str!("beats/bar"), &mut active_pattern.resolution)
|
|
|
- .max(64)
|
|
|
+ imgui::Drag::new(im_str!("beats/bar"))
|
|
|
+ .range(0..=64)
|
|
|
.speed(0.1)
|
|
|
- .build();
|
|
|
+ .build(ui, &mut active_pattern.resolution);
|
|
|
|
|
|
- ui.drag_int(im_str!("repeat"), &mut active_pattern.repeat)
|
|
|
- .max(32)
|
|
|
+ imgui::Drag::new(im_str!("repeat"))
|
|
|
+ .range(0..=32)
|
|
|
.speed(0.05)
|
|
|
- .build();
|
|
|
+ .build(ui, &mut active_pattern.repeat);
|
|
|
|
|
|
// The grid header labels
|
|
|
|