From e76c0f72fc4b50f0513b003b0d321f843ab7db4e Mon Sep 17 00:00:00 2001 From: Cyrix126 Date: Fri, 13 Dec 2024 17:00:19 +0100 Subject: [PATCH] feat: wrap text of console if width is too tight --- src/app/panels/middle/common/console.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/panels/middle/common/console.rs b/src/app/panels/middle/common/console.rs index 48218e2..33d17d4 100644 --- a/src/app/panels/middle/common/console.rs +++ b/src/app/panels/middle/common/console.rs @@ -1,6 +1,6 @@ use std::sync::{Arc, Mutex}; -use egui::{Label, TextEdit, TextStyle, Ui}; +use egui::{Label, TextEdit, TextStyle, TextWrapMode, Ui}; use crate::{DARK_GRAY, helper::Process, miscs::height_txt_before_button, regex::num_lines}; @@ -8,6 +8,7 @@ pub fn console(ui: &mut Ui, text: &str) { let nb_lines = num_lines(text); let height = ui.available_height() / 2.8; egui::Frame::none().fill(DARK_GRAY).show(ui, |ui| { + ui.style_mut().wrap_mode = Some(TextWrapMode::Wrap); ui.style_mut().override_text_style = Some(TextStyle::Small); egui::ScrollArea::vertical() .stick_to_bottom(true)