Update UI widget designs to improve color consistency and add a narrow height mode

This commit is contained in:
Keavon Chambers
2025-09-08 21:48:22 -07:00
parent 485152bf8d
commit 22aa8c1264
41 changed files with 364 additions and 197 deletions
@@ -79,18 +79,17 @@ impl LayoutMessageHandler {
LayoutGroup::Section { layout, .. } => {
stack.extend(layout.iter().enumerate().map(|(index, val)| ([widget_path.as_slice(), &[index]].concat(), val)));
}
LayoutGroup::Table { rows } => {
for (row_index, cell) in rows.iter().enumerate() {
for (cell_index, entry) in cell.iter().enumerate() {
for (row_index, row) in rows.iter().enumerate() {
for (cell_index, cell) in row.iter().enumerate() {
// Return if this is the correct ID
if entry.widget_id == widget_id {
if cell.widget_id == widget_id {
widget_path.push(row_index);
widget_path.push(cell_index);
return Some((entry, widget_path));
return Some((cell, widget_path));
}
if let Widget::PopoverButton(popover) = &entry.widget {
if let Widget::PopoverButton(popover) = &cell.widget {
stack.extend(
popover
.popover_layout
@@ -118,6 +118,8 @@ pub struct TextButton {
pub disabled: bool,
pub narrow: bool,
pub tooltip: String,
#[serde(skip)]
@@ -179,6 +181,8 @@ pub struct ColorInput {
pub disabled: bool,
pub narrow: bool,
#[serde(rename = "menuDirection")]
pub menu_direction: Option<MenuDirection>,
@@ -87,6 +87,8 @@ pub struct DropdownInput {
pub disabled: bool,
pub narrow: bool,
pub tooltip: String,
#[serde(skip)]
@@ -195,6 +197,8 @@ pub struct NumberInput {
// Disabled
pub disabled: bool,
pub narrow: bool,
// Value
#[widget_builder(constructor)]
pub value: Option<f64>,
@@ -333,6 +337,8 @@ pub struct RadioInput {
pub disabled: bool,
pub narrow: bool,
// This uses `u32` instead of `usize` since it will be serialized as a normal JS number (replace this with `usize` after switching to a Rust-based GUI)
#[serde(rename = "selectedIndex")]
pub selected_index: Option<u32>,
@@ -409,6 +415,8 @@ pub struct TextInput {
pub disabled: bool,
pub narrow: bool,
pub tooltip: String,
pub centered: bool,
@@ -40,6 +40,8 @@ pub enum SeparatorType {
pub struct TextLabel {
pub disabled: bool,
pub narrow: bool,
pub bold: bool,
pub italic: bool,