URI: 
       Updated egui to 0.25 - icy_draw - icy_draw is the successor to mystic draw. fork / mirror
  HTML git clone https://git.drkhsh.at/icy_draw.git
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
   DIR commit 7a82a8b2ff8a39399d15d9c2c1972b522cdab54c
   DIR parent 380899692bb8c556d18b131b562a67324402a509
  HTML Author: Mike Krüger <mkrueger@posteo.de>
       Date:   Sun, 14 Jan 2024 19:39:34 +0100
       
       Updated egui to 0.25
       
       Diffstat:
         M Cargo.toml                          |      18 +++++++++---------
         M src/ui/commands.rs                  |       2 +-
         M src/ui/dialogs/font_manager.rs      |      16 ++++++++--------
         M src/ui/dialogs/font_selector.rs     |       8 ++++----
         M src/ui/dialogs/new_file_dialog.rs   |       8 ++++----
         M src/ui/dialogs/select_palette_dial… |       8 ++++----
         M src/ui/dialogs/select_tdf_font_dia… |      10 +++++-----
         M src/ui/dialogs/settings_dialog.rs   |       4 ++--
         M src/ui/editor/animation/encoding.rs |       3 +--
         M src/ui/editor/animation/highlighti… |       8 ++++----
         M src/ui/editor/animation/mod.rs      |       5 ++---
         M src/ui/editor/ansi/mod.rs           |       3 +--
         M src/ui/editor/bitfont/mod.rs        |       4 ++--
         M src/ui/editor/charfont/mod.rs       |       4 ++--
         M src/ui/main_window.rs               |       3 +--
         M src/ui/tools/layer_view.rs          |       6 +++---
         M src/ui/tools/minimap_view.rs        |       4 ++--
       
       17 files changed, 55 insertions(+), 59 deletions(-)
       ---
   DIR diff --git a/Cargo.toml b/Cargo.toml
       @@ -10,17 +10,17 @@ repository = "https://github.com/mkrueger/icy_draw"
        # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
        
        [dependencies]
       -eframe = "0.24.1"
       -egui = { version = "0.24.1" }
       -egui_extras = { version="0.24.1", features = ["all_loaders"] }
       -egui_glow = "0.24.1"
       +eframe = "0.25.0"
       +egui = { version = "0.25.0" }
       +egui_extras = { version="0.25.0", features = ["all_loaders"] }
       +egui_glow = "0.25.0"
        egui-modal = "0.3.0"
       -glow = "0.12.3"
       -egui_file = "0.12.0"
       +glow = "0.13.0"
       +egui_file = "0.14.0"
        egui_tiles = { git ="https://github.com/mkrueger/egui_tiles"}
        #egui_tiles = { path = "../egui_tiles"  }
       -egui-bind = "=0.9.0"
       -egui-notify = "0.11.0"
       +egui-bind = "0.10.0"
       +egui-notify = "0.12.0"
        log = "0.4.20"
        log4rs = "1.2.0"
        open = "5.0.0"
       @@ -42,7 +42,7 @@ view_library = { git ="https://github.com/mkrueger/icy_view" }
        #icy_engine_egui = { path = "../icy_engine_egui" }
        #view_library = { path = "../icy_view/view_library" }
        
       -egui_code_editor = "0.1.8"
       +egui_code_editor = "0.2.2"
        mlua = { version = "0.9.1", features = ["lua54", "vendored"] }
        regex = "1.9.5"
        
   DIR diff --git a/src/ui/commands.rs b/src/ui/commands.rs
       @@ -533,7 +533,7 @@ keys![
            (toggle_color, "menu-toggle_color", ToggleColor, BufferOpenState, X, ALT),
            (fullscreen, "menu-toggle_fullscreen", ToggleFullScreen, AlwaysEnabledState, Enter, ALT),
            (zoom_reset, "menu-zoom_reset", ZoomReset, BufferOpenState, Backspace, CTRL),
       -    (zoom_in, "menu-zoom_in", ZoomIn, BufferOpenState, PlusEquals, CTRL),
       +    (zoom_in, "menu-zoom_in", ZoomIn, BufferOpenState, Plus, CTRL),
            (zoom_out, "menu-zoom_out", ZoomOut, BufferOpenState, Minus, CTRL),
            (open_tdf_directory, "menu-open_tdf_directoy", OpenTdfDirectory, AlwaysEnabledState),
            (open_font_selector, "menu-open_font_selector", OpenFontSelector, BufferOpenState),
   DIR diff --git a/src/ui/dialogs/font_manager.rs b/src/ui/dialogs/font_manager.rs
       @@ -73,9 +73,9 @@ impl crate::ModalDialog for FontManager {
                                    } else {
                                        ui.style().visuals.text_color()
                                    };
       -                            ui.painter().galley_with_color(
       +                            ui.painter().galley_with_override_text_color(
                                        egui::Align2::LEFT_TOP.align_size_within_rect(galley.size(), title_rect.shrink(4.0)).min,
       -                                galley.galley,
       +                                galley,
                                        text_color,
                                    );
        
       @@ -84,9 +84,9 @@ impl crate::ModalDialog for FontManager {
                                    let galley = text.into_galley(ui, Some(false), f32::INFINITY, font_id);
                                    let mut title_rect = rect;
                                    title_rect.set_left(title_rect.left() + 4.0 + size.x + 4.0);
       -                            ui.painter().galley_with_color(
       +                            ui.painter().galley_with_override_text_color(
                                        egui::Align2::LEFT_TOP.align_size_within_rect(galley.size(), title_rect.shrink(4.0)).min,
       -                                galley.galley,
       +                                galley,
                                        text_color,
                                    );
        
       @@ -95,9 +95,9 @@ impl crate::ModalDialog for FontManager {
                                    let galley = text.into_galley(ui, Some(false), f32::INFINITY, font_id);
                                    let mut title_rect = rect;
                                    title_rect.set_left(title_rect.left() + 399.0);
       -                            ui.painter().galley_with_color(
       +                            ui.painter().galley_with_override_text_color(
                                        egui::Align2::LEFT_TOP.align_size_within_rect(galley.size(), title_rect.shrink(4.0)).min,
       -                                galley.galley,
       +                                galley,
                                        text_color,
                                    );
        
       @@ -111,9 +111,9 @@ impl crate::ModalDialog for FontManager {
                                    let galley = text.into_galley(ui, Some(false), f32::INFINITY, font_id);
                                    let mut title_rect = rect;
                                    title_rect.set_left(title_rect.left() + 480.0);
       -                            ui.painter().galley_with_color(
       +                            ui.painter().galley_with_override_text_color(
                                        egui::Align2::LEFT_TOP.align_size_within_rect(galley.size(), title_rect.shrink(4.0)).min,
       -                                galley.galley,
       +                                galley,
                                        text_color,
                                    );
        
   DIR diff --git a/src/ui/dialogs/font_selector.rs b/src/ui/dialogs/font_selector.rs
       @@ -334,9 +334,9 @@ impl FontSelector {
                let font_id = FontId::new(14.0, FontFamily::Proportional);
                let text: WidgetText = font.0.name.clone().into();
                let galley = text.into_galley(ui, Some(false), f32::INFINITY, font_id);
       -        ui.painter().galley_with_color(
       +        ui.painter().galley_with_override_text_color(
                    egui::Align2::LEFT_TOP.align_size_within_rect(galley.size(), rect.shrink(4.0)).min,
       -            galley.galley,
       +            galley,
                    text_color,
                );
        
       @@ -401,9 +401,9 @@ fn print_source(font_type: String, ui: &egui::Ui, rect: Rect, text_color: Color3
        
            ui.painter().rect_stroke(rect.expand(2.0), 4.0, Stroke::new(1.0, text_color));
        
       -    ui.painter().galley_with_color(
       +    ui.painter().galley_with_override_text_color(
                egui::Align2::CENTER_CENTER.align_size_within_rect(galley_size, rect).min,
       -        galley.galley,
       +        galley,
                text_color,
            );
            left_side
   DIR diff --git a/src/ui/dialogs/new_file_dialog.rs b/src/ui/dialogs/new_file_dialog.rs
       @@ -509,9 +509,9 @@ impl crate::ModalDialog for NewFileDialog {
                                        let mut title_rect = rect;
                                        title_rect.set_left(title_rect.left() + 40.0);
                                        title_rect.set_top(title_rect.top() + 4.0);
       -                                ui.painter().galley_with_color(
       +                                ui.painter().galley_with_override_text_color(
                                            egui::Align2::LEFT_TOP.align_size_within_rect(galley.size(), title_rect.shrink(4.0)).min,
       -                                    galley.galley,
       +                                    galley,
                                            ui.style().visuals.strong_text_color(),
                                        );
        
       @@ -520,9 +520,9 @@ impl crate::ModalDialog for NewFileDialog {
                                        let galley = text.into_galley(ui, Some(false), f32::INFINITY, font_id);
                                        let mut descr_rect = rect;
                                        descr_rect.set_top(descr_rect.top() + 34.0);
       -                                ui.painter().galley_with_color(
       +                                ui.painter().galley_with_override_text_color(
                                            egui::Align2::LEFT_TOP.align_size_within_rect(galley.size(), descr_rect.shrink(4.0)).min,
       -                                    galley.galley,
       +                                    galley,
                                            ui.style().visuals.text_color(),
                                        );
        
   DIR diff --git a/src/ui/dialogs/select_palette_dialog.rs b/src/ui/dialogs/select_palette_dialog.rs
       @@ -194,9 +194,9 @@ impl SelectPaletteDialog {
                let font_id = FontId::new(14.0, FontFamily::Proportional);
                let text: WidgetText = palette.0.title.clone().into();
                let galley = text.into_galley(ui, Some(false), f32::INFINITY, font_id);
       -        ui.painter().galley_with_color(
       +        ui.painter().galley_with_override_text_color(
                    egui::Align2::LEFT_TOP.align_size_within_rect(galley.size(), rect.shrink(4.0)).min,
       -            galley.galley,
       +            galley,
                    text_color,
                );
        
       @@ -247,9 +247,9 @@ impl SelectPaletteDialog {
        
                ui.painter().rect_stroke(rect.expand(2.0), 4.0, Stroke::new(1.0, text_color));
        
       -        ui.painter().galley_with_color(
       +        ui.painter().galley_with_override_text_color(
                    egui::Align2::CENTER_CENTER.align_size_within_rect(galley.size(), rect).min,
       -            galley.galley,
       +            galley,
                    text_color,
                );
        
   DIR diff --git a/src/ui/dialogs/select_tdf_font_dialog.rs b/src/ui/dialogs/select_tdf_font_dialog.rs
       @@ -68,9 +68,9 @@ impl SelectFontDialog {
                let font_id = TextStyle::Button.resolve(ui.style());
                let text: WidgetText = font.name.clone().into();
                let galley = text.into_galley(ui, Some(false), f32::INFINITY, font_id);
       -        ui.painter().galley_with_color(
       +        ui.painter().galley_with_override_text_color(
                    egui::Align2::LEFT_TOP.align_size_within_rect(galley.size(), rect.shrink(4.0)).min,
       -            galley.galley,
       +            galley,
                    text_color,
                );
        
       @@ -99,7 +99,7 @@ impl SelectFontDialog {
                        cnt = 0;
                    }
                    ui.painter()
       -                .galley_with_color(egui::Align2::LEFT_TOP.align_size_within_rect(galley.size(), rect).min, galley.galley, color);
       +                .galley_with_override_text_color(egui::Align2::LEFT_TOP.align_size_within_rect(galley.size(), rect).min, galley, color);
                }
        
                #[allow(clippy::map_entry)]
       @@ -171,9 +171,9 @@ impl SelectFontDialog {
        
                    ui.painter().rect_stroke(rect.expand(2.0), 4.0, Stroke::new(1.0, text_color));
        
       -            ui.painter().galley_with_color(
       +            ui.painter().galley_with_override_text_color(
                        egui::Align2::CENTER_CENTER.align_size_within_rect(galley.size(), rect).min,
       -                galley.galley,
       +                galley,
                        text_color,
                    );
                }
   DIR diff --git a/src/ui/dialogs/settings_dialog.rs b/src/ui/dialogs/settings_dialog.rs
       @@ -1,4 +1,4 @@
       -use std::{rc::Rc, sync::Arc};
       +use std::sync::Arc;
        
        use eframe::{
            egui::{self, color_picker, Layout, Modifiers, RichText},
       @@ -34,7 +34,7 @@ const CHAR_SET_CAT: usize = 3;
        const KEYBIND_CAT: usize = 4;
        
        impl SettingsDialog {
       -    pub fn new(ctx: &Context, gl: &Rc<glow::Context>) -> Self {
       +    pub fn new(ctx: &Context, gl: &Arc<glow::Context>) -> Self {
                let mut views = Vec::new();
        
                for _ in 0..15 {
   DIR diff --git a/src/ui/editor/animation/encoding.rs b/src/ui/editor/animation/encoding.rs
       @@ -3,7 +3,6 @@ use icy_engine::{Buffer, TextPane};
        use icy_engine_egui::{animations::Animator, BufferView, TerminalCalc};
        use std::{
            path::{Path, PathBuf},
       -    rc::Rc,
            sync::{
                mpsc::{Receiver, Sender},
                Arc,
       @@ -28,7 +27,7 @@ type EncodingThread = (Receiver<usize>, JoinHandle<TerminalResult<()>>);
        
        pub fn start_encoding_thread(
            encoder: usize,
       -    gl: Rc<glow::Context>,
       +    gl: Arc<glow::Context>,
            path: PathBuf,
            animator: Arc<std::sync::Mutex<Animator>>,
        ) -> TerminalResult<Option<EncodingThread>> {
   DIR diff --git a/src/ui/editor/animation/highlighting.rs b/src/ui/editor/animation/highlighting.rs
       @@ -1,5 +1,5 @@
        use super::Syntax;
       -use std::collections::HashSet;
       +use std::collections::BTreeSet;
        
        #[must_use]
        pub fn lua() -> Syntax {
       @@ -8,12 +8,12 @@ pub fn lua() -> Syntax {
                case_sensitive: true,
                comment: "--",
                comment_multiline: ["--[[", "]]"],
       -        keywords: HashSet::from([
       +        keywords: BTreeSet::from([
                    "and", "break", "do", "else", "elseif", "end", "false", "for", "function", "if", "in", "local", "nil", "not", "or", "repeat", "return", "then",
                    "true", "until", "while",
                ]),
       -        types: HashSet::from(["nil", "boolean", "number", "string", "nil", "function", "userdata", "thread", "table"]),
       -        special: HashSet::from([
       +        types: BTreeSet::from(["nil", "boolean", "number", "string", "nil", "function", "userdata", "thread", "table"]),
       +        special: BTreeSet::from([
                    "new_buffer",
                    "load_buffer",
                    "next_frame",
   DIR diff --git a/src/ui/editor/animation/mod.rs b/src/ui/editor/animation/mod.rs
       @@ -1,6 +1,5 @@
        use std::{
            path::{Path, PathBuf},
       -    rc::Rc,
            sync::{mpsc::Receiver, Arc},
            time::Instant,
        };
       @@ -24,7 +23,7 @@ mod highlighting;
        //mod mp4_encoder;
        
        pub struct AnimationEditor {
       -    gl: Rc<glow::Context>,
       +    gl: Arc<glow::Context>,
            id: usize,
        
            undostack: usize,
       @@ -54,7 +53,7 @@ pub struct AnimationEditor {
        }
        
        impl AnimationEditor {
       -    pub fn new(gl: Rc<glow::Context>, id: usize, path: &Path, txt: String) -> Self {
       +    pub fn new(gl: Arc<glow::Context>, id: usize, path: &Path, txt: String) -> Self {
                let mut buffer = Buffer::new(Size::new(80, 25));
                buffer.is_terminal_buffer = false;
                let mut buffer_view = BufferView::from_buffer(&gl, buffer);
   DIR diff --git a/src/ui/editor/ansi/mod.rs b/src/ui/editor/ansi/mod.rs
       @@ -4,7 +4,6 @@ use std::{
            fs::File,
            io::Write,
            path::{Path, PathBuf},
       -    rc::Rc,
            sync::Arc,
        };
        
       @@ -222,7 +221,7 @@ impl Document for AnsiEditor {
        }
        
        impl AnsiEditor {
       -    pub fn new(gl: &Rc<glow::Context>, id: usize, buf: Buffer) -> Self {
       +    pub fn new(gl: &Arc<glow::Context>, id: usize, buf: Buffer) -> Self {
                let buffer_view = Arc::new(Mutex::new(BufferView::from_buffer(gl, buf)));
                // let buffer_parser = ansi::Parser::default();
                AnsiEditor {
   DIR diff --git a/src/ui/editor/bitfont/mod.rs b/src/ui/editor/bitfont/mod.rs
       @@ -1,6 +1,6 @@
        mod undo;
        
       -use std::{path::Path, rc::Rc, sync::Arc};
       +use std::{path::Path, sync::Arc};
        
        use eframe::{
            egui::{self, Id, Layout, RichText, Sense},
       @@ -44,7 +44,7 @@ pub enum DrawGlyphStyle {
        }
        
        impl BitFontEditor {
       -    pub fn new(gl: &Rc<glow::Context>, id: usize, font: BitFont) -> Self {
       +    pub fn new(gl: &Arc<glow::Context>, id: usize, font: BitFont) -> Self {
                let mut buffer = Buffer::new(Size::new(10, 10));
                buffer.is_terminal_buffer = false;
                let mut buffer_view = BufferView::from_buffer(gl, buffer);
   DIR diff --git a/src/ui/editor/charfont/mod.rs b/src/ui/editor/charfont/mod.rs
       @@ -1,4 +1,4 @@
       -use std::{path::Path, rc::Rc, sync::Arc};
       +use std::{path::Path, sync::Arc};
        
        use eframe::{
            egui::{self, Button, ScrollArea, SidePanel, TextEdit, TopBottomPanel},
       @@ -426,7 +426,7 @@ fn set_attribute(layer: &mut Layer, attr: TextAttribute) {
        }
        
        impl CharFontEditor {
       -    pub fn new(gl: &Rc<glow::Context>, id: usize, fonts: Vec<TheDrawFont>) -> Self {
       +    pub fn new(gl: &Arc<glow::Context>, id: usize, fonts: Vec<TheDrawFont>) -> Self {
                let mut buffer = Buffer::new(Size::new(30, 12));
                set_up_layers(&mut buffer);
                let ansi_editor = AnsiEditor::new(gl, id, buffer);
   DIR diff --git a/src/ui/main_window.rs b/src/ui/main_window.rs
       @@ -1,7 +1,6 @@
        use std::{
            fs,
            path::Path,
       -    rc::Rc,
            sync::Arc,
            time::{Duration, Instant},
        };
       @@ -30,7 +29,7 @@ pub struct MainWindow<'a> {
        
            pub document_behavior: DocumentBehavior,
            pub tool_behavior: ToolBehavior,
       -    pub gl: Rc<Context>,
       +    pub gl: Arc<Context>,
        
            dialog_open: bool,
            modal_dialog: Option<Box<dyn ModalDialog>>,
   DIR diff --git a/src/ui/tools/layer_view.rs b/src/ui/tools/layer_view.rs
       @@ -1,4 +1,4 @@
       -use std::{rc::Rc, sync::Arc};
       +use std::sync::Arc;
        
        use eframe::{
            egui::{self, CentralPanel, RichText, Sense, TextStyle, TopBottomPanel},
       @@ -12,14 +12,14 @@ use icy_engine_egui::BufferView;
        use crate::{AnsiEditor, Document, Message, ToolWindow, INVISIBLE_SVG, VISIBLE_SVG};
        
        pub struct LayerToolWindow {
       -    gl: Rc<glow::Context>,
       +    gl: Arc<glow::Context>,
            view_cache_id: usize,
            stack_len: usize,
            view_cache: Vec<Arc<eframe::epaint::mutex::Mutex<BufferView>>>,
        }
        
        impl LayerToolWindow {
       -    pub(crate) fn new(gl: Rc<glow::Context>) -> Self {
       +    pub(crate) fn new(gl: Arc<glow::Context>) -> Self {
                Self {
                    gl,
                    view_cache: Vec::new(),
   DIR diff --git a/src/ui/tools/minimap_view.rs b/src/ui/tools/minimap_view.rs
       @@ -1,4 +1,4 @@
       -use std::{rc::Rc, sync::Arc};
       +use std::sync::Arc;
        
        use eframe::{
            egui::{self, RichText},
       @@ -137,7 +137,7 @@ impl MinimapToolWindow {
                None
            }
        
       -    pub(crate) fn new(gl: Rc<glow::Context>) -> Self {
       +    pub(crate) fn new(gl: Arc<glow::Context>) -> Self {
                let mut buffer_view = BufferView::new(&gl);
                buffer_view.interactive = false;
                buffer_view.get_buffer_mut().is_terminal_buffer = false;