wgui: pretty-print tree
This commit is contained in:
@@ -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,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user