Skip to content

Commit

Permalink
first stab at converting to new theme
Browse files Browse the repository at this point in the history
  • Loading branch information
casperstorm committed Mar 8, 2024
1 parent b9a9a11 commit 6705779
Show file tree
Hide file tree
Showing 29 changed files with 925 additions and 773 deletions.
84 changes: 25 additions & 59 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ data = { version = "0.1.0", path = "data" }
notify-rust = "4"
chrono = { version = "0.4", features = ['serde'] }
fern = "0.6.1"
iced = { version = "0.12.0", features = ["tokio", "lazy", "advanced", "image"] }
iced = { version = "0.13.0-dev", features = ["tokio", "lazy", "advanced", "image"] }
log = "0.4.16"
once_cell = "1.18"
palette = "0.7.4"
Expand All @@ -37,5 +37,5 @@ embed-resource = "2.1.1"
members = ["data", "irc", "irc/proto"]

[patch.crates-io]
iced = { git = "https://github.com/iced-rs/iced", rev = "1bb5a1b9a23e1c4739430ac87ca33b06c2f4d9df" }
iced_core = { git = "https://github.com/iced-rs/iced", rev = "1bb5a1b9a23e1c4739430ac87ca33b06c2f4d9df" }
iced = { git = "https://github.com/iced-rs/iced", rev = "a341e39df63e9c4860eb796bf5c4b6a9b41116a2" }
iced_core = { git = "https://github.com/iced-rs/iced", rev = "a341e39df63e9c4860eb796bf5c4b6a9b41116a2" }
2 changes: 1 addition & 1 deletion data/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ chrono = { version = "0.4", features = ['serde'] }
dirs-next = "2.0.0"
flate2 = "1.0"
futures = "0.3.21"
iced_core = "0.12.0"
iced_core = "0.13.0-dev"
log = "0.4.16"
palette = "0.7.4"
rand = "0.8.4"
Expand Down
17 changes: 10 additions & 7 deletions src/buffer/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub fn view<'a>(
let timestamp = config
.buffer
.format_timestamp(&message.server_time)
.map(|timestamp| selectable_text(timestamp).style(theme::Text::Transparent));
.map(|timestamp| selectable_text(timestamp).style(theme::text::transparent));

match message.target.source() {
message::Source::User(user) => {
Expand All @@ -64,9 +64,9 @@ pub fn view<'a>(
&message.text,
) =>
{
theme::Container::Highlight
theme::container::highlight
}
_ => theme::Container::Default,
_ => Default::default(),
};

let space = selectable_text(" ");
Expand All @@ -85,18 +85,21 @@ pub fn view<'a>(
)
}
message::Source::Server(_) => {
let message = selectable_text(&message.text).style(theme::Text::Server);
let message = selectable_text(&message.text).style(theme::text::info);

Some(container(row![].push_maybe(timestamp).push(message)).into())
}
message::Source::Action => {
let message = selectable_text(&message.text).style(theme::Text::Accent);
let message = selectable_text(&message.text).style(theme::text::accent);

Some(container(row![].push_maybe(timestamp).push(message)).into())
}
message::Source::Internal(message::source::Internal::Status(status)) => {
let message =
selectable_text(&message.text).style(theme::Text::Status(*status));
selectable_text(&message.text).style(match *status {
message::source::Status::Success => theme::text::success,
message::source::Status::Error => theme::text::error,
});

Some(container(row![].push_maybe(timestamp).push(message)).into())
}
Expand Down Expand Up @@ -258,7 +261,7 @@ mod nick_list {
.direction(scrollable::Direction::Vertical(
scrollable::Properties::new().width(1).scroller_width(1),
))
.style(theme::Scrollable::Hidden),
.style(theme::scrollable::hidden),
)
.width(Length::Shrink)
.max_width(120)
Expand Down
11 changes: 7 additions & 4 deletions src/buffer/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub fn view<'a>(
let timestamp = config
.buffer
.format_timestamp(&message.server_time)
.map(|timestamp| selectable_text(timestamp).style(theme::Text::Transparent));
.map(|timestamp| selectable_text(timestamp).style(theme::text::transparent));

match message.target.source() {
message::Source::User(user) => {
Expand Down Expand Up @@ -69,18 +69,21 @@ pub fn view<'a>(
)
}
message::Source::Server(_) => {
let message = selectable_text(&message.text).style(theme::Text::Server);
let message = selectable_text(&message.text).style(theme::text::info);

Some(container(row![].push_maybe(timestamp).push(message)).into())
}
message::Source::Action => {
let message = selectable_text(&message.text).style(theme::Text::Accent);
let message = selectable_text(&message.text).style(theme::text::accent);

Some(container(row![].push_maybe(timestamp).push(message)).into())
}
message::Source::Internal(message::source::Internal::Status(status)) => {
let message =
selectable_text(&message.text).style(theme::Text::Status(*status));
selectable_text(&message.text).style(match *status {
message::source::Status::Success => theme::text::success,
message::source::Status::Error => theme::text::error,
});

Some(container(row![].push_maybe(timestamp).push(message)).into())
}
Expand Down
2 changes: 1 addition & 1 deletion src/buffer/scroll_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ pub fn view<'a>(
let show_divider = !new.is_empty() || matches!(status, Status::Idle(Anchor::Bottom));

let content = if show_divider {
let divider = container(horizontal_rule(1).style(theme::Rule::Unread))
let divider = container(horizontal_rule(1).style(theme::rule::unread))
.width(Length::Fill)
.padding(5);
column![column(old), divider, column(new)]
Expand Down
9 changes: 6 additions & 3 deletions src/buffer/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,20 @@ pub fn view<'a>(
let timestamp = config
.buffer
.format_timestamp(&message.server_time)
.map(|timestamp| selectable_text(timestamp).style(theme::Text::Transparent));
.map(|timestamp| selectable_text(timestamp).style(theme::text::transparent));

match message.target.source() {
message::Source::Server(_) => {
let message = selectable_text(&message.text).style(theme::Text::Server);
let message = selectable_text(&message.text).style(theme::text::info);

Some(container(row![].push_maybe(timestamp).push(message)).into())
}
message::Source::Internal(message::source::Internal::Status(status)) => {
let message =
selectable_text(&message.text).style(theme::Text::Status(*status));
selectable_text(&message.text).style(match *status {
message::source::Status::Success => theme::text::success,
message::source::Status::Error => theme::text::error,
});

Some(container(row![].push_maybe(timestamp).push(message)).into())
}
Expand Down
6 changes: 3 additions & 3 deletions src/buffer/user_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub fn view<'a>(content: impl Into<Element<'a, Message>>, user: User) -> Element

let content = button(content)
.padding(0)
.style(theme::Button::Bare)
.style(theme::button::bare)
.on_press(Message::SingleClick(user.clone()));

context_menu(content, entries, move |entry, length| {
Expand All @@ -52,9 +52,9 @@ pub fn view<'a>(content: impl Into<Element<'a, Message>>, user: User) -> Element
Entry::Query => ("Message", Message::Query(user.clone())),
};

button(text(content).style(theme::Text::Primary))
button(text(content).style(theme::text::primary))
.width(length)
.style(theme::Button::Context)
.style(theme::button::context)
.on_press(message)
.into()
})
Expand Down
2 changes: 1 addition & 1 deletion src/icon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub fn people<'a>() -> Text<'a> {

fn to_text<'a>(unicode: char) -> Text<'a> {
text(unicode.to_string())
.style(theme::Text::Primary)
.style(theme::text::primary)
.line_height(LineHeight::Relative(1.0))
.size(theme::ICON_SIZE)
.font(font::ICON)
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ impl Application for Halloy {
container(content)
.width(Length::Fill)
.height(Length::Fill)
.style(theme::Container::Primary)
.style(theme::container::primary)
.into()
}

Expand Down
2 changes: 1 addition & 1 deletion src/screen/dashboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ impl Dashboard {
container(Space::new(Length::Fill, Length::Fill))
.width(Length::Fill)
.height(Length::Fill)
.style(theme::Container::SemiTransparent),
.style(theme::container::semi_transparent),
anchored_overlay::Anchor::BelowTopCentered,
0.0,
);
Expand Down
2 changes: 1 addition & 1 deletion src/screen/dashboard/command_bar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ impl CommandBar {
.padding([0, 20]),
container(combo_box)
.padding(1)
.style(theme::Container::Context)
.style(theme::container::context)
.width(Length::Fill),
)
}
Expand Down
Loading

0 comments on commit 6705779

Please sign in to comment.