Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,538 changes: 1,168 additions & 1,370 deletions Cargo.lock

Large diffs are not rendered by default.

33 changes: 16 additions & 17 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,43 +1,42 @@
[package]
name = "crane-ui"
version = "1.0.0"
version = "1.1.0"
edition = "2024"
authors = ["TheRustyPickle <rusty.pickle94@gmail.com>"]
readme = "README.md"
description = """
On-demand Telegram chat analytic generator
"""
readme = "README.md"
homepage = "https://github.com/TheRustyPickle/Crane"
repository = "https://github.com/TheRustyPickle/Crane"
license = "MIT"

[[bin]]
bench = false
name = "crane"
path = "src/main.rs"
test = false
bench = false

[dependencies]
crates_io_api = { version = "0.12.0", default-features = false, features = [
"rustls",
] }
dirs = "6.0.0"
iced = { git = "https://github.com/iced-rs/iced", features = [
"tokio",
"sipper",
], rev = "0b78f2aa5d0a741da79f3b2b0a91046c32587403" }
iced = { git = "https://github.com/iced-rs/iced", rev = "36b6ed0aec85fb01afbb63b4f48afa7763487967", features = [
"sipper",
"tokio",
] }
log = "0.4.28"
open = "5.3.5"
pretty_env_logger = "0.5.0"
semver = "1.0.27"
reqwest = { version = "0.13.4", features = ["json"] }
semver = "1.0.28"
serde = "1.0.228"
serde_json = "1.0.145"
reqwest = "0.12.24"
tokio = { version = "1.47.2", features = ["rt-multi-thread", "process"] }
crates_io_api = { version = "0.12.0", default-features = false, features = [
"rustls",
] }
serde_json = "1.0.150"
sipper = "0.1.0"
open = "5.3.2"
tokio = { version = "1.52.3", features = ["process", "rt-multi-thread"] }

[build-dependencies]
iced_fontello = "0.13"
iced_fontello = "0.14.1"

# The profile that 'dist' will build with
[profile.dist]
Expand Down
4 changes: 2 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub fn main() {
println!("cargo::rerun-if-changed=fonts/icons.toml");
iced_fontello::build("fonts/icons.toml").expect("Build example-icons font");
// println!("cargo::rerun-if-changed=fonts/icons.toml");
// iced_fontello::build("fonts/icons.toml").expect("Build example-icons font");
}
4 changes: 2 additions & 2 deletions src/components/bottom_bar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ impl MainWindow {
container(progress)
.height(Length::Fixed(container_height))
.style(|them: &Theme| {
let palette = them.extended_palette();
let palette = them.palette();

container::Style {
background: Some(palette.background.weak.color.into()),
Expand Down Expand Up @@ -149,7 +149,7 @@ impl MainWindow {
container(layout)
.height(Length::Fixed(container_height))
.style(|theme: &Theme| {
let palette = theme.extended_palette();
let palette = theme.palette();
container::Style {
background: Some(palette.background.weak.color.into()),
..Default::default()
Expand Down
24 changes: 12 additions & 12 deletions src/components/crate_items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ impl MainWindow {

let mut icon = if for_removal {
if self.delete_crates.contains_key(&crate_item.name) {
tick().color(Color::parse("#F71735").unwrap())
tick().color("#F71735".parse::<Color>().unwrap())
} else {
trash().color(Color::parse("#F71735").unwrap())
trash().color("#F71735".parse::<Color>().unwrap())
}
} else if self.update_crates.contains_key(&crate_item.name) {
tick().color(Color::WHITE)
Expand Down Expand Up @@ -188,12 +188,12 @@ impl MainWindow {
}
}

let feature_layout = scrollable(
container(feature_list).width(Length::Fill).height(30),
)
.direction(scrollable::Direction::Horizontal(
Scrollbar::new().width(5).scroller_width(5),
));
let feature_layout =
scrollable(container(feature_list).width(Length::Fill).height(30))
.direction(scrollable::Direction::Horizontal(
Scrollbar::new().width(5).scroller_width(5),
))
.width(Length::Fill);

let git_tooltip_content = if let Some(git_link) = &crate_item.git_link {
text(git_link)
Expand All @@ -217,7 +217,7 @@ impl MainWindow {
Position::Top,
)
.style(|theme: &Theme| {
let palette = theme.extended_palette();
let palette = theme.palette();
container::Style {
background: Some(palette.background.weaker.color.into()),
text_color: Some(palette.background.weak.text),
Expand All @@ -242,7 +242,7 @@ impl MainWindow {
Position::Top,
)
.style(|theme: &Theme| {
let palette = theme.extended_palette();
let palette = theme.palette();
container::Style {
background: Some(palette.background.weaker.color.into()),
text_color: Some(palette.background.weak.text),
Expand Down Expand Up @@ -271,7 +271,7 @@ impl MainWindow {

let card = container(card_layout)
.style(move |theme: &Theme| {
let palette = theme.extended_palette();
let palette = theme.palette();
let mut background = palette.background.base.color;

if let Some(hover_index) = self.hovering
Expand Down Expand Up @@ -322,7 +322,7 @@ impl MainWindow {
column.push(mouse_area)
})
.padding(20)
.max_width(800.0);
.width(Length::Fit.max(800.0));

container(
scrollable(center(crate_cards))
Expand Down
6 changes: 3 additions & 3 deletions src/components/modal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ impl MainWindow {
.on_submit(Message::GitInput(GitInputEvent::Submit))
.padding(5)
.style(|theme: &Theme, status| {
let palette = theme.extended_palette();
let palette = theme.palette();

let active = text_input::Style {
background: (palette.background.base.color).into(),
Expand Down Expand Up @@ -98,7 +98,7 @@ impl MainWindow {
.height(modal_width / 4)
.padding(10)
.style(|theme: &Theme| {
let palette = theme.extended_palette();
let palette = theme.palette();
container::Style {
background: Some(palette.background.weak.color.into()),
text_color: Some(palette.background.weak.text),
Expand Down Expand Up @@ -162,7 +162,7 @@ impl MainWindow {
.height(modal_length)
.padding(10)
.style(|theme: &Theme| {
let palette = theme.extended_palette();
let palette = theme.palette();
container::Style {
background: Some(palette.background.weak.color.into()),
text_color: Some(palette.background.weak.text),
Expand Down
2 changes: 1 addition & 1 deletion src/icon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ pub fn trash<'a>() -> Text<'a> {
}

fn icon(codepoint: &str) -> Text<'_> {
text(codepoint).font(Font::with_name("icons"))
text(codepoint).font(Font::new("icons"))
}
2 changes: 0 additions & 2 deletions src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ impl MainWindow {
);
}
WorkerEvent::SuccessCrate(details) => {
info!("Successfully fetched crate: {}", details.crate_data.name);

self.fetch_progress = Some(self.fetch_progress.unwrap_or(0) + 1);

let mut progress_status = 0.0;
Expand Down
22 changes: 11 additions & 11 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ where
Message: Clone + 'a,
{
button(content).style(|theme: &Theme, status| {
let palette = theme.extended_palette();
let palette = theme.palette();
let mut style = button::Style {
border: Border {
radius: 8.into(),
Expand All @@ -51,7 +51,7 @@ where
Message: Clone + 'a,
{
button(content).style(|theme: &Theme, status| {
let palette = theme.extended_palette();
let palette = theme.palette();

let mut style = button::Style {
border: Border {
Expand Down Expand Up @@ -79,7 +79,7 @@ where
Message: Clone + 'a,
{
button(content).style(|theme: &Theme, status| {
let palette = theme.extended_palette();
let palette = theme.palette();

let mut style = button::Style {
border: Border {
Expand All @@ -90,9 +90,9 @@ where
};

style.background = Some(match status {
Status::Active => Color::parse("#FFCDD2").unwrap().into(),
Status::Hovered => Color::parse("#FFB3B8").unwrap().into(),
Status::Pressed => Color::parse("#FF999D").unwrap().into(),
Status::Active => "#FFCDD2".parse::<Color>().unwrap().into(),
Status::Hovered => "#FFB3B8".parse::<Color>().unwrap().into(),
Status::Pressed => "#FF999D".parse::<Color>().unwrap().into(),
Status::Disabled => palette.background.strongest.color.into(),
});

Expand All @@ -108,11 +108,11 @@ where
Message: Clone + 'a,
{
button(content).style(move |theme: &Theme, status| {
let palette = theme.extended_palette();
let palette = theme.palette();

let success_base = Color::parse("#A5D6A7").unwrap();
let success_hover = Color::parse("#81C784").unwrap();
let success_strong = Color::parse("#66BB6A").unwrap();
let success_base = "#A5D6A7".parse::<Color>().unwrap();
let success_hover = "#81C784".parse::<Color>().unwrap();
let success_strong = "#66BB6A".parse::<Color>().unwrap();

let mut style = button::Style {
border: Border {
Expand Down Expand Up @@ -159,7 +159,7 @@ where
Message: Clone + 'a,
{
button(content).style(move |theme: &Theme, status| {
let palette = theme.extended_palette();
let palette = theme.palette();

let mut style = button::Style {
border: Border {
Expand Down
6 changes: 6 additions & 0 deletions tombi.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
toml-version = "v1.0.0"

[[schemas]]
toml-version = "v1.0.0"
path = "tombi://www.schemastore.org/cargo.json"
include = ["Cargo.toml"]
Loading