wgui: pretty-print tree

This commit is contained in:
Aleksander
2025-10-05 17:23:27 +02:00
parent 5efbdce8f0
commit 89c083991f
10 changed files with 142 additions and 14 deletions

View File

@@ -8,7 +8,7 @@ use crate::{
use super::{WidgetObj, WidgetState};
#[derive(Default)]
#[derive(Debug, Default)]
pub struct WidgetRectangleParams {
pub color: drawing::Color,
pub color2: drawing::Color,
@@ -66,4 +66,17 @@ impl WidgetObj for WidgetRectangle {
fn set_id(&mut self, id: WidgetID) {
self.id = id;
}
fn get_type(&self) -> super::WidgetType {
super::WidgetType::Rectangle
}
fn debug_print(&self) -> String {
format!(
"[color: {}][color2: {}][gradient: {:?}]",
self.params.color.debug_ansi_block(),
self.params.color2.debug_ansi_block(),
self.params.gradient,
)
}
}