Skip to content

Commit

Permalink
Merge pull request #51 from TicClick/update-deps
Browse files Browse the repository at this point in the history
  • Loading branch information
TicClick authored Jan 6, 2024
2 parents 10c8ac5 + 783c8c4 commit e0be0ec
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 73 deletions.
44 changes: 22 additions & 22 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "steel"
version = "0.6.14"
version = "0.7.1"
edition = "2021"
build = "src/build.rs"

Expand All @@ -10,37 +10,37 @@ winresource = "0.1"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
steel_core = { version = "0.1.1", path = "./crates/steel_core" }
steel_core = { version = "0.1.3", path = "./crates/steel_core" }
glass = { version = "*", path = "./crates/glass", optional = true}

# See also: https://github.com/emilk/egui/issues/2898
eframe = { git = "https://github.com/TicClick/egui.git", branch = "ffi" }
egui_extras = { git = "https://github.com/TicClick/egui.git", branch = "ffi" }
chrono = { version = "0.4.24", features = ["serde"] }
eframe = "0.24.1"
egui_extras = "0.24.2"

chrono = { version = "0.4.31", features = ["serde"] }
irc = "0.15.0"
irc-proto = "0.15.0"
futures = "0.3.28"
serde = "1.0.159"
serde_yaml = "0.9.19"
tokio = { version = "1.27.0", features = ["rt"] }
thiserror = "1.0.40"
futures = "0.3.30"
serde = "1.0.194"
serde_yaml = "0.9.30"
tokio = { version = "1.35.1", features = ["rt"] }
thiserror = "1.0.56"
simplelog = "0.12.1"
log = "0.4.17"
log = "0.4.20"
log-panics = { version = "2.1.0", features = ["with-backtrace"] }
time = { version = "0.3.20", features = ["macros"] }
percent-encoding = "2.2.0"
ureq = { version = "2.6.2", features = ["json", "native-tls"] }
flate2 = "1.0.25"
tar = "0.4.38"
zip = "0.6.4"
time = { version = "0.3.31", features = ["macros"] }
percent-encoding = "2.3.1"
ureq = { version = "2.9.1", features = ["json", "native-tls"] }
flate2 = "1.0.28"
tar = "0.4.40"
zip = "0.6.6"
md5 = "0.7.0"

# dependency of the alsa-sys crate: librust-alsa-sys-dev
rodio = "0.17.1"
png = "0.17.8"
rodio = "0.17.3"
png = "0.17.10"

libloading = "0.8.0"
winresource = "0.1.15"
libloading = "0.8.1"
winresource = "0.1.17"

[features]
default = []
Expand Down
2 changes: 1 addition & 1 deletion crates/glass
Submodule glass updated from 5a9d71 to 85392a
22 changes: 11 additions & 11 deletions crates/steel_core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
[package]
name = "steel_core"
version = "0.1.1"
version = "0.1.3"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
# See also: https://github.com/emilk/egui/issues/2898
ecolor = { git = "https://github.com/TicClick/egui.git", branch = "ffi" }
chrono = { version = "0.4.24", features = ["serde"] }
ecolor = "0.24.1"
chrono = { version = "0.4.31", features = ["serde"] }
irc-proto = "0.15.0"
serde = { version = "1.0.159", features = ["serde_derive"] }
serde_yaml = "0.9.19"
tokio = { version = "1.27.0", features = ["rt"] }
thiserror = "1.0.40"
serde = { version = "1.0.194", features = ["serde_derive"] }
serde_yaml = "0.9.30"
tokio = { version = "1.35.1", features = ["rt"] }
thiserror = "1.0.56"
simplelog = "0.12.1"
log = "0.4.17"
log = "0.4.20"
log-panics = { version = "2.1.0", features = ["with-backtrace"] }
time = { version = "0.3.20", features = ["macros"] }
percent-encoding = "2.2.0"
ureq = { version = "2.6.2", features = ["json", "native-tls"] }
time = { version = "0.3.31", features = ["macros"] }
percent-encoding = "2.3.1"
ureq = { version = "2.9.1", features = ["json", "native-tls"] }
9 changes: 6 additions & 3 deletions src/gui/about.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,12 @@ impl About {
state: &mut UIState,
) {
let texture = self.texture.get_or_insert_with(|| icon_as_texture(ctx));
let img = egui::Image::new(texture.id(), texture.size_vec2() / 2.0)
.sense(egui::Sense::click())
.rotate(self.rotation, egui::Vec2::splat(0.5));
let img = egui::Image::new(egui::ImageSource::Texture(egui::load::SizedTexture {
id: texture.id(),
size: texture.size_vec2() / 2.0,
}))
.sense(egui::Sense::click())
.rotate(self.rotation, egui::Vec2::splat(0.5));
let resp = ui.add(img);
if resp.clicked() || resp.secondary_clicked() {
state.sound_player.play(&Sound::BuiltIn(BuiltInSound::Tick));
Expand Down
2 changes: 1 addition & 1 deletion src/gui/chat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ impl WithInnerShadow for egui::Ui {
let central_frame_margin = 8.; // egui::Frame::central_panel().inner_margin
shadow_rect.set_left(shadow_rect.left() - central_frame_margin);
shadow_rect.set_width(
shadow_rect.width() + self.spacing().scroll_bar_inner_margin + central_frame_margin,
shadow_rect.width() + self.spacing().scroll.bar_inner_margin + central_frame_margin,
);
shadow_rect.set_bottom(shadow_rect.bottom() + self.spacing().item_spacing.y);

Expand Down
14 changes: 8 additions & 6 deletions src/gui/menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,12 @@ impl Menu {
);

if resp.clicked() {
frame.set_always_on_top(self.pin_window);
frame.set_decorations(!self.pin_window);
ctx.send_viewport_cmd(egui::ViewportCommand::WindowLevel(
egui::WindowLevel::AlwaysOnTop,
));
ctx.send_viewport_cmd(egui::ViewportCommand::Decorations(!self.pin_window));
} else if resp.is_pointer_button_down_on() {
frame.drag_window();
ctx.send_viewport_cmd(egui::ViewportCommand::StartDrag);
}
});
});
Expand All @@ -66,8 +68,8 @@ impl Menu {
fn show_application_menu(
&mut self,
ui: &mut egui::Ui,
_ctx: &egui::Context,
frame: &mut eframe::Frame,
ctx: &egui::Context,
_frame: &mut eframe::Frame,
_state: &mut UIState,
) {
ui.menu_button("application", |ui| {
Expand All @@ -83,7 +85,7 @@ impl Menu {
ui.close_menu();
}
if ui.button("exit").clicked() {
frame.close();
ctx.send_viewport_cmd(egui::ViewportCommand::Close);
ui.close_menu();
}
});
Expand Down
13 changes: 5 additions & 8 deletions src/gui/state/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,7 @@ impl UIState {
}
}

pub fn push_chat_message(
&mut self,
target: String,
mut message: Message,
frame: &mut eframe::Frame,
) {
pub fn push_chat_message(&mut self, target: String, mut message: Message, ctx: &egui::Context) {
let normalized = target.to_lowercase();
let tab_inactive = !self.is_active_tab(&normalized);
if let Some(pos) = self.name_to_chat.get(&normalized) {
Expand Down Expand Up @@ -186,8 +181,10 @@ impl UIState {
}
}

if !frame.info().window_info.focused && requires_attention {
frame.request_user_attention(eframe::egui::UserAttentionType::Critical);
if !ctx.input(|i| i.viewport().focused.unwrap_or(false)) && requires_attention {
ctx.send_viewport_cmd(egui::ViewportCommand::RequestUserAttention(
eframe::egui::UserAttentionType::Critical,
));
if let Some(sound) = &self.settings.notifications.highlights.sound {
self.sound_player.play(sound);
}
Expand Down
11 changes: 5 additions & 6 deletions src/gui/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ impl ApplicationWindow {
}
}

pub fn process_pending_events(&mut self, ctx: &egui::Context, frame: &mut eframe::Frame) {
pub fn process_pending_events(&mut self, ctx: &egui::Context) {
if self.date_announcer.should_announce() {
let text = format!(
"A new day is born ({})",
Expand Down Expand Up @@ -234,7 +234,7 @@ impl ApplicationWindow {

UIMessageIn::NewMessageReceived { target, message } => {
self.s
.push_chat_message(target.clone(), message.clone(), frame);
.push_chat_message(target.clone(), message.clone(), ctx);

#[cfg(feature = "glass")]
match message.username == self.s.settings.chat.irc.username {
Expand Down Expand Up @@ -279,7 +279,7 @@ const MIN_IDLE_FRAME_TIME: std::time::Duration = std::time::Duration::from_milli
impl eframe::App for ApplicationWindow {
fn update(&mut self, ctx: &egui::Context, frame: &mut eframe::Frame) {
ctx.request_repaint_after(MIN_IDLE_FRAME_TIME);
self.process_pending_events(ctx, frame);
self.process_pending_events(ctx);

if !self.s.active_chat_tab_name.is_empty() {
let title = match self.s.active_chat_tab_name.starts_with('$') {
Expand All @@ -290,7 +290,7 @@ impl eframe::App for ApplicationWindow {
crate::VERSION
),
};
frame.set_window_title(&title);
ctx.send_viewport_cmd(egui::ViewportCommand::Title(title));
}

self.set_theme(ctx);
Expand All @@ -313,8 +313,7 @@ impl eframe::App for ApplicationWindow {
}
}

fn on_close_event(&mut self) -> bool {
fn on_exit(&mut self, _gl: Option<&eframe::glow::Context>) {
self.s.core.exit_requested();
true
}
}
19 changes: 4 additions & 15 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,6 @@ fn setup_logging() {
log_panics::init();
}

fn read_icon() -> Option<eframe::IconData> {
match crate::gui::png_to_rgba(include_bytes!("../media/icons/taskbar.png")) {
Ok((data, (width, height))) => Some(eframe::IconData {
rgba: data,
width,
height,
}),
Err(e) => {
log::error!("failed to read the app taskbar icon: {:?}", e);
None
}
}
}

fn main() {
if let Err(e) = crate::core::os::fix_cwd() {
panic!("Failed to set proper current working directory: {:?}", e);
Expand All @@ -65,7 +51,10 @@ fn main() {
});

let native_options = eframe::NativeOptions {
icon_data: read_icon(),
viewport: eframe::egui::ViewportBuilder::default().with_icon(std::sync::Arc::new(
eframe::icon_data::from_png_bytes(&include_bytes!("../media/icons/taskbar.png")[..])
.unwrap(),
)),
..Default::default()
};
eframe::run_native(
Expand Down

0 comments on commit e0be0ec

Please sign in to comment.