Files
hcie-rust-v3.05/hcie-iced-app/crates/hcie-iced-gui/src/panels/status_bar.rs
T
phantom b49106dc1d BIG REFACTOR GPT SOL
feat: Refactor Iced panel adapter and introduce build metadata management

- Updated Cargo.toml files across multiple crates to use workspace versioning.
- Enhanced the `iced-panel-adapter` to include a new `plain_slider` module and updated widget rendering to support theme colors.
- Added new theme color utilities for recessed and elevated surfaces in `iced-panel-adapter`.
- Introduced a new `hcie-build-info` crate to manage build metadata, including a build ID system.
- Created a build script to synchronize build IDs across the workspace.
- Added a Makefile for simplified build commands for the Iced application.
- Implemented regression tests for vector shape creation history in the engine API.
- Added a new script for managing Cargo commands with synchronized build ID increments.
- Updated line count report to reflect recent changes in codebase.
- Created a visual plan document for future improvements in the Iced history and panel systems.
2026-07-21 04:25:23 +03:00

62 lines
1.5 KiB
Rust
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
//! Status bar — bottom bar with tool info, coordinates, zoom, canvas size.
//! Uses ThemeColors for consistent styling.
use crate::app::Message;
use crate::panels::styles;
use crate::theme::ThemeColors;
use crate::widgets::plain_slider::plain_slider;
use hcie_engine_api::Tool;
use iced::widget::{container, row, text};
use iced::{Element, Length};
/// Build the status bar element.
pub fn view<'a>(
active_tool: &Tool,
cursor_pos: Option<(u32, u32)>,
zoom: f32,
canvas_w: u32,
canvas_h: u32,
colors: ThemeColors,
) -> Element<'a, Message> {
let tool_name = text(active_tool.label()).size(11);
let coords = match cursor_pos {
Some((x, y)) => text(format!("({}, {})", x, y)).size(11),
None => text(" ").size(11),
};
let zoom_pct = text(format!("{:.0}%", zoom * 100.0)).size(11);
let canvas_size = text(format!("{}×{}", canvas_w, canvas_h)).size(11);
let zoom_slider = container(plain_slider(
"Zoom",
zoom,
0.01..=16.0,
0.01,
"×",
2,
colors,
Message::CanvasZoomSet,
))
.width(120);
let bar = row![
tool_name,
text(" | ").size(11),
coords,
text(" ").size(11).width(Length::Fill),
zoom_slider,
zoom_pct,
text(" | ").size(11),
canvas_size,
]
.spacing(4)
.align_y(iced::Alignment::Center)
.padding([2, 8]);
container(bar)
.width(Length::Fill)
.style(move |_theme| styles::statusbar_background(colors))
.into()
}