Skip to content

Commit

Permalink
chore: update all dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
0x192 committed Jan 5, 2024
1 parent 11f27c6 commit ccbdd35
Show file tree
Hide file tree
Showing 8 changed files with 1,530 additions and 1,216 deletions.
2,493 changes: 1,372 additions & 1,121 deletions Cargo.lock

Large diffs are not rendered by default.

11 changes: 4 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,19 @@ categories = ["gui"]
edition = "2021"

[features]
default = ["wgpu", "self-update"]
wgpu = [] # Iced/wgpu is default
glow = ["iced/glow"] # OpenGL support
default = ["self-update"]
self-update = ["flate2", "tar"]
no-self-update = []

[dependencies]
iced = { git = "https://github.com/iced-rs/iced.git" }
iced_native = { git = "https://github.com/iced-rs/iced.git" }
iced = { git = "https://github.com/iced-rs/iced.git", features = ["advanced"] }
serde = { version = "^1.0", features = ["derive"] }
serde_json = "^1.0"
static_init = "^1.0"
fern = { version = "^0", features = ["colored"] }
fern = { version = "^0", features = ["colored"] } # TO CHANGE // no longer maintained
chrono = { version = "^0.4", default-features = false, features = ["std", "clock"] }
log = "^0.4"
regex = "^1.5"
regex = "^1.0"
toml = "^0"
dirs = "^5.0.0"
ureq = { version = "*", features = ["json"] }
Expand Down
Binary file modified resources/assets/icons.ttf
Binary file not shown.
15 changes: 12 additions & 3 deletions src/gui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@ use views::list::{List as AppsView, LoadingState as ListLoadingState, Message as
use views::settings::{Message as SettingsMessage, Settings as SettingsView};
use widgets::navigation_menu::nav_menu;

use iced::font;
use iced::widget::column;
use iced::{
window::Settings as Window, Alignment, Application, Command, Element, Length, Renderer,
Settings,
Settings, Font,
};
use std::{env, path::PathBuf};

pub const ICON_FONT: Font = Font::with_name("icons");

#[cfg(feature = "self-update")]
use crate::core::update::{bin_name, download_update_to_temp_file, remove_file};

Expand Down Expand Up @@ -65,6 +68,7 @@ pub enum Message {
_NewReleaseDownloaded(Result<(PathBuf, PathBuf), ()>),
GetLatestRelease(Result<Option<Release>, ()>),
Nothing,
FontLoaded(Result<(), font::Error>),
}

impl Application for UadGui {
Expand All @@ -77,6 +81,7 @@ impl Application for UadGui {
(
Self::default(),
Command::batch([
font::load(include_bytes!("../../resources/assets/icons.ttf").as_slice()).map(Message::FontLoaded),
Command::perform(get_devices_list(), Message::LoadDevices),
Command::perform(
async move { get_latest_release() },
Expand Down Expand Up @@ -317,6 +322,7 @@ impl Application for UadGui {
Command::none()
}
Message::Nothing => Command::none(),
Message::FontLoaded(_) => Command::none(),
}
}

Expand Down Expand Up @@ -355,12 +361,15 @@ impl UadGui {
pub fn start() -> iced::Result {
Self::run(Settings {
window: Window {
size: (1050, 800),
size: {
iced::Size {
width: 1050.0, height: 800.0}
},
resizable: true,
decorations: true,
..iced::window::Settings::default()
},
default_text_size: 17.0,
default_text_size: iced::Pixels(17.0),
..Settings::default()
})
}
Expand Down
54 changes: 35 additions & 19 deletions src/gui/style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,28 +41,28 @@ impl container::StyleSheet for Theme {
Container::Frame => container::Appearance {
background: Some(Background::Color(self.palette().base.foreground)),
text_color: Some(self.palette().bright.surface),
border_radius: 5.0,
border_radius: 5.0.into(),
..container::Appearance::default()
},
Container::BorderedFrame => container::Appearance {
background: Some(Background::Color(self.palette().base.foreground)),
text_color: Some(self.palette().bright.surface),
border_radius: 5.0,
border_radius: 5.0.into(),
border_width: 1.0,
border_color: self.palette().normal.error,
},
Container::Tooltip => container::Appearance {
background: Some(Background::Color(self.palette().base.foreground)),
text_color: Some(self.palette().bright.surface),
border_radius: 8.0,
border_radius: 8.0.into(),
border_width: 1.0,
border_color: self.palette().normal.primary,
},

Container::Background => container::Appearance {
background: Some(Background::Color(self.palette().base.background)),
text_color: Some(self.palette().bright.surface),
border_radius: 5.0,
border_radius: 5.0.into(),
..container::Appearance::default()
},
}
Expand Down Expand Up @@ -90,7 +90,7 @@ impl button::StyleSheet for Theme {

let appearance = button::Appearance {
border_width: 1.0,
border_radius: 2.0,
border_radius: 2.0.into(),
..button::Appearance::default()
};

Expand All @@ -109,7 +109,7 @@ impl button::StyleSheet for Theme {
Button::NormalPackage => button::Appearance {
background: Some(Background::Color(p.base.foreground)),
text_color: p.bright.surface,
border_radius: 5.0,
border_radius: 5.0.into(),
border_width: 0.0,
border_color: p.base.background,
..appearance
Expand All @@ -120,7 +120,7 @@ impl button::StyleSheet for Theme {
..p.normal.primary
})),
text_color: p.bright.primary,
border_radius: 5.0,
border_radius: 5.0.into(),
border_width: 0.0,
border_color: p.normal.primary,
..appearance
Expand Down Expand Up @@ -193,12 +193,12 @@ impl scrollable::StyleSheet for Theme {
fn active(&self, style: &Self::Style) -> scrollable::Scrollbar {
let from_appearance = |c: Color| scrollable::Scrollbar {
background: Some(Background::Color(Color::TRANSPARENT)),
border_radius: 5.0,
border_radius: 5.0.into(),
border_width: 0.0,
border_color: Color::TRANSPARENT,
scroller: scrollable::Scroller {
color: c,
border_radius: 5.0,
border_radius: 5.0.into(),
border_width: 1.0,
border_color: Color::TRANSPARENT,
},
Expand Down Expand Up @@ -243,7 +243,7 @@ impl checkbox::StyleSheet for Theme {
CheckBox::PackageEnabled => checkbox::Appearance {
background: Background::Color(self.palette().base.background),
icon_color: self.palette().bright.primary,
border_radius: 5.0,
border_radius: 5.0.into(),
border_width: 1.0,
border_color: self.palette().base.background,
text_color: Some(self.palette().bright.surface),
Expand All @@ -254,23 +254,23 @@ impl checkbox::StyleSheet for Theme {
..self.palette().base.background
}),
icon_color: self.palette().bright.primary,
border_radius: 5.0,
border_radius: 5.0.into(),
border_width: 1.0,
border_color: self.palette().normal.primary,
text_color: Some(self.palette().normal.primary),
},
CheckBox::SettingsEnabled => checkbox::Appearance {
background: Background::Color(self.palette().base.background),
icon_color: self.palette().bright.primary,
border_radius: 5.0,
border_radius: 5.0.into(),
border_width: 1.0,
border_color: self.palette().bright.primary,
text_color: Some(self.palette().bright.surface),
},
CheckBox::SettingsDisabled => checkbox::Appearance {
background: Background::Color(self.palette().base.foreground),
icon_color: self.palette().bright.primary,
border_radius: 5.0,
border_radius: 5.0.into(),
border_width: 1.0,
border_color: self.palette().normal.primary,
text_color: Some(self.palette().bright.surface),
Expand All @@ -282,7 +282,7 @@ impl checkbox::StyleSheet for Theme {
let from_appearance = || checkbox::Appearance {
background: Background::Color(self.palette().base.foreground),
icon_color: self.palette().bright.primary,
border_radius: 5.0,
border_radius: 5.0.into(),
border_width: 2.0,
border_color: self.palette().bright.primary,
text_color: Some(self.palette().bright.surface),
Expand All @@ -309,28 +309,44 @@ impl text_input::StyleSheet for Theme {
fn active(&self, _style: &Self::Style) -> text_input::Appearance {
text_input::Appearance {
background: Background::Color(self.palette().base.foreground),
border_radius: 5.0,
border_radius: 5.0.into(),
border_width: 0.0,
border_color: self.palette().base.foreground,
icon_color: self.palette().bright.surface
}
}

fn focused(&self, _style: &Self::Style) -> text_input::Appearance {
text_input::Appearance {
background: Background::Color(self.palette().base.foreground),
border_radius: 2.0,
border_radius: 2.0.into(),
border_width: 1.0,
border_color: Color {
a: 0.5,
..self.palette().normal.primary
},
icon_color:self.palette().bright.surface
}
}

fn disabled(&self, _style: &Self::Style) -> text_input::Appearance {
text_input::Appearance {
background: Background::Color(self.palette().base.foreground),
border_radius: 2.0.into(),
border_width: 1.0,
border_color: self.palette().normal.primary,
icon_color: self.palette().bright.surface
}
}

fn placeholder_color(&self, _style: &Self::Style) -> Color {
self.palette().normal.surface
}

fn disabled_color(&self, style: &Self::Style) -> Color {
self.placeholder_color(style)
}

fn value_color(&self, _style: &Self::Style) -> Color {
self.palette().bright.primary
}
Expand Down Expand Up @@ -361,7 +377,7 @@ impl menu::StyleSheet for Theme {
text_color: p.bright.surface,
background: p.base.background.into(),
border_width: 1.0,
border_radius: 2.0,
border_radius: 2.0.into(),
border_color: p.base.background,
selected_text_color: p.bright.surface,
selected_background: p.normal.primary.into(),
Expand All @@ -381,7 +397,7 @@ impl pick_list::StyleSheet for Theme {
a: 0.5,
..self.palette().normal.primary
},
border_radius: 2.0,
border_radius: 2.0.into(),
handle_color: self.palette().bright.surface,
placeholder_color: self.palette().bright.surface,
}
Expand Down Expand Up @@ -471,7 +487,7 @@ impl rule::StyleSheet for Theme {
Rule::Default => rule::Appearance {
color: self.palette().bright.surface,
width: 2,
radius: 2.0,
radius: 2.0.into(),
fill_mode: rule::FillMode::Full,
},
}
Expand Down
21 changes: 9 additions & 12 deletions src/gui/views/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::core::uad_lists::{
};
use crate::core::utils::fetch_packages;
use crate::gui::style;
use crate::gui::widgets::navigation_menu::ICONS;
use crate::gui::ICON_FONT;
use std::collections::HashMap;
use std::env;

Expand Down Expand Up @@ -311,8 +311,8 @@ impl List {
let search_packages = text_input(
"Search packages...",
&self.input_value,
Message::SearchInputChanged,
)
.on_input(Message::SearchInputChanged)
.padding(5);

let user_picklist = pick_list(
Expand Down Expand Up @@ -515,7 +515,7 @@ impl List {
.style(style::Text::Danger),
tooltip(
text("\u{EA0C}")
.font(ICONS)
.font(ICON_FONT)
.width(17)
.horizontal_alignment(alignment::Horizontal::Center)
.style(style::Text::Commentary)
Expand Down Expand Up @@ -574,18 +574,16 @@ impl List {
row![text(
self.phone_packages[selection.0][selection.1]
.removal
)]
.width(100),
)],
row![text(
self.phone_packages[selection.0][selection.1]
.uad_list
)]
.width(60),
)],
row![text(
self.phone_packages[selection.0][selection.1]
.name
.clone()
),],
)],
horizontal_space(Length::Fill),
row![match self.phone_packages[selection.0]
[selection.1]
Expand All @@ -605,8 +603,7 @@ impl List {
text("Restore").style(style::Text::Ok),
PackageState::All => text("Impossible")
.style(style::Text::Danger),
},]
.width(60),
},],
]
.width(Length::Fill)
.spacing(20),
Expand All @@ -615,7 +612,7 @@ impl List {
)
},
)
.padding(10)
.padding([10, 20, 10, 10])
.width(Length::Fill),
)
.style(style::Scrollable::Description),
Expand Down Expand Up @@ -805,7 +802,7 @@ fn recap<'a>(
) -> Element<'a, Message, Renderer<Theme>> {
container(
row![
text(removal).size(25).width(Length::FillPortion(1)),
text(removal).width(Length::FillPortion(1)),
vertical_rule(5),
row![
if settings.device.disable_mode {
Expand Down
Loading

0 comments on commit ccbdd35

Please sign in to comment.