Compare commits
No commits in common. "d46e1f48e227e3327ab8de79dccfa1c5ff8e3fdf" and "4f58c1eece579c4219ce74742facfe44291be0dd" have entirely different histories.
d46e1f48e2
...
4f58c1eece
53
src/main.rs
53
src/main.rs
|
@ -55,33 +55,12 @@ fn build_ui(application: >k::Application) {
|
||||||
window.set_title("lull");
|
window.set_title("lull");
|
||||||
window.set_border_width(SPACING as u32);
|
window.set_border_width(SPACING as u32);
|
||||||
window.set_position(gtk::WindowPosition::Center);
|
window.set_position(gtk::WindowPosition::Center);
|
||||||
window.set_default_size(256, 128);
|
window.set_default_size(256, 256);
|
||||||
|
|
||||||
let button_manage_sounds = gtk::Button::with_label("manage sounds");
|
let vertical = gtk::Box::new(Orientation::Vertical, SPACING);
|
||||||
|
vertical.set_homogeneous(true);
|
||||||
|
|
||||||
button_manage_sounds.connect_clicked(|_| {
|
window.add(&vertical);
|
||||||
let mut file_manager = Command::new(file_manager());
|
|
||||||
file_manager.arg(get_data_dir());
|
|
||||||
file_manager.output().unwrap();
|
|
||||||
});
|
|
||||||
|
|
||||||
let sounds_manage = gtk::Box::new(Orientation::Vertical, SPACING);
|
|
||||||
let columns = gtk::Box::new(Orientation::Horizontal, SPACING);
|
|
||||||
let column_labels = gtk::Box::new(Orientation::Vertical, SPACING);
|
|
||||||
let column_sliders = gtk::Box::new(Orientation::Vertical, SPACING);
|
|
||||||
|
|
||||||
columns.set_homogeneous(false);
|
|
||||||
column_labels.set_homogeneous(true);
|
|
||||||
column_sliders.set_homogeneous(true);
|
|
||||||
column_labels.set_property_expand(false);
|
|
||||||
column_sliders.set_property_expand(true);
|
|
||||||
column_sliders.set_property_width_request(128);
|
|
||||||
|
|
||||||
window.add(&sounds_manage);
|
|
||||||
sounds_manage.add(&columns);
|
|
||||||
sounds_manage.add(&button_manage_sounds);
|
|
||||||
columns.add(&column_labels);
|
|
||||||
columns.add(&column_sliders);
|
|
||||||
|
|
||||||
let device = rodio::default_output_device().unwrap();
|
let device = rodio::default_output_device().unwrap();
|
||||||
|
|
||||||
|
@ -118,9 +97,11 @@ fn build_ui(application: >k::Application) {
|
||||||
sink.append(source);
|
sink.append(source);
|
||||||
sink.pause();
|
sink.pause();
|
||||||
|
|
||||||
|
let row = gtk::Box::new(Orientation::Horizontal, SPACING);
|
||||||
|
row.set_homogeneous(true);
|
||||||
|
|
||||||
let label = gtk::Label::new(Some(name));
|
let label = gtk::Label::new(Some(name));
|
||||||
label.set_halign(gtk::Align::End);
|
row.add(&label);
|
||||||
column_labels.add(&label);
|
|
||||||
|
|
||||||
let adjustment = gtk::Adjustment::new(
|
let adjustment = gtk::Adjustment::new(
|
||||||
0.0,
|
0.0,
|
||||||
|
@ -149,9 +130,25 @@ fn build_ui(application: >k::Application) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
column_sliders.add(&slider);
|
row.add(&slider);
|
||||||
|
|
||||||
|
vertical.add(&row);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let row_add = gtk::Box::new(Orientation::Horizontal, SPACING);
|
||||||
|
row_add.set_homogeneous(true);
|
||||||
|
|
||||||
|
let button_manage_sounds = gtk::Button::with_label("manage sounds");
|
||||||
|
|
||||||
|
button_manage_sounds.connect_clicked(|_| {
|
||||||
|
let mut file_manager = Command::new(file_manager());
|
||||||
|
file_manager.arg(get_data_dir());
|
||||||
|
file_manager.output().unwrap();
|
||||||
|
});
|
||||||
|
|
||||||
|
row_add.add(&button_manage_sounds);
|
||||||
|
vertical.add(&row_add);
|
||||||
|
|
||||||
window.show_all();
|
window.show_all();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue