change project structure to make more sense
(move wm only stuff to wm dir)
This commit is contained in:
24
ming-wm-lib/src/components/mod.rs
Normal file
24
ming-wm-lib/src/components/mod.rs
Normal file
@@ -0,0 +1,24 @@
|
||||
use std::vec::Vec;
|
||||
|
||||
use crate::themes::ThemeInfo;
|
||||
use crate::messages::WindowMessage;
|
||||
use crate::window_manager_types::DrawInstructions;
|
||||
|
||||
pub mod toggle_button;
|
||||
pub mod highlight_button;
|
||||
pub mod paragraph;
|
||||
pub mod press_button;
|
||||
|
||||
pub trait Component<T> {
|
||||
fn handle_message(&mut self, message: WindowMessage) -> Option<T>;
|
||||
fn draw(&self, theme_info: &ThemeInfo) -> Vec<DrawInstructions>;
|
||||
|
||||
//properties
|
||||
//focusing is a way for the *window* to know what component to send input, presses, etc
|
||||
//focusing for components is purely to give a visual representation
|
||||
fn focusable(&self) -> bool;
|
||||
fn clickable(&self) -> bool;
|
||||
//fn pressable(&self) -> bool; //touch
|
||||
fn name(&self) -> &String; //should be unique
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user