update gtk-rs

This commit is contained in:
Max Bradbury 2022-01-11 19:50:06 +00:00
parent cd41400b6f
commit cb6c5329a2
2 changed files with 11 additions and 12 deletions

View File

@ -9,9 +9,9 @@ edition = "2018"
[dependencies]
dirs = "^3.0.1"
gdk = "^0.13.2"
gio = "^0"
gtk = "^0"
gdk = "^0.14.3"
gio = "^0.14.8"
gtk = "^0.14.3"
rodio = "^0.11.0"
serde = "^1.0.125"
serde_derive = "^1.0.125"

View File

@ -1,4 +1,3 @@
use std::env::args;
use std::fs::File;
use std::io::{BufReader};
use std::process::Command;
@ -54,9 +53,9 @@ fn build_ui(application: &gtk::Application) {
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);
column_labels.set_expand(false);
column_sliders.set_expand(true);
column_sliders.set_width_request(128);
window.add(&sounds_manage);
sounds_manage.add(&columns);
@ -127,7 +126,7 @@ fn build_ui(application: &gtk::Application) {
slider.set_draw_value(false);
slider.connect_value_changed(move |scale| {
let volume = scale.get_value();
let volume = scale.value();
if volume == 0. {
sink.pause();
@ -144,8 +143,8 @@ fn build_ui(application: &gtk::Application) {
window.connect_delete_event(|window, _event| {
crate::config::save_config(crate::config::Config {
position: window.get_position(),
size: window.get_size()
position: window.position(),
size: window.size()
});
Inhibit(false)
@ -162,11 +161,11 @@ pub(crate) fn instantiate() {
let application = gtk::Application::new(
Some("dev.tinybird.max.lull"),
Default::default()
).expect("Initialisation failed...");
);
application.connect_activate(|app| {
build_ui(app);
});
application.run(&args().collect::<Vec<_>>());
application.run();
}