Compare commits

...

2 Commits

Author SHA1 Message Date
Max Bradbury d46e1f48e2 +x 2020-10-27 08:08:11 +00:00
Max Bradbury 4f821fccd5 change styling 2020-10-27 08:08:03 +00:00
2 changed files with 28 additions and 25 deletions

0
deploy.sh Normal file → Executable file
View File

View File

@ -55,12 +55,33 @@ fn build_ui(application: &gtk::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, 256); window.set_default_size(256, 128);
let vertical = gtk::Box::new(Orientation::Vertical, SPACING); let button_manage_sounds = gtk::Button::with_label("manage sounds");
vertical.set_homogeneous(true);
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(); let device = rodio::default_output_device().unwrap();
@ -97,11 +118,9 @@ fn build_ui(application: &gtk::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));
row.add(&label); label.set_halign(gtk::Align::End);
column_labels.add(&label);
let adjustment = gtk::Adjustment::new( let adjustment = gtk::Adjustment::new(
0.0, 0.0,
@ -130,25 +149,9 @@ fn build_ui(application: &gtk::Application) {
} }
}); });
row.add(&slider); column_sliders.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();
} }