Verified Commit a77bf0b8 authored by Jordan Petridis's avatar Jordan Petridis 🌱

Update gtk-rs family of crates

parent b9bad14d
This diff is collapsed.
...@@ -7,11 +7,11 @@ version = "0.1.0" ...@@ -7,11 +7,11 @@ version = "0.1.0"
[dependencies] [dependencies]
chrono = "0.4.6" chrono = "0.4.6"
crossbeam-channel = "0.2.6" crossbeam-channel = "0.2.6"
gdk = "0.9.0" gdk = "0.10.0"
gdk-pixbuf = "0.5.0" gdk-pixbuf = "0.6.0"
glib = "0.6.1" glib = "0.7.0"
gstreamer = "0.12.2" gstreamer = "0.13.0"
gstreamer-player = "0.12.2" gstreamer-player = "0.13.0"
humansize = "1.1.0" humansize = "1.1.0"
lazy_static = "1.2.0" lazy_static = "1.2.0"
log = "0.4.6" log = "0.4.6"
...@@ -28,21 +28,23 @@ serde_json = "1.0.33" ...@@ -28,21 +28,23 @@ serde_json = "1.0.33"
# html2text = "0.1.8" # html2text = "0.1.8"
html2text = { git = "https://github.com/alatiera/rust-html2text" } html2text = { git = "https://github.com/alatiera/rust-html2text" }
gettext-rs = { git = "https://github.com/danigm/gettext-rs", branch = "no-gettext", features = ["gettext-system"] } gettext-rs = { git = "https://github.com/danigm/gettext-rs", branch = "no-gettext", features = ["gettext-system"] }
mpris-player = "0.1.0"
[dependencies.gtk] [dependencies.gtk]
features = ["v3_22"] features = ["v3_24"]
version = "0.5.0" version = "0.6.0"
[dependencies.gio] [dependencies.gio]
features = ["v2_50"] features = ["v2_50"]
version = "0.5.1" version = "0.6.0"
[dependencies.libhandy] [dependencies.libhandy]
git = "https://gitlab.gnome.org/World/Rust/libhandy-rs" version = "0.3.0"
version = "0.2.0"
features = [ "v0_0_7"] features = [ "v0_0_7"]
[dependencies.mpris-player]
version = "0.2.0"
git = "https://gitlab.gnome.org/World/Rust/mpris-player"
[dependencies.podcasts-data] [dependencies.podcasts-data]
path = "../podcasts-data" path = "../podcasts-data"
......
...@@ -123,7 +123,7 @@ impl App { ...@@ -123,7 +123,7 @@ impl App {
let window = gtk::ApplicationWindow::new(application); let window = gtk::ApplicationWindow::new(application);
window.set_title(&i18n("Podcasts")); window.set_title(&i18n("Podcasts"));
if APP_ID.ends_with("Devel") { if APP_ID.ends_with("Devel") {
window.get_style_context().map(|c| c.add_class("devel")); window.get_style_context().add_class("devel");
} }
let weak_s = settings.downgrade(); let weak_s = settings.downgrade();
......
...@@ -66,7 +66,7 @@ impl AddPopover { ...@@ -66,7 +66,7 @@ impl AddPopover {
.ok_or_else(|| format_err!("GtkEntry blew up somehow."))?; .ok_or_else(|| format_err!("GtkEntry blew up somehow."))?;
if !(url.starts_with("https://") || url.starts_with("http://")) { if !(url.starts_with("https://") || url.starts_with("http://")) {
url = format!("http://{}", url); url = format!("http://{}", url).into();
}; };
debug!("Url: {}", url); debug!("Url: {}", url);
...@@ -100,7 +100,7 @@ impl AddPopover { ...@@ -100,7 +100,7 @@ impl AddPopover {
debug!("Url: {}", url); debug!("Url: {}", url);
if !(url.starts_with("https://") || url.starts_with("http://")) { if !(url.starts_with("https://") || url.starts_with("http://")) {
url = format!("http://{}", url); url = format!("http://{}", url).into();
}; };
debug!("Url: {}", url); debug!("Url: {}", url);
......
...@@ -86,7 +86,7 @@ impl Prefs { ...@@ -86,7 +86,7 @@ impl Prefs {
{ {
let row: &[&dyn ToValue] = &[item]; let row: &[&dyn ToValue] = &[item];
if item.to_lowercase() == cleanup_p { if item.to_lowercase() == cleanup_p {
cleanup_pos = i as i32; cleanup_pos = i as u32;
} }
store.insert_with_values(None, &[0], &row); store.insert_with_values(None, &[0], &row);
} }
......
...@@ -155,10 +155,10 @@ pub(crate) fn smooth_scroll_to(view: &gtk::ScrolledWindow, target: &gtk::Adjustm ...@@ -155,10 +155,10 @@ pub(crate) fn smooth_scroll_to(view: &gtk::ScrolledWindow, target: &gtk::Adjustm
let mut t = (now - start_time) as f64 / (end_time - start_time) as f64; let mut t = (now - start_time) as f64 / (end_time - start_time) as f64;
t = ease_out_cubic(t); t = ease_out_cubic(t);
adj.set_value(start + t * (end - start)); adj.set_value(start + t * (end - start));
glib::Continue(true) true
} else { } else {
adj.set_value(end); adj.set_value(end);
glib::Continue(false) false
} }
}); });
} }
...@@ -386,7 +386,7 @@ pub(crate) fn on_import_clicked(window: &gtk::ApplicationWindow, sender: &Sender ...@@ -386,7 +386,7 @@ pub(crate) fn on_import_clicked(window: &gtk::ApplicationWindow, sender: &Sender
// Set a filter to show only xml files // Set a filter to show only xml files
let filter = FileFilter::new(); let filter = FileFilter::new();
FileFilterExt::set_name(&filter, Some(i18n("OPML file").as_str())); FileFilter::set_name(&filter, Some(i18n("OPML file").as_str()));
filter.add_mime_type("application/xml"); filter.add_mime_type("application/xml");
filter.add_mime_type("text/xml"); filter.add_mime_type("text/xml");
dialog.add_filter(&filter); dialog.add_filter(&filter);
...@@ -432,7 +432,7 @@ pub(crate) fn on_export_clicked(window: &gtk::ApplicationWindow, sender: &Sender ...@@ -432,7 +432,7 @@ pub(crate) fn on_export_clicked(window: &gtk::ApplicationWindow, sender: &Sender
// Set a filter to show only xml files // Set a filter to show only xml files
let filter = FileFilter::new(); let filter = FileFilter::new();
FileFilterExt::set_name(&filter, Some(i18n("OPML file").as_str())); FileFilter::set_name(&filter, Some(i18n("OPML file").as_str()));
filter.add_mime_type("application/xml"); filter.add_mime_type("application/xml");
filter.add_mime_type("text/xml"); filter.add_mime_type("text/xml");
dialog.add_filter(&filter); dialog.add_filter(&filter);
......
...@@ -29,7 +29,18 @@ pub(crate) struct BaseView { ...@@ -29,7 +29,18 @@ pub(crate) struct BaseView {
impl Default for BaseView { impl Default for BaseView {
fn default() -> Self { fn default() -> Self {
let container = gtk::Box::new(Orientation::Horizontal, 0); let container = gtk::Box::new(Orientation::Horizontal, 0);
let scrolled_window = gtk::ScrolledWindow::new(None, None); // TODO: Remember to file an issue about this API
// error[E0283]: type annotations required: cannot resolve `_: gdk_pixbuf::IsA<gtk::Adjustment>`
// --> ../podcasts-gtk/src/widgets/base_view.rs:32:31
// |
// 32 | let scrolled_window = gtk::ScrolledWindow::new(None, None);
// | ^^^^^^^^^^^^^^^^^^^^^^^^
// |
// = note: required by `gtk::ScrolledWindow::new`
//
// error: aborting due to previous error
let foo: Option<&Adjustment> = None;
let scrolled_window = gtk::ScrolledWindow::new(foo.clone(), foo.clone());
scrolled_window.set_policy(PolicyType::Never, PolicyType::Automatic); scrolled_window.set_policy(PolicyType::Never, PolicyType::Automatic);
container.set_size_request(360, -1); container.set_size_request(360, -1);
......
...@@ -36,7 +36,7 @@ impl Default for EmptyView { ...@@ -36,7 +36,7 @@ impl Default for EmptyView {
let builder = gtk::Builder::new_from_resource("/org/gnome/Podcasts/gtk/empty_view.ui"); let builder = gtk::Builder::new_from_resource("/org/gnome/Podcasts/gtk/empty_view.ui");
let view: gtk::Box = builder.get_object("empty_view").unwrap(); let view: gtk::Box = builder.get_object("empty_view").unwrap();
let image: gtk::Image = builder.get_object("image").unwrap(); let image: gtk::Image = builder.get_object("image").unwrap();
image.set_from_icon_name(format!("{}-symbolic", *APP_ID).as_str(), 256); image.set_from_icon_name(format!("{}-symbolic", *APP_ID).as_str(), gtk::IconSize::__Unknown(256));
EmptyView(view) EmptyView(view)
} }
} }
......
...@@ -111,11 +111,11 @@ impl InfoLabels { ...@@ -111,11 +111,11 @@ impl InfoLabels {
if episode.played().is_some() { if episode.played().is_some() {
self.title self.title
.get_style_context() .get_style_context()
.map(|c| c.add_class("dim-label")); .add_class("dim-label");
} else { } else {
self.title self.title
.get_style_context() .get_style_context()
.map(|c| c.remove_class("dim-label")); .remove_class("dim-label");
} }
} }
......
...@@ -139,7 +139,7 @@ fn dim_titles(episodes: &gtk::ListBox) -> Option<()> { ...@@ -139,7 +139,7 @@ fn dim_titles(episodes: &gtk::ListBox) -> Option<()> {
let bar = foo.get_children().remove(0).downcast::<gtk::Box>().ok()?; let bar = foo.get_children().remove(0).downcast::<gtk::Box>().ok()?;
let title = bar.get_children().remove(0).downcast::<gtk::Label>().ok()?; let title = bar.get_children().remove(0).downcast::<gtk::Label>().ok()?;
title.get_style_context().map(|c| c.add_class("dim-label")); title.get_style_context().add_class("dim-label");
} }
Some(()) Some(())
} }
......
...@@ -121,7 +121,7 @@ struct ShowsChild { ...@@ -121,7 +121,7 @@ struct ShowsChild {
impl Default for ShowsChild { impl Default for ShowsChild {
fn default() -> Self { fn default() -> Self {
let cover = gtk::Image::new_from_icon_name("image-x-generic-symbolic", -1); let cover = gtk::Image::new_from_icon_name("image-x-generic-symbolic", gtk::IconSize::__Unknown(-1));
let child = gtk::FlowBoxChild::new(); let child = gtk::FlowBoxChild::new();
cover.set_pixel_size(256); cover.set_pixel_size(256);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment