Skip to content

Commit

Permalink
bump iced aw
Browse files Browse the repository at this point in the history
  • Loading branch information
Redhawk18 committed Sep 6, 2023
1 parent 8620066 commit 940a279
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ edition = "2021"
[dependencies]
dark-light = "1.0.0"
iced = { version = "0.10.0", features = ["palette"]}
iced_aw = { version = "0.6", default-features = false, features = ["icons", "menu", "tab_bar"] }
iced_aw = { version = "0.7", default-features = false, features = ["icons", "menu", "tab_bar"] }
log = "0.4.18"
palette = "*"
pretty_env_logger = "0.5"
Expand Down
2 changes: 1 addition & 1 deletion src/gui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ impl Application for Blaze {
panes: Panes::default(),
},
Command::batch(vec![
font::load(iced_aw::graphics::icons::ICON_FONT_BYTES).map(Message::FontLoaded),
font::load(iced_aw::graphics::icons::ICON_FONT_BYTES).map(Message::FontLoaded)
]),
)
}
Expand Down
10 changes: 7 additions & 3 deletions src/gui/theme/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,14 @@ impl tab_bar::StyleSheet for Theme {
//TODO add is_active
type Style = TabBar;

fn active(&self, style: Self::Style, is_active: bool) -> tab_bar::Appearance {
fn active(&self, style: &Self::Style, is_active: bool) -> tab_bar::Appearance {
match style {
TabBar::Primary => tab_bar::Appearance {
background: Some(Background::Color(self.colors.background.default)),
border_color: Some(self.colors.primary.default),
border_width: 4.0,
icon_background: Some(Background::Color(self.colors.background.default)),
icon_border_radius: 0.0.into(),
icon_color: self.colors.accent.default,
tab_label_background: Background::Color(if is_active {
self.colors.primary.default
Expand All @@ -224,12 +226,14 @@ impl tab_bar::StyleSheet for Theme {
}
}

fn hovered(&self, style: Self::Style, _is_active: bool) -> tab_bar::Appearance {
fn hovered(&self, style: &Self::Style, _is_active: bool) -> tab_bar::Appearance {
match style {
TabBar::Primary => tab_bar::Appearance {
background: Some(Background::Color(self.colors.background.default)),
border_color: Some(self.colors.accent.default),
border_width: 4.0,
border_width: 1.0,
icon_background: Some(Background::Color(self.colors.background.light)),
icon_border_radius: 4.0.into(),
icon_color: self.colors.accent.default,
tab_label_background: Background::Color(self.colors.primary.default),
tab_label_border_color: self.colors.accent.default,
Expand Down
17 changes: 13 additions & 4 deletions src/gui/widgets/pane_grid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use iced::{
},
Alignment, Length,
};
use iced_aw::graphics::icons::{Icon, icon_to_char};
use iced_aw::graphics::icons::{icon_to_char, Icon};
use slotmap::{DefaultKey, SlotMap};

pub fn pane_grid<'a>(
Expand All @@ -39,9 +39,18 @@ fn title_bar(active: bool, pane: Pane) -> TitleBar<'static, Message, Renderer> {
row!().width(Length::Fill),
row!("What to put here?").width(Length::Fill),
row!(
button(text(icon_to_char(Icon::ChevronDoubleRight).to_string()).font(iced_aw::ICON_FONT)).on_press(Message::PaneSplit(Axis::Vertical, pane)),
button(text(icon_to_char(Icon::ChevronDoubleDown).to_string()).font(iced_aw::ICON_FONT)).on_press(Message::PaneSplit(Axis::Horizontal, pane)),
button(text(icon_to_char(Icon::X).to_string()).font(iced_aw::ICON_FONT)).on_press(Message::PaneClosed(pane)),
button(
text(icon_to_char(Icon::ChevronDoubleRight).to_string())
.font(iced_aw::ICON_FONT)
)
.on_press(Message::PaneSplit(Axis::Vertical, pane)),
button(
text(icon_to_char(Icon::ChevronDoubleDown).to_string())
.font(iced_aw::ICON_FONT)
)
.on_press(Message::PaneSplit(Axis::Horizontal, pane)),
button(text(icon_to_char(Icon::X).to_string()).font(iced_aw::ICON_FONT))
.on_press(Message::PaneClosed(pane)),
)
)
.align_items(Alignment::Center),
Expand Down

0 comments on commit 940a279

Please sign in to comment.