update gtk-rs
This commit is contained in:
parent
cd41400b6f
commit
cb6c5329a2
|
@ -9,9 +9,9 @@ edition = "2018"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
dirs = "^3.0.1"
|
dirs = "^3.0.1"
|
||||||
gdk = "^0.13.2"
|
gdk = "^0.14.3"
|
||||||
gio = "^0"
|
gio = "^0.14.8"
|
||||||
gtk = "^0"
|
gtk = "^0.14.3"
|
||||||
rodio = "^0.11.0"
|
rodio = "^0.11.0"
|
||||||
serde = "^1.0.125"
|
serde = "^1.0.125"
|
||||||
serde_derive = "^1.0.125"
|
serde_derive = "^1.0.125"
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
use std::env::args;
|
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
use std::io::{BufReader};
|
use std::io::{BufReader};
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
|
@ -54,9 +53,9 @@ fn build_ui(application: >k::Application) {
|
||||||
columns.set_homogeneous(false);
|
columns.set_homogeneous(false);
|
||||||
column_labels.set_homogeneous(true);
|
column_labels.set_homogeneous(true);
|
||||||
column_sliders.set_homogeneous(true);
|
column_sliders.set_homogeneous(true);
|
||||||
column_labels.set_property_expand(false);
|
column_labels.set_expand(false);
|
||||||
column_sliders.set_property_expand(true);
|
column_sliders.set_expand(true);
|
||||||
column_sliders.set_property_width_request(128);
|
column_sliders.set_width_request(128);
|
||||||
|
|
||||||
window.add(&sounds_manage);
|
window.add(&sounds_manage);
|
||||||
sounds_manage.add(&columns);
|
sounds_manage.add(&columns);
|
||||||
|
@ -127,7 +126,7 @@ fn build_ui(application: >k::Application) {
|
||||||
slider.set_draw_value(false);
|
slider.set_draw_value(false);
|
||||||
|
|
||||||
slider.connect_value_changed(move |scale| {
|
slider.connect_value_changed(move |scale| {
|
||||||
let volume = scale.get_value();
|
let volume = scale.value();
|
||||||
|
|
||||||
if volume == 0. {
|
if volume == 0. {
|
||||||
sink.pause();
|
sink.pause();
|
||||||
|
@ -144,8 +143,8 @@ fn build_ui(application: >k::Application) {
|
||||||
|
|
||||||
window.connect_delete_event(|window, _event| {
|
window.connect_delete_event(|window, _event| {
|
||||||
crate::config::save_config(crate::config::Config {
|
crate::config::save_config(crate::config::Config {
|
||||||
position: window.get_position(),
|
position: window.position(),
|
||||||
size: window.get_size()
|
size: window.size()
|
||||||
});
|
});
|
||||||
|
|
||||||
Inhibit(false)
|
Inhibit(false)
|
||||||
|
@ -162,11 +161,11 @@ pub(crate) fn instantiate() {
|
||||||
let application = gtk::Application::new(
|
let application = gtk::Application::new(
|
||||||
Some("dev.tinybird.max.lull"),
|
Some("dev.tinybird.max.lull"),
|
||||||
Default::default()
|
Default::default()
|
||||||
).expect("Initialisation failed...");
|
);
|
||||||
|
|
||||||
application.connect_activate(|app| {
|
application.connect_activate(|app| {
|
||||||
build_ui(app);
|
build_ui(app);
|
||||||
});
|
});
|
||||||
|
|
||||||
application.run(&args().collect::<Vec<_>>());
|
application.run();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue