Changed the file structure
This commit is contained in:
parent
7743d0d084
commit
420d3c3dfc
22 changed files with 409 additions and 395 deletions
31
src/widget/navigation/macros.rs
Normal file
31
src/widget/navigation/macros.rs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
pub mod nav_bar {
|
||||
use iced::{widget, Background, Color, Theme};
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! nav_button {
|
||||
($icon: expr, $title:expr, $condensed:expr) => {{
|
||||
if $condensed {
|
||||
$crate::iced::widget::Button::new($crate::widget::icon($icon, 22)).padding(8)
|
||||
} else {
|
||||
$crate::widget::button!(
|
||||
$crate::widget::icon($icon, 22),
|
||||
$crate::iced::widget::Text::new($title),
|
||||
$crate::iced::widget::horizontal_space($crate::iced::Length::Fill),
|
||||
)
|
||||
}
|
||||
}};
|
||||
}
|
||||
|
||||
pub fn nav_bar_style(theme: &Theme) -> widget::container::Appearance {
|
||||
let cosmic = &theme.cosmic().primary;
|
||||
widget::container::Appearance {
|
||||
text_color: Some(cosmic.on.into()),
|
||||
background: Some(Background::Color(cosmic.base.into())),
|
||||
border_radius: 8.0,
|
||||
border_width: 0.0,
|
||||
border_color: Color::TRANSPARENT,
|
||||
}
|
||||
}
|
||||
|
||||
pub use nav_button;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue