Compare commits
2 Commits
4f58c1eece
...
d46e1f48e2
Author | SHA1 | Date |
---|---|---|
Max Bradbury | d46e1f48e2 | |
Max Bradbury | 4f821fccd5 |
53
src/main.rs
53
src/main.rs
|
@ -55,12 +55,33 @@ fn build_ui(application: >k::Application) {
|
|||
window.set_title("lull");
|
||||
window.set_border_width(SPACING as u32);
|
||||
window.set_position(gtk::WindowPosition::Center);
|
||||
window.set_default_size(256, 256);
|
||||
window.set_default_size(256, 128);
|
||||
|
||||
let vertical = gtk::Box::new(Orientation::Vertical, SPACING);
|
||||
vertical.set_homogeneous(true);
|
||||
let button_manage_sounds = gtk::Button::with_label("manage sounds");
|
||||
|
||||
window.add(&vertical);
|
||||
button_manage_sounds.connect_clicked(|_| {
|
||||
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();
|
||||
|
||||
|
@ -97,11 +118,9 @@ fn build_ui(application: >k::Application) {
|
|||
sink.append(source);
|
||||
sink.pause();
|
||||
|
||||
let row = gtk::Box::new(Orientation::Horizontal, SPACING);
|
||||
row.set_homogeneous(true);
|
||||
|
||||
let label = gtk::Label::new(Some(name));
|
||||
row.add(&label);
|
||||
label.set_halign(gtk::Align::End);
|
||||
column_labels.add(&label);
|
||||
|
||||
let adjustment = gtk::Adjustment::new(
|
||||
0.0,
|
||||
|
@ -130,25 +149,9 @@ fn build_ui(application: >k::Application) {
|
|||
}
|
||||
});
|
||||
|
||||
row.add(&slider);
|
||||
|
||||
vertical.add(&row);
|
||||
column_sliders.add(&slider);
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue