chore: Code cleanup

This commit is contained in:
Fabio Lenherr / DashieTM 2023-11-19 02:37:11 +01:00
parent 192dacb333
commit cb3dd257f1
22 changed files with 121 additions and 106 deletions

View file

@ -1,6 +1,6 @@
#![allow(non_snake_case)]
pub mod window;
pub mod windowImpl;
pub mod handleSidebarClick;
pub mod sidebarEntry;
pub mod sidebarEntryImpl;
pub mod handleSidebarClick;
pub mod window;
pub mod windowImpl;

View file

@ -1,12 +1,12 @@
use std::sync::Arc;
use adw::subclass::prelude::ObjectSubclassIsExt;
use glib::Object;
use gtk::{FlowBox, glib};
use gtk::prelude::*;
use crate::components::base::utils::Listeners;
use crate::components::window::sidebarEntryImpl;
use crate::components::window::sidebarEntryImpl::{Categories, SidebarAction};
use adw::subclass::prelude::ObjectSubclassIsExt;
use glib::Object;
use gtk::prelude::*;
use gtk::{glib, FlowBox};
glib::wrapper! {
pub struct SidebarEntry(ObjectSubclass<sidebarEntryImpl::SidebarEntry>)

View file

@ -2,8 +2,8 @@ use std::cell::{Cell, RefCell};
use std::sync::Arc;
use glib::subclass::InitializingObject;
use gtk::{CompositeTemplate, FlowBox, glib, Image, Label, ListBoxRow};
use gtk::subclass::prelude::*;
use gtk::{glib, CompositeTemplate, FlowBox, Image, Label, ListBoxRow};
use crate::components::base::utils::Listeners;
use crate::components::window::handleSidebarClick::HANDLE_HOME;
@ -29,18 +29,18 @@ pub struct SidebarEntry {
pub category: Cell<Categories>,
pub isSubcategory: Cell<bool>,
pub onClickEvent: RefCell<SidebarAction>,
pub name : RefCell<String>,
pub name: RefCell<String>,
}
#[allow(non_snake_case)]
pub struct SidebarAction {
pub onClickEvent: fn(Arc<Listeners>,FlowBox),
pub onClickEvent: fn(Arc<Listeners>, FlowBox),
}
impl Default for SidebarAction {
fn default() -> Self {
Self {
onClickEvent: HANDLE_HOME
onClickEvent: HANDLE_HOME,
}
}
}