Skip to content

Commit

Permalink
Merge pull request #25 from eirnym/compile-fix
Browse files Browse the repository at this point in the history
Set latest available versions. Fix most incompatibilities
  • Loading branch information
krshrimali committed Feb 11, 2024
2 parents 1c0ba8a + 18dd748 commit 440352f
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 30 deletions.
33 changes: 17 additions & 16 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,20 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
serde = {version = "*", features=["derive"]}
iced = { version = "*", features = ["image", "debug"] }
iced_style = "*"
iced_core = "*"
iced_native = "*"
itertools = "*"
reqwest = { version = "*", features = ["blocking"] }
sqlx = { version = "0.6", features = ["runtime-tokio-rustls"] }
serde_json = "*"
notify-rust = "*"
rfd = "*"
imghdr = "*"
home = "*"
once_cell = "*"
chrono = "0.4.23"
image = "*"
serde = {version = "1.0", features=["derive"]}
iced = { version = "0.10.0", features = ["image", "debug"] }
iced_style = "0.9.0"
iced_core = "0.10.0"
iced_native = "0.10.3"
itertools = "0.12.1"
reqwest = { version = "0.11.24", features = ["blocking"] }
sqlx = { version = "0.7.3", features = ["runtime-tokio-rustls"] }
serde_json = "1.0"
notify-rust = "4.10.0"
iced_widget = "0.1.3"
rfd = "0.13.0"
imghdr = "0.7.0"
home = "0.5.9"
once_cell = "1.19.0"
chrono = "0.4.33"
image = "0.24.8"
29 changes: 15 additions & 14 deletions src/render_image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ use rfd::FileDialog;

use iced::{
theme,
widget::{
button, container, horizontal_space, image, radio, row, text, text_input, Button, Column,
Container,
},
Element, Length, Renderer,
};
use iced_native::{column, image::Handle};
use iced_widget:: {
button, container, horizontal_space, image, radio, row, text, text_input, Button, Column,
Container,column
};
use iced_widget::image::Handle;
use iced_core::Alignment;
use serde::{Deserialize, Serialize};

use super::{get_all_images, Steps};
Expand Down Expand Up @@ -91,7 +92,7 @@ impl container::StyleSheet for ContainerCustomStyle {
container::Appearance {
text_color: Some(text_color),
background: bg,
border_radius: 2.0,
border_radius: 2.0.into(),
border_width: 2.0,
border_color: iced::Color::BLACK,
}
Expand Down Expand Up @@ -284,20 +285,20 @@ impl<'a> Step {
.iter()
.fold(
row![text("Choose a theme:")].spacing(10),
|column: iced_native::widget::row::Row<'_, ImageStepMessage, Renderer>, theme| {
column.push(radio(
|column: iced_native::widget::row::Row<'_, ImageStepMessage, Renderer>, theme: ThemeType| {
let element = radio(
format!("{:?}", theme),
*theme,
theme,
Some(match obj.theme {
iced::Theme::Dark => ThemeType::Dark,
iced::Theme::Light => ThemeType::Light,
iced::Theme::Custom { .. } => ThemeType::Custom,
}),
ImageStepMessage::ThemeChanged,
))
);
column.push(element);
},
);

let choose_theme_content = column![choose_theme]
.spacing(20)
.padding(20)
Expand All @@ -312,7 +313,7 @@ impl<'a> Step {
column![
container(row![choose_theme_content
.width(Length::Fill)
.align_items(iced::Alignment::Start)]),
.align_items(Alignment::Start)]),
container(row![file_choose_button])
]
} else {
Expand All @@ -322,7 +323,7 @@ impl<'a> Step {
column![
container(row![choose_theme_content
.width(Length::Fill)
.align_items(iced::Alignment::Start)]),
.align_items(Alignment::Start)]),
container(row![file_choose_button])
]
}
Expand Down Expand Up @@ -383,7 +384,7 @@ impl<'a> Step {
.iter()
.fold(
row![text("Choose a theme:")].spacing(10),
|column: iced_native::widget::row::Row<'_, ImageStepMessage, Renderer>, theme| {
|column: iced_native::widget::row::Row<'_, ImageStepMessage, Renderer>, theme: ThemeType| {
column.push(radio(
format!("{:?}", theme),
*theme,
Expand Down

0 comments on commit 440352f

Please sign in to comment.