⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

SystemTray

Struct SystemTray 

Source
pub struct SystemTray { /* private fields */ }
Expand description

System tray managing a collection of status indicator items.

Implementations§

Source§

impl SystemTray

Source

pub fn new() -> Self

Create a new system tray with default status items.

Source

pub fn add_item(&mut self, item: SysTrayItem)

Add a new item to the tray.

Source

pub fn remove_item(&mut self, item_type: SysTrayItemType)

Remove the first item matching the given type.

Source

pub fn update_clock( &mut self, hours: u8, minutes: u8, _seconds: u8, month: u8, day: u8, )

Update the clock display with the given time and date.

Source

pub fn update_cpu(&mut self, usage_percent: u8)

Update the CPU usage display.

Source

pub fn update_memory(&mut self, used_mb: u32, total_mb: u32)

Update the memory usage display.

Source

pub fn update_network(&mut self, is_up: bool)

Update the network status display.

Source

pub fn update_volume(&mut self, volume_percent: u8)

Update the volume display (0-100).

Source

pub fn update_battery(&mut self, label_str: &str)

Update the battery/power status display.

Source

pub fn total_width(&self) -> usize

Total pixel width of all visible tray items plus inter-item padding.

Source

pub fn render_to_buffer( &self, buffer: &mut [u32], buf_width: usize, x_start: usize, y_start: usize, )

Render the system tray into a u32 (BGRA) pixel buffer.

Items are drawn starting at (x_start, y_start) and proceed left-to-right. Separators are drawn between items.

Source

pub fn handle_click(&self, x: usize, _y: usize) -> Option<SysTrayItemType>

Determine which tray item (if any) was clicked at position (x, y).

Coordinates are relative to the tray area origin (the same coordinate system used for render_to_buffer). Returns None if the click is outside any item.

Trait Implementations§

Source§

impl Default for SystemTray

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for SystemTray

§

impl RefUnwindSafe for SystemTray

§

impl Send for SystemTray

§

impl Sync for SystemTray

§

impl Unpin for SystemTray

§

impl UnwindSafe for SystemTray

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.