Compare commits
2
Commits
8c6dec9062
...
v0.2.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec081438db | ||
|
|
f7da7e92aa |
No files matched your search
Generated
+53
-1
@@ -745,6 +745,27 @@ dependencies = [
|
|||||||
"crossbeam-utils",
|
"crossbeam-utils",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "const_format"
|
||||||
|
version = "0.2.37"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a3decb4d6965448659923544a634a0571ba44cede4e11ef15a5a317126840454"
|
||||||
|
dependencies = [
|
||||||
|
"const_format_proc_macros",
|
||||||
|
"konst",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "const_format_proc_macros"
|
||||||
|
version = "0.2.37"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "941b570269a642506f08cb5b688c04bfa6cfd41a26f8bcdc49db8fd00c0ab659"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"unicode-xid",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "core-foundation"
|
name = "core-foundation"
|
||||||
version = "0.9.4"
|
version = "0.9.4"
|
||||||
@@ -1019,6 +1040,14 @@ dependencies = [
|
|||||||
"web-sys",
|
"web-sys",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "egui-phosphor"
|
||||||
|
version = "0.14.0"
|
||||||
|
source = "git+https://github.com/xangelix/egui-phosphor?rev=01e8c1144cac3f551ceb834b6d26ddf36ba502cd#01e8c1144cac3f551ceb834b6d26ddf36ba502cd"
|
||||||
|
dependencies = [
|
||||||
|
"egui",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "egui-wgpu"
|
name = "egui-wgpu"
|
||||||
version = "0.37.0"
|
version = "0.37.0"
|
||||||
@@ -1966,6 +1995,21 @@ version = "3.1.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc"
|
checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "konst"
|
||||||
|
version = "0.2.20"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "128133ed7824fcd73d6e7b17957c5eb7bacb885649bd8c69708b2331a10bcefb"
|
||||||
|
dependencies = [
|
||||||
|
"konst_macro_rules",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "konst_macro_rules"
|
||||||
|
version = "0.2.19"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a4933f3f57a8e9d9da04db23fb153356ecaf00cbd14aee46279c33dc80925c37"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "kurbo"
|
name = "kurbo"
|
||||||
version = "0.13.1"
|
version = "0.13.1"
|
||||||
@@ -2059,14 +2103,16 @@ checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "logreadlite"
|
name = "logreadlite"
|
||||||
version = "0.2.0"
|
version = "0.2.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aho-corasick",
|
"aho-corasick",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
|
"const_format",
|
||||||
"criterion",
|
"criterion",
|
||||||
"directories",
|
"directories",
|
||||||
"eframe",
|
"eframe",
|
||||||
"egui",
|
"egui",
|
||||||
|
"egui-phosphor",
|
||||||
"globset",
|
"globset",
|
||||||
"grep-regex",
|
"grep-regex",
|
||||||
"grep-searcher",
|
"grep-searcher",
|
||||||
@@ -3835,6 +3881,12 @@ version = "0.2.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254"
|
checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "unicode-xid"
|
||||||
|
version = "0.2.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "url"
|
name = "url"
|
||||||
version = "2.5.8"
|
version = "2.5.8"
|
||||||
|
|||||||
+5
-1
@@ -1,14 +1,18 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "logreadlite"
|
name = "logreadlite"
|
||||||
version = "0.2.0"
|
version = "0.2.1"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
aho-corasick = "1.1.5"
|
aho-corasick = "1.1.5"
|
||||||
anyhow = "1.0.104"
|
anyhow = "1.0.104"
|
||||||
|
const_format = "0.2"
|
||||||
directories = "6.0.0"
|
directories = "6.0.0"
|
||||||
eframe = "0.37.0"
|
eframe = "0.37.0"
|
||||||
egui = "0.37.0"
|
egui = "0.37.0"
|
||||||
|
# Fork branch of upstream PR #49 (egui 0.37 support), pinned. Switch back to
|
||||||
|
# the crates.io release once upstream publishes one for egui 0.37.
|
||||||
|
egui-phosphor = { git = "https://github.com/xangelix/egui-phosphor", rev = "01e8c1144cac3f551ceb834b6d26ddf36ba502cd", default-features = false, features = ["subset"] }
|
||||||
globset = "0.4.20"
|
globset = "0.4.20"
|
||||||
grep-regex = "0.1.14"
|
grep-regex = "0.1.14"
|
||||||
grep-searcher = "0.1.17"
|
grep-searcher = "0.1.17"
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
//! Phosphor icons, subset at compile time to the ones the app uses.
|
||||||
|
//!
|
||||||
|
//! egui's bundled fonts cover text but not symbols; for those it falls back to
|
||||||
|
//! system fonts, which differ per platform (Windows showed empty boxes). The
|
||||||
|
//! subset font is bundled, so icons look the same everywhere. Add an icon here
|
||||||
|
//! before using it in `strings`.
|
||||||
|
|
||||||
|
egui_phosphor::subset! {
|
||||||
|
pub mod icons {
|
||||||
|
use regular::{
|
||||||
|
ARROW_RIGHT,
|
||||||
|
ARROW_U_DOWN_LEFT,
|
||||||
|
CARET_DOWN,
|
||||||
|
CARET_RIGHT,
|
||||||
|
CARET_UP,
|
||||||
|
CLIPBOARD,
|
||||||
|
MAGNIFYING_GLASS,
|
||||||
|
MINUS_SQUARE,
|
||||||
|
PALETTE,
|
||||||
|
PENCIL_SIMPLE,
|
||||||
|
PLUS_SQUARE,
|
||||||
|
WARNING,
|
||||||
|
X,
|
||||||
|
};
|
||||||
|
use fill::{SQUARE};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub use icons::{fill, regular};
|
||||||
|
|
||||||
|
/// Register the icon fonts. `regular` resolves inline in ordinary text; `fill`
|
||||||
|
/// is only used where a label selects [`fill::family`].
|
||||||
|
pub fn install(ctx: &egui::Context) {
|
||||||
|
let mut fonts = egui::FontDefinitions::default();
|
||||||
|
regular::add_to_fonts(&mut fonts);
|
||||||
|
fill::add_as_family(&mut fonts);
|
||||||
|
ctx.set_fonts(fonts);
|
||||||
|
}
|
||||||
@@ -5,6 +5,7 @@
|
|||||||
//! `ui` module holds the egui front end.
|
//! `ui` module holds the egui front end.
|
||||||
|
|
||||||
pub mod grep;
|
pub mod grep;
|
||||||
|
pub mod icons;
|
||||||
pub mod index;
|
pub mod index;
|
||||||
pub mod job;
|
pub mod job;
|
||||||
pub mod passes;
|
pub mod passes;
|
||||||
|
|||||||
+28
-16
@@ -2,14 +2,20 @@
|
|||||||
//!
|
//!
|
||||||
//! Fixed texts are `const`s; texts with values in them are small functions so
|
//! Fixed texts are `const`s; texts with values in them are small functions so
|
||||||
//! the wording (and word order) lives here, not at the call site. Call sites
|
//! the wording (and word order) lives here, not at the call site. Call sites
|
||||||
//! import this module as `tr`. Icons that are pure symbols (▶, ✖, `.*`, `Aa`)
|
//! import this module as `tr`. Icons that are pure symbols (carets, `.*`, `Aa`)
|
||||||
//! are here too so a later translation pass sees everything.
|
//! are here too so a later translation pass sees everything. Symbol glyphs come
|
||||||
|
//! from the bundled Phosphor subset in `crate::icons` (`ic`), never from
|
||||||
|
//! literal Unicode symbols, which need system fonts.
|
||||||
//!
|
//!
|
||||||
//! Not here: widget ids, settings keys, debug-script commands and env vars.
|
//! Not here: widget ids, settings keys, debug-script commands and env vars.
|
||||||
|
|
||||||
use std::fmt::Display;
|
use std::fmt::Display;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|
||||||
|
use const_format::concatcp;
|
||||||
|
|
||||||
|
use crate::icons::{fill, regular as ic};
|
||||||
|
|
||||||
pub const APP_NAME: &str = "logreadlite";
|
pub const APP_NAME: &str = "logreadlite";
|
||||||
pub const APP_TAGLINE: &str = "A fast viewer for large log files.";
|
pub const APP_TAGLINE: &str = "A fast viewer for large log files.";
|
||||||
|
|
||||||
@@ -17,7 +23,7 @@ pub const APP_TAGLINE: &str = "A fast viewer for large log files.";
|
|||||||
|
|
||||||
pub const CANCEL: &str = "Cancel";
|
pub const CANCEL: &str = "Cancel";
|
||||||
pub const CLOSE: &str = "Close";
|
pub const CLOSE: &str = "Close";
|
||||||
pub const COPY: &str = "📋 Copy";
|
pub const COPY: &str = concatcp!(ic::CLIPBOARD, " Copy");
|
||||||
pub const COPY_LINE: &str = "Copy line";
|
pub const COPY_LINE: &str = "Copy line";
|
||||||
pub const EXPORT_DOTS: &str = "Export…";
|
pub const EXPORT_DOTS: &str = "Export…";
|
||||||
pub const IMPORT: &str = "Import";
|
pub const IMPORT: &str = "Import";
|
||||||
@@ -31,8 +37,8 @@ pub const CASE_ICON: &str = "Aa";
|
|||||||
pub const CASE_TIP: &str = "Case sensitive";
|
pub const CASE_TIP: &str = "Case sensitive";
|
||||||
pub const WORD_ICON: &str = "\\b";
|
pub const WORD_ICON: &str = "\\b";
|
||||||
pub const WORD_TIP: &str = "Whole word";
|
pub const WORD_TIP: &str = "Whole word";
|
||||||
pub const ARROW_OPEN: &str = "▼";
|
pub const ARROW_OPEN: &str = ic::CARET_DOWN;
|
||||||
pub const ARROW_CLOSED: &str = "▶";
|
pub const ARROW_CLOSED: &str = ic::CARET_RIGHT;
|
||||||
|
|
||||||
pub fn arrow(open: bool) -> &'static str {
|
pub fn arrow(open: bool) -> &'static str {
|
||||||
if open { ARROW_OPEN } else { ARROW_CLOSED }
|
if open { ARROW_OPEN } else { ARROW_CLOSED }
|
||||||
@@ -57,7 +63,10 @@ pub const MENU_HELP: &str = "Help";
|
|||||||
pub const MENU_SHORTCUTS: &str = "Keyboard shortcuts";
|
pub const MENU_SHORTCUTS: &str = "Keyboard shortcuts";
|
||||||
pub const MENU_ABOUT: &str = "About";
|
pub const MENU_ABOUT: &str = "About";
|
||||||
|
|
||||||
pub const TAB_CLOSE_ICON: &str = "✖";
|
pub const CLOSE_ICON: &str = ic::X;
|
||||||
|
pub const WARNING_ICON: &str = ic::WARNING;
|
||||||
|
pub const MOVE_UP_ICON: &str = ic::CARET_UP;
|
||||||
|
pub const MOVE_DOWN_ICON: &str = ic::CARET_DOWN;
|
||||||
|
|
||||||
pub const SHORTCUTS_TITLE: &str = "Keyboard shortcuts";
|
pub const SHORTCUTS_TITLE: &str = "Keyboard shortcuts";
|
||||||
pub const SHORTCUTS: &[(&str, &str)] = &[
|
pub const SHORTCUTS: &[(&str, &str)] = &[
|
||||||
@@ -94,22 +103,23 @@ pub fn cannot_save_settings(e: impl Display) -> String {
|
|||||||
|
|
||||||
// ----- log tab: toolbar -----
|
// ----- log tab: toolbar -----
|
||||||
|
|
||||||
pub const TB_ENTRY_START: &str = "✏ Entry start";
|
pub const TB_ENTRY_START: &str = concatcp!(ic::PENCIL_SIMPLE, " Entry start");
|
||||||
pub const TB_ENTRY_START_TIP: &str = "Edit the entry-start pattern";
|
pub const TB_ENTRY_START_TIP: &str = "Edit the entry-start pattern";
|
||||||
pub const TB_EXPAND_ALL: &str = "⊞ Expand all";
|
pub const TB_EXPAND_ALL: &str = concatcp!(ic::PLUS_SQUARE, " Expand all");
|
||||||
pub const TB_COLLAPSE_ALL: &str = "⊟ Collapse all";
|
pub const TB_COLLAPSE_ALL: &str = concatcp!(ic::MINUS_SQUARE, " Collapse all");
|
||||||
pub const TB_WRAP: &str = "↩ Wrap";
|
pub const TB_WRAP: &str = concatcp!(ic::ARROW_U_DOWN_LEFT, " Wrap");
|
||||||
pub const TB_WRAP_TIP: &str = "Line wrap (Alt+Z)";
|
pub const TB_WRAP_TIP: &str = "Line wrap (Alt+Z)";
|
||||||
pub const TB_HIGHLIGHTS: &str = "🎨 Highlights";
|
pub const TB_HIGHLIGHTS: &str = concatcp!(ic::PALETTE, " Highlights");
|
||||||
|
|
||||||
pub const FILE_GONE: &str = "The file was deleted or moved. Showing the last version.";
|
pub const FILE_GONE: &str = "The file was deleted or moved. Showing the last version.";
|
||||||
|
|
||||||
// ----- log tab: search -----
|
// ----- log tab: search -----
|
||||||
|
|
||||||
|
pub const SEARCH_ICON: &str = ic::MAGNIFYING_GLASS;
|
||||||
pub const SEARCH_HINT: &str = "Search (Ctrl+F)";
|
pub const SEARCH_HINT: &str = "Search (Ctrl+F)";
|
||||||
pub const SEARCH_PREV_ICON: &str = "⏶";
|
pub const SEARCH_PREV_ICON: &str = ic::CARET_UP;
|
||||||
pub const SEARCH_PREV_TIP: &str = "Previous match (Shift+Enter, Shift+F3)";
|
pub const SEARCH_PREV_TIP: &str = "Previous match (Shift+Enter, Shift+F3)";
|
||||||
pub const SEARCH_NEXT_ICON: &str = "⏷";
|
pub const SEARCH_NEXT_ICON: &str = ic::CARET_DOWN;
|
||||||
pub const SEARCH_NEXT_TIP: &str = "Next match (Enter, F3)";
|
pub const SEARCH_NEXT_TIP: &str = "Next match (Enter, F3)";
|
||||||
pub const SEARCH_HIDDEN_TOO: &str = "hidden too";
|
pub const SEARCH_HIDDEN_TOO: &str = "hidden too";
|
||||||
pub const SEARCH_HIDDEN_TOO_TIP: &str = "Also stop at matches in entries hidden by the filter";
|
pub const SEARCH_HIDDEN_TOO_TIP: &str = "Also stop at matches in entries hidden by the filter";
|
||||||
@@ -170,7 +180,7 @@ pub const VIEW_FILTERING: &str = "Filtering…";
|
|||||||
pub const VIEW_EMPTY: &str = "The file is empty.";
|
pub const VIEW_EMPTY: &str = "The file is empty.";
|
||||||
pub const VIEW_NO_MATCH: &str = "No entries match the filter.";
|
pub const VIEW_NO_MATCH: &str = "No entries match the filter.";
|
||||||
pub const ENTRY_CUT: &str = "\n… (cut)";
|
pub const ENTRY_CUT: &str = "\n… (cut)";
|
||||||
pub const LINE_CUT: &str = " … line cut at 64 KB, right-click → Show full entry";
|
pub const LINE_CUT: &str = concatcp!(" … line cut at 64 KB, right-click ", ic::ARROW_RIGHT, " Show full entry");
|
||||||
|
|
||||||
pub fn more_lines_badge(n: u32) -> String {
|
pub fn more_lines_badge(n: u32) -> String {
|
||||||
format!(" +{n} lines ")
|
format!(" +{n} lines ")
|
||||||
@@ -234,8 +244,10 @@ pub const RULESETS_SWITCH: &str = "Switch to…";
|
|||||||
pub const RULESETS_NAME_HINT: &str = "name, e.g. Java service";
|
pub const RULESETS_NAME_HINT: &str = "name, e.g. Java service";
|
||||||
pub const RULESETS_SAVE: &str = "Save set";
|
pub const RULESETS_SAVE: &str = "Save set";
|
||||||
|
|
||||||
|
/// Colour swatch plus name. Render it with [`fill::family`] so the square is
|
||||||
|
/// solid.
|
||||||
pub fn swatch_label(name: &str) -> String {
|
pub fn swatch_label(name: &str) -> String {
|
||||||
format!("■ {name}")
|
format!("{} {name}", fill::SQUARE)
|
||||||
}
|
}
|
||||||
pub fn rules_saved_for(glob: &str) -> String {
|
pub fn rules_saved_for(glob: &str) -> String {
|
||||||
format!("Saved rules for {glob}")
|
format!("Saved rules for {glob}")
|
||||||
@@ -317,7 +329,7 @@ pub const GREP_GITIGNORE: &str = "Respect .gitignore";
|
|||||||
pub const GREP_SKIP_BINARY: &str = "Skip binary files";
|
pub const GREP_SKIP_BINARY: &str = "Skip binary files";
|
||||||
pub const GREP_MAX_SIZE: &str = "Max size (MB)";
|
pub const GREP_MAX_SIZE: &str = "Max size (MB)";
|
||||||
pub const GREP_MAX_SIZE_HINT: &str = "any";
|
pub const GREP_MAX_SIZE_HINT: &str = "any";
|
||||||
pub const GREP_SEARCH: &str = "🔍 Search";
|
pub const GREP_SEARCH: &str = concatcp!(ic::MAGNIFYING_GLASS, " Search");
|
||||||
pub const GREP_CAPPED: &str = "results capped (10,000 per file, 1M total)";
|
pub const GREP_CAPPED: &str = "results capped (10,000 per file, 1M total)";
|
||||||
pub const GREP_COPY_TIP: &str = "Copy as path:line:text";
|
pub const GREP_COPY_TIP: &str = "Copy as path:line:text";
|
||||||
pub const GREP_EXPORT_FILE: &str = "grep-results.txt";
|
pub const GREP_EXPORT_FILE: &str = "grep-results.txt";
|
||||||
|
|||||||
+3
-3
@@ -975,7 +975,7 @@ impl LogTab {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn search_box(&mut self, ui: &mut Ui) {
|
fn search_box(&mut self, ui: &mut Ui) {
|
||||||
ui.label("🔍");
|
ui.label(tr::SEARCH_ICON);
|
||||||
let edit = egui::TextEdit::singleline(&mut self.search.text).hint_text(tr::SEARCH_HINT).desired_width(220.0);
|
let edit = egui::TextEdit::singleline(&mut self.search.text).hint_text(tr::SEARCH_HINT).desired_width(220.0);
|
||||||
let resp = ui.add(edit);
|
let resp = ui.add(edit);
|
||||||
if self.search.focus {
|
if self.search.focus {
|
||||||
@@ -1038,9 +1038,9 @@ impl LogTab {
|
|||||||
changed |=
|
changed |=
|
||||||
ui.toggle_value(&mut r.case_sensitive, tr::CASE_ICON).on_hover_text(tr::CASE_TIP).changed();
|
ui.toggle_value(&mut r.case_sensitive, tr::CASE_ICON).on_hover_text(tr::CASE_TIP).changed();
|
||||||
if let Err(e) = r.validate() {
|
if let Err(e) = r.validate() {
|
||||||
ui.colored_label(ui.visuals().error_fg_color, "⚠").on_hover_text(e);
|
ui.colored_label(ui.visuals().error_fg_color, tr::WARNING_ICON).on_hover_text(e);
|
||||||
}
|
}
|
||||||
if ui.small_button("✖").clicked() {
|
if ui.small_button(tr::CLOSE_ICON).clicked() {
|
||||||
remove = Some(i);
|
remove = Some(i);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
+2
-1
@@ -55,6 +55,7 @@ impl App {
|
|||||||
pub fn new(cc: &eframe::CreationContext<'_>, args: Vec<PathBuf>) -> Self {
|
pub fn new(cc: &eframe::CreationContext<'_>, args: Vec<PathBuf>) -> Self {
|
||||||
let ctx = cc.egui_ctx.clone();
|
let ctx = cc.egui_ctx.clone();
|
||||||
let notify: Notify = Arc::new(move || ctx.request_repaint());
|
let notify: Notify = Arc::new(move || ctx.request_repaint());
|
||||||
|
crate::icons::install(&cc.egui_ctx);
|
||||||
let settings = Settings::load();
|
let settings = Settings::load();
|
||||||
cc.egui_ctx.global_style_mut(|s| {
|
cc.egui_ctx.global_style_mut(|s| {
|
||||||
if let Some(f) = s.text_styles.get_mut(&egui::TextStyle::Monospace) {
|
if let Some(f) = s.text_styles.get_mut(&egui::TextStyle::Monospace) {
|
||||||
@@ -259,7 +260,7 @@ impl App {
|
|||||||
if r.middle_clicked() {
|
if r.middle_clicked() {
|
||||||
close = Some(i);
|
close = Some(i);
|
||||||
}
|
}
|
||||||
if ui.small_button(tr::TAB_CLOSE_ICON).on_hover_text(tr::CLOSE).clicked() {
|
if ui.small_button(tr::CLOSE_ICON).on_hover_text(tr::CLOSE).clicked() {
|
||||||
close = Some(i);
|
close = Some(i);
|
||||||
}
|
}
|
||||||
ui.separator();
|
ui.separator();
|
||||||
|
|||||||
+8
-6
@@ -163,10 +163,12 @@ fn color_picker(ui: &mut Ui, id: impl egui::AsIdSalt, color: &mut Option<String>
|
|||||||
let swatch = palette::swatch(¤t);
|
let swatch = palette::swatch(¤t);
|
||||||
egui::ComboBox::from_id_salt(id)
|
egui::ComboBox::from_id_salt(id)
|
||||||
.width(80.0)
|
.width(80.0)
|
||||||
.selected_text(RichText::new(tr::swatch_label(¤t)).color(swatch))
|
.selected_text(RichText::new(tr::swatch_label(¤t)).family(crate::icons::fill::family()).color(swatch))
|
||||||
.show_ui(ui, |ui| {
|
.show_ui(ui, |ui| {
|
||||||
for name in palette::NAMES {
|
for name in palette::NAMES {
|
||||||
let label = RichText::new(tr::swatch_label(name)).color(palette::swatch(name));
|
let label = RichText::new(tr::swatch_label(name))
|
||||||
|
.family(crate::icons::fill::family())
|
||||||
|
.color(palette::swatch(name));
|
||||||
if ui.selectable_label(current == *name, label).clicked() {
|
if ui.selectable_label(current == *name, label).clicked() {
|
||||||
*color = Some(name.to_string());
|
*color = Some(name.to_string());
|
||||||
changed = true;
|
changed = true;
|
||||||
@@ -214,17 +216,17 @@ pub fn rules_panel(tab: &mut LogTab, ui: &mut Ui, settings: &mut Settings) -> Ve
|
|||||||
changed |= ui.selectable_value(&mut scope, Scope::Match, tr::SCOPE_MATCH).changed();
|
changed |= ui.selectable_value(&mut scope, Scope::Match, tr::SCOPE_MATCH).changed();
|
||||||
});
|
});
|
||||||
r.scope = Some(scope);
|
r.scope = Some(scope);
|
||||||
if k > 0 && ui.small_button("⏶").clicked() {
|
if k > 0 && ui.small_button(tr::MOVE_UP_ICON).clicked() {
|
||||||
swap = Some((i, hl[k - 1]));
|
swap = Some((i, hl[k - 1]));
|
||||||
}
|
}
|
||||||
if k + 1 < hl.len() && ui.small_button("⏷").clicked() {
|
if k + 1 < hl.len() && ui.small_button(tr::MOVE_DOWN_ICON).clicked() {
|
||||||
swap = Some((i, hl[k + 1]));
|
swap = Some((i, hl[k + 1]));
|
||||||
}
|
}
|
||||||
if ui.small_button("✖").clicked() {
|
if ui.small_button(tr::CLOSE_ICON).clicked() {
|
||||||
remove = Some(i);
|
remove = Some(i);
|
||||||
}
|
}
|
||||||
if let Err(e) = r.validate() {
|
if let Err(e) = r.validate() {
|
||||||
ui.colored_label(ui.visuals().error_fg_color, "⚠").on_hover_text(e);
|
ui.colored_label(ui.visuals().error_fg_color, tr::WARNING_ICON).on_hover_text(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
ui.add_space(2.0);
|
ui.add_space(2.0);
|
||||||
|
|||||||
Reference in new issue
Block a user