Use Phosphor icons

This commit is contained in:
Torbjörn Molin committed 2026-11-09 15:20:52 +01:00
1 parent 8c6dec9062
commit f7da7e92aa
8 files changed
+136 -26

No files matched your search

+28 -16
View File
@@ -2,14 +2,20 @@
//!
//! 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
//! import this module as `tr`. Icons that are pure symbols (▶, ✖, `.*`, `Aa`)
//! are here too so a later translation pass sees everything.
//! import this module as `tr`. Icons that are pure symbols (carets, `.*`, `Aa`)
//! 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.
use std::fmt::Display;
use std::path::Path;
use const_format::concatcp;
use crate::icons::{fill, regular as ic};
pub const APP_NAME: &str = "logreadlite";
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 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 EXPORT_DOTS: &str = "Export…";
pub const IMPORT: &str = "Import";
@@ -31,8 +37,8 @@ pub const CASE_ICON: &str = "Aa";
pub const CASE_TIP: &str = "Case sensitive";
pub const WORD_ICON: &str = "\\b";
pub const WORD_TIP: &str = "Whole word";
pub const ARROW_OPEN: &str = "▼";
pub const ARROW_CLOSED: &str = "▶";
pub const ARROW_OPEN: &str = ic::CARET_DOWN;
pub const ARROW_CLOSED: &str = ic::CARET_RIGHT;
pub fn arrow(open: bool) -> &'static str {
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_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: &[(&str, &str)] = &[
@@ -94,22 +103,23 @@ pub fn cannot_save_settings(e: impl Display) -> String {
// ----- 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_EXPAND_ALL: &str = "⊞ Expand all";
pub const TB_COLLAPSE_ALL: &str = "⊟ Collapse all";
pub const TB_WRAP: &str = "↩ Wrap";
pub const TB_EXPAND_ALL: &str = concatcp!(ic::PLUS_SQUARE, " Expand all");
pub const TB_COLLAPSE_ALL: &str = concatcp!(ic::MINUS_SQUARE, " Collapse all");
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_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.";
// ----- log tab: search -----
pub const SEARCH_ICON: &str = ic::MAGNIFYING_GLASS;
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_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_HIDDEN_TOO: &str = "hidden too";
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_NO_MATCH: &str = "No entries match the filter.";
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 {
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_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 {
format!("■ {name}")
format!("{} {name}", fill::SQUARE)
}
pub fn rules_saved_for(glob: &str) -> String {
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_MAX_SIZE: &str = "Max size (MB)";
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_COPY_TIP: &str = "Copy as path:line:text";
pub const GREP_EXPORT_FILE: &str = "grep-results.txt";