Resolve warnings in dashboard
This commit is contained in:
parent
35abcfcf28
commit
f9e4dcd68a
@ -31,7 +31,9 @@ impl ApplicationWindow {
|
||||
|
||||
let provider = gtk::CssProvider::new();
|
||||
provider.load_from_data(&stylesheet);
|
||||
#[allow(deprecated)]
|
||||
let context = window.style_context();
|
||||
#[allow(deprecated)]
|
||||
context.add_provider(&provider, STYLE_PROVIDER_PRIORITY_USER);
|
||||
|
||||
let layout = gtk::Box::builder()
|
||||
|
@ -36,6 +36,7 @@ impl Default for TransitClock {
|
||||
s.set_draw_func({
|
||||
let s = s.clone();
|
||||
move |_, context, width, height| {
|
||||
#[allow(deprecated)]
|
||||
let style_context = WidgetExt::style_context(&s);
|
||||
let center_x = width as f64 / 2.;
|
||||
let center_y = height as f64 / 2.;
|
||||
@ -45,7 +46,9 @@ impl Default for TransitClock {
|
||||
let sunrise = info.sunrise - NaiveTime::from_hms_opt(0, 0, 0).unwrap();
|
||||
let sunset = info.sunset - NaiveTime::from_hms_opt(0, 0, 0).unwrap();
|
||||
|
||||
#[allow(deprecated)]
|
||||
let night_color = style_context.lookup_color("dark_5").unwrap();
|
||||
#[allow(deprecated)]
|
||||
let day_color = style_context.lookup_color("blue_1").unwrap();
|
||||
|
||||
PieChart::new(&style_context)
|
||||
|
@ -1,5 +1,7 @@
|
||||
use cairo::Context;
|
||||
use gtk::{gdk::RGBA, prelude::*, StyleContext};
|
||||
use gtk::{gdk::RGBA, prelude::*};
|
||||
#[allow(deprecated)]
|
||||
use gtk::StyleContext;
|
||||
use std::f64::consts::PI;
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
@ -27,7 +29,9 @@ pub struct PieChart {
|
||||
}
|
||||
|
||||
impl PieChart {
|
||||
#[allow(deprecated)]
|
||||
pub fn new(style_context: &StyleContext) -> Self {
|
||||
#[allow(deprecated)]
|
||||
Self {
|
||||
rotation: 0.,
|
||||
wedges: vec![],
|
||||
|
@ -31,7 +31,9 @@ impl ApplicationWindow {
|
||||
|
||||
let provider = gtk::CssProvider::new();
|
||||
provider.load_from_data(&stylesheet);
|
||||
#[allow(deprecated)]
|
||||
let context = window.style_context();
|
||||
#[allow(deprecated)]
|
||||
context.add_provider(&provider, STYLE_PROVIDER_PRIORITY_USER);
|
||||
|
||||
let layout = gtk::FlowBox::new();
|
||||
|
Loading…
Reference in New Issue
Block a user