removed unnecessary module definitions
This commit is contained in:
@@ -1,30 +1,26 @@
|
||||
pub mod switch_event_handlers_module{
|
||||
use crate::{
|
||||
model::model::*,
|
||||
view::components::switch::SwitchExt,
|
||||
gtk::{
|
||||
*,
|
||||
prelude::*
|
||||
},
|
||||
};
|
||||
|
||||
use crate::{
|
||||
model::model::model_module::*,
|
||||
view::components::switch::switch_module::SwitchExt,
|
||||
gtk::{
|
||||
*,
|
||||
prelude::*
|
||||
},
|
||||
};
|
||||
pub trait SwEventHandler{
|
||||
fn on_toggle(self) -> ();
|
||||
}
|
||||
|
||||
pub trait SwEventHandler{
|
||||
fn on_toggle(self) -> ();
|
||||
}
|
||||
|
||||
impl<F, C> SwEventHandler for EventHandler<F, C>
|
||||
where F: Fn(&C) + FnOnce(&C) + FnMut(&C) + 'static, C: SwitchExt + WidgetExt{
|
||||
fn on_toggle(self) -> () {
|
||||
self.component.connect_state_notify(move |switch| {
|
||||
(self.callback)(switch)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
pub fn clearing(output : &TextView, input: &TextView){
|
||||
input.buffer().set_text("");
|
||||
output.buffer().set_text("");
|
||||
impl<F, C> SwEventHandler for EventHandler<F, C>
|
||||
where F: Fn(&C) + FnOnce(&C) + FnMut(&C) + 'static, C: SwitchExt + WidgetExt{
|
||||
fn on_toggle(self) -> () {
|
||||
self.component.connect_state_notify(move |switch| {
|
||||
(self.callback)(switch)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
pub fn clearing(output : &TextView, input: &TextView){
|
||||
input.buffer().set_text("");
|
||||
output.buffer().set_text("");
|
||||
}
|
||||
Reference in New Issue
Block a user