native-theme-iced
iced toolkit connector for native-theme.
Maps native_theme::NativeTheme data to iced's theming system, producing a
fully configured iced::Theme with correct colors for all built-in widget
styles via iced's Catalog system.
Usage
Add both crates to your Cargo.toml:
[]
= "0.3"
= "0.3"
Then create an iced theme from any native-theme preset or OS theme:
use NativeTheme;
use ;
// Load a preset
let nt = preset.unwrap;
// Pick light or dark variant (with cross-fallback)
let is_dark = true;
if let Some = pick_variant
Widget Metrics
The crate also exposes helper functions for widget sizing that iced applies per-widget rather than through the Catalog:
button_padding(variant)-- horizontal and vertical paddinginput_padding(variant)-- text input paddingborder_radius(variant)-- standard corner radiusborder_radius_lg(variant)-- large corner radius (e.g., dialogs)scrollbar_width(variant)-- scrollbar track width
License
Licensed under either of
at your option.