Skip to content

Commit

Permalink
chore: update deps and fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SilenLoc committed Oct 4, 2023
1 parent b5d7419 commit 2f589d2
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 22 deletions.
15 changes: 8 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,22 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
egui = "0.22"
eframe = { version = "0.22.0", default-features = true, features = [
egui = "0.23"
egui_plot = "0.23.0"
eframe = { version = "0.23.0", default-features = true, features = [
"default_fonts", # Embed the default egui fonts.
"glow", # Use the glow rendering backend. Alternative: "wgpu".
"persistence", # Enable restoring app state when restarting the app.
] }
tracing-subscriber = "0.3"
serde = { version = "1", features = ["derive"] }
rand = "0.8.5"
random_word = "0.3.1"
catppuccin-egui = "3.1.0"
egui_extras ="0.22.0"
random_word = { version = "0.4", features = ["en"] }
catppuccin-egui = { git = "https://github.com/catppuccin/egui.git" }
egui_extras ="0.23.0"
egui-notify = { git = "https://github.com/ItsEthra/egui-notify.git" }
egui_dock = "0.6.3"
log = "0.4.19"
egui_dock = "0.8"
log = "0.4.20"
getrandom = { version = "0.2", features = ["js"] }
web-time = "0.2.0"

Expand Down
11 changes: 5 additions & 6 deletions src/app/tabs.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use egui_dock::Style;
use egui_dock::{NodeIndex, Tree};
use egui_dock::NodeIndex;
use egui_dock::{DockState, Style};

use super::Module;
use super::Services;
Expand All @@ -8,7 +8,7 @@ use crate::current;
use crate::{scoring::Score, settings::TFSetting, typewriter::TypeState};

pub struct Tabs {
pub tree: Tree<Module>,
pub tree: DockState<Module>,
}

impl Default for Tabs {
Expand All @@ -19,8 +19,8 @@ impl Default for Tabs {

impl Tabs {
pub fn new() -> Self {
let mut tree = Tree::new(vec![Module::Typing("Typing".to_string())]);
tree.split_below(
let mut tree = DockState::new(vec![Module::Typing("Typing".to_string())]);
tree.main_surface_mut().split_below(
NodeIndex::root(),
0.70,
vec![
Expand Down Expand Up @@ -54,7 +54,6 @@ impl egui_dock::TabViewer for TabView {

fn ui(&mut self, ui: &mut egui::Ui, tab: &mut Self::Tab) {
self.settings.set_new_theme(ui.ctx());
self.services.notifier.show(ui.ctx());
match tab {
Module::Typing(_) => self
.type_state
Expand Down
2 changes: 2 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ fn main() -> eframe::Result<()> {
default_theme: eframe::Theme::Dark,
run_and_return: Default::default(),
event_loop_builder: Default::default(),
window_builder: Default::default(),
shader_version: Default::default(),
centered: true,
persist_window: false,
};
eframe::run_native(
"TypeFast",
Expand Down
4 changes: 3 additions & 1 deletion src/random/words.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
use random_word::Lang;

pub fn random_english_words(max: u32) -> String {
let mut random_words = String::new();
for _i in 0..max {
random_words.push_str(random_word::gen());
random_words.push_str(random_word::gen(Lang::En));
random_words.push_str(&' '.to_string());
}

Expand Down
8 changes: 3 additions & 5 deletions src/scoring/wpm.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
use std::ops::Div;

use egui::{
plot::{Line, Plot, PlotPoints},
Ui,
};
use egui::Ui;
use egui_plot::{Line, PlotPoints};
use web_time::{Duration, Instant};

#[derive(serde::Deserialize, serde::Serialize)]
Expand Down Expand Up @@ -55,7 +53,7 @@ impl WordsPerDuration {

let line = Line::new(score_points);
ui.group(|ui| {
let plot = Plot::new(title)
let plot = egui_plot::Plot::new(title)
.auto_bounds_x()
.auto_bounds_y()
.width(400.0)
Expand Down
4 changes: 1 addition & 3 deletions src/settings/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ mod command_helper_render;
mod command_processer;
mod theme_chooser;

use egui::Context;

use crate::{
app::Services,
random::{Algorithm, ALGS},
Expand Down Expand Up @@ -80,7 +78,7 @@ impl TFSetting {
old
}

pub fn set_new_theme(&mut self, ctx: &Context) {
pub fn set_new_theme(&mut self, ctx: &egui::Context) {
if self.last_theme != self.theme {
catppuccin_egui::set_theme(ctx, self.theme.to_cat_theme());
self.last_theme = self.theme
Expand Down

0 comments on commit 2f589d2

Please sign in to comment.