add color picker and better buttons
This commit is contained in:
11
src/music.rs
11
src/music.rs
@@ -17,6 +17,7 @@ use iced::widget::canvas;
|
||||
use iced::widget::canvas::Stroke;
|
||||
use iced::widget::canvas::Style;
|
||||
use iced::{Color, Rectangle, Renderer, Theme};
|
||||
use std::env::current_dir;
|
||||
use std::f32::consts::PI;
|
||||
use std::mem::swap;
|
||||
use std::time::Duration;
|
||||
@@ -125,10 +126,14 @@ impl Music {
|
||||
self.find_poly_frame(delta).polygons[index].global_teta = teta;
|
||||
}
|
||||
|
||||
pub fn set_color(&mut self, delta: f32, index: usize, color_name: String) {
|
||||
pub fn set_color(&mut self, delta: f32, index: usize, color: Color) {
|
||||
let current_frame = self.find_poly_frame(delta);
|
||||
current_frame.polygons[index].color = string_to_color(&color_name);
|
||||
current_frame.polygons[index].color_name = color_name;
|
||||
current_frame.polygons[index].color = color;
|
||||
}
|
||||
|
||||
pub fn set_color_picker(&mut self, delta: f32, i: usize, b: bool) {
|
||||
let current_frame = self.find_poly_frame(delta);
|
||||
current_frame.polygons[i].show_color_picker = b;
|
||||
}
|
||||
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ADD/REMOVE~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Reference in New Issue
Block a user