Skip to main content

bevy_feathers/
constants.rs

1//! Various non-themable constants for the Feathers look and feel.
2
3/// Font asset paths
4pub mod fonts {
5    /// Default regular font path
6    pub const REGULAR: &str = "embedded://bevy_feathers/assets/fonts/FiraSans-Regular.ttf";
7    /// Regular italic font path
8    pub const ITALIC: &str = "embedded://bevy_feathers/assets/fonts/FiraSans-Italic.ttf";
9    /// Bold font path
10    pub const BOLD: &str = "embedded://bevy_feathers/assets/fonts/FiraSans-Bold.ttf";
11    /// Bold italic font path
12    pub const BOLD_ITALIC: &str = "embedded://bevy_feathers/assets/fonts/FiraSans-BoldItalic.ttf";
13    /// Monospace font path
14    pub const MONO: &str = "embedded://bevy_feathers/assets/fonts/FiraMono-Medium.ttf";
15}
16
17/// Icon paths
18pub mod icons {
19    /// Downward-pointing chevron
20    pub const CHEVRON_DOWN: &str = "embedded://bevy_feathers/assets/icons/chevron-down.png";
21    /// Right-pointing chevron
22    pub const CHEVRON_RIGHT: &str = "embedded://bevy_feathers/assets/icons/chevron-right.png";
23    /// Diagonal Cross
24    pub const X: &str = "embedded://bevy_feathers/assets/icons/x.png";
25}
26
27/// Size constants
28pub mod size {
29    use bevy_text::FontSize;
30    use bevy_ui::Val;
31
32    /// Common row size for buttons, sliders, spinners, etc.
33    pub const ROW_HEIGHT: Val = Val::Px(24.0);
34
35    /// Width and height of a checkbox
36    pub const CHECKBOX_SIZE: Val = Val::Px(18.0);
37
38    /// Height for pane headers
39    pub const HEADER_HEIGHT: Val = Val::Px(30.0);
40
41    /// Width and height of a radio button
42    pub const RADIO_SIZE: Val = Val::Px(18.0);
43
44    /// Width of a toggle switch
45    pub const TOGGLE_WIDTH: Val = Val::Px(32.0);
46
47    /// Height of a toggle switch
48    pub const TOGGLE_HEIGHT: Val = Val::Px(18.0);
49
50    /// Regular font size, used for most widget captions
51    pub const MEDIUM_FONT: FontSize = FontSize::Px(14.0);
52
53    /// Slightly smaller font size, used for text inputs
54    pub const COMPACT_FONT: FontSize = FontSize::Px(13.0);
55
56    /// Small font size
57    pub const SMALL_FONT: FontSize = FontSize::Px(12.0);
58
59    /// Extra-small font size
60    pub const EXTRA_SMALL_FONT: FontSize = FontSize::Px(11.0);
61}