Skip to content

Commit

Permalink
Update iced to 0.13 and other deps too
Browse files Browse the repository at this point in the history
I spent a long time trying to convert the custom theme we were
using to 0.13, but it turns out this isn't even needed anymore,
we can just create a custom iced theme palette and use styling
functions on the widgets when needed.
  • Loading branch information
brianch committed Jan 9, 2025
1 parent cb9e896 commit 873b9ca
Show file tree
Hide file tree
Showing 10 changed files with 759 additions and 974 deletions.
42 changes: 21 additions & 21 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,31 @@ edition = "2021"
[dependencies]
#iced = {version = "0.10.0", features = ["svg", "tokio", "lazy"] }
#iced_aw = {version = "0.7.0", default-features = false, features = ["tabs"] }
iced = { version = "0.12.1", default-features = false, features = ["svg", "tokio", "lazy", "advanced"] }
iced_aw = { version = "0.8.0", default-features = false, features = ["tabs"] }
iced_drop = {git = "https://github.com/brianch/iced_drop.git"}
iced = { version = "0.13.1", default-features = false, features = ["svg", "tokio", "lazy", "advanced"] }
iced_aw = { version = "0.11.0", default-features = false, features = ["tabs"] }
iced_drop = {git = "https://github.com/jhannyj/iced_drop.git", rev="d259ec4dff098852d995d3bcaa5551a88330636f"}

rand = "0.8.5"
chess = "3.2.0"
csv = "1.3.0"
serde = "1.0.196"
serde_derive = "1.0.160"
serde_json = "1.0.113"
tokio = { version = "1.36.0", features = ["process", "io-std", "io-util", "sync"] }
reqwest = "0.12.4"
zstd = "0.13.1"
rodio = { version = "0.17.3", default-features = false, features = ["vorbis"] }
fluent-bundle = "0.15.2"
intl-memoizer = "0.5.1"
once_cell = "1.19.0"
unic-langid = { version = "0.9.4", features = ["macros"] }
diesel = { version = "2.1.4", features = ["sqlite"] }
csv = "1.3.1"
serde = "1.0.217"
serde_derive = "1.0.217"
serde_json = "1.0.135"
tokio = { version = "1.43.0", features = ["process", "io-std", "io-util", "sync"] }
reqwest = "0.12.12"
zstd = "0.13.2"
rodio = { version = "0.20.1", default-features = false, features = ["vorbis"] }
fluent-bundle = "0.15.3"
intl-memoizer = "0.5.2"
once_cell = "1.20.2"
unic-langid = { version = "0.9.5", features = ["macros"] }
diesel = { version = "2.2.6", features = ["sqlite"] }
dotenvy = "0.15.7"
lopdf = "0.32.0"
open = "5.0.1"
lopdf = "0.34.0"
open = "5.3.2"
#rfd = { version = "0.13.0", default-features = false, features = ["xdg-portal", "tokio"] }
rfd = "0.13.0"
image = { version = "0.24.8", default-features = false, features = ["jpeg"] }
rfd = "0.15.2"
image = { version = "0.25.5", default-features = false, features = ["jpeg"] }

[target.'cfg(windows)'.dependencies]
libsqlite3-sys = { version = "0.27.0", features = ["bundled"] }
libsqlite3-sys = { version = "0.30.1", features = ["bundled"] }
6 changes: 3 additions & 3 deletions settings.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"engine_path": null,
"engine_limit": "depth 40",
"window_width": 1010,
"window_height": 680,
"window_width": 1010.0,
"window_height": 680.0,
"maximized": false,
"puzzle_db_location": "puzzles/lichess_db_puzzle.csv",
"piece_theme": "Cburnett",
Expand All @@ -24,4 +24,4 @@
"family": "Any"
},
"last_opening_side": "Any"
}
}
12 changes: 6 additions & 6 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ pub enum GameMode {
pub struct OfflinePuzzlesConfig {
pub engine_path: Option<String>,
pub engine_limit: String,
pub window_width: u32,
pub window_height: u32,
pub window_width: f32,
pub window_height: f32,
pub maximized: bool,
pub puzzle_db_location: String,
pub piece_theme: styles::PieceTheme,
Expand All @@ -33,7 +33,7 @@ pub struct OfflinePuzzlesConfig {
pub auto_load_next: bool,
pub flip_board: bool,
pub show_coordinates: bool,
pub board_theme: styles::Theme,
pub board_theme: styles::BoardTheme,
pub lang: lang::Language,
pub export_pgs: i32,
pub last_min_rating: i32,
Expand All @@ -50,8 +50,8 @@ impl ::std::default::Default for OfflinePuzzlesConfig {
Self {
engine_path: None,
engine_limit: String::from("depth 40"),
window_width: 1010,
window_height: 680,
window_width: 1010.,
window_height: 680.,
maximized: false,
puzzle_db_location: String::from("puzzles/lichess_db_puzzle.csv"),
piece_theme: styles::PieceTheme::Cburnett,
Expand All @@ -60,7 +60,7 @@ impl ::std::default::Default for OfflinePuzzlesConfig {
auto_load_next: true,
flip_board: false,
show_coordinates: false,
board_theme: styles::Theme::default(),
board_theme: styles::BoardTheme::default(),
lang: lang::Language::English,
export_pgs: 50,
last_min_rating: 0,
Expand Down
15 changes: 9 additions & 6 deletions src/download_db.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use iced::futures::SinkExt;
use iced::{Subscription, subscription};
use iced::futures::Stream;
use iced::stream;
use iced::futures::sink::SinkExt;
use iced::Subscription;
use std::fs::File;
use std::io::{Seek, Write};
use std::io::Cursor;
Expand All @@ -25,11 +27,12 @@ pub enum DownloadState {
}

pub fn download_lichess_db(url: String, path: String) -> Subscription<Message> {
struct DownloadDb;
Subscription::run_with_id(std::any::TypeId::of::<DownloadState>(), download_stream(url, path))
}

fn download_stream(url: String, path: String) -> impl Stream<Item = Message> {

subscription::channel(
std::any::TypeId::of::<DownloadDb>(),
100,
stream::channel(100,
|mut output| async move {
let mut state = DownloadState::StartDownload{ url , path: path.clone()};
loop {
Expand Down
Loading

0 comments on commit 873b9ca

Please sign in to comment.