| 1 | //! HyprKVM GUI module |
| 2 | //! |
| 3 | //! Provides a visual interface for configuring machine neighbors. |
| 4 | |
| 5 | mod app; |
| 6 | mod canvas; |
| 7 | mod messages; |
| 8 | mod state; |
| 9 | mod theme; |
| 10 | |
| 11 | use std::path::Path; |
| 12 | |
| 13 | use app::HyprKvmGui; |
| 14 | |
| 15 | /// Run the GUI application |
| 16 | pub fn run_gui(config_path: &Path) -> anyhow::Result<()> { |
| 17 | let config_path = config_path.to_path_buf(); |
| 18 | |
| 19 | iced::application("HyprKVM", HyprKvmGui::update, HyprKvmGui::view) |
| 20 | .window_size(iced::Size::new(800.0, 600.0)) |
| 21 | .antialiasing(true) |
| 22 | .run_with(move || HyprKvmGui::new(config_path.clone())) |
| 23 | .map_err(|e| anyhow::anyhow!("GUI error: {}", e)) |
| 24 | } |
| 25 |