feat(cheatsheet): remove list of position errors
This commit is contained in:
@@ -2,10 +2,11 @@ use std::cell::Cell;
|
||||
|
||||
use crate::gtk;
|
||||
|
||||
use glib::Properties;
|
||||
use gtk::glib;
|
||||
use gtk::prelude::*;
|
||||
use gtk::subclass::prelude::*;
|
||||
use gtk::{
|
||||
glib::{self, Properties},
|
||||
prelude::*,
|
||||
subclass::prelude::*,
|
||||
};
|
||||
|
||||
#[repr(usize)]
|
||||
#[derive(Clone)]
|
||||
@@ -14,33 +15,29 @@ pub enum HammingMode {
|
||||
Decrypt = 7,
|
||||
}
|
||||
|
||||
pub struct EventHandler<F, C> {
|
||||
pub(crate) component: C,
|
||||
pub(crate) callback: F,
|
||||
}
|
||||
|
||||
#[derive(Default, Copy, Clone)]
|
||||
pub struct SignalReduce(pub f64, pub f64, pub f64, pub f64, pub f64, pub f64);
|
||||
|
||||
impl SignalReduce {
|
||||
pub fn new() -> Self {
|
||||
Self(0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
|
||||
}
|
||||
#[allow(dead_code)]
|
||||
#[derive(Default, Copy, Clone, Debug)]
|
||||
pub struct SignalReduce {
|
||||
pub length: f64,
|
||||
pub wire_resistance: f64,
|
||||
pub wire_capacity: f64,
|
||||
pub source_voltage: f64,
|
||||
pub source_resistance: f64,
|
||||
pub frequency: f64,
|
||||
}
|
||||
|
||||
#[derive(Properties, Default)]
|
||||
#[properties(wrapper_type = super::ResultValue)]
|
||||
pub struct ResultValue {
|
||||
#[properties(wrapper_type = super::Frequency)]
|
||||
pub struct Frequency {
|
||||
#[property(get, set)]
|
||||
value: Cell<f64>,
|
||||
}
|
||||
|
||||
// The central trait for subclassing a GObject
|
||||
#[glib::object_subclass]
|
||||
impl ObjectSubclass for ResultValue {
|
||||
const NAME: &'static str = "MyGtkAppCustomButton";
|
||||
type Type = super::ResultValue;
|
||||
frequency: Cell<f64>,
|
||||
}
|
||||
|
||||
#[glib::derived_properties]
|
||||
impl ObjectImpl for ResultValue {}
|
||||
impl ObjectImpl for Frequency {}
|
||||
|
||||
#[glib::object_subclass]
|
||||
impl ObjectSubclass for Frequency {
|
||||
const NAME: &'static str = "FrequencyValue";
|
||||
type Type = super::Frequency;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user