дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-09 19:25:54 +02:00
feat(settings): add editable font search and refresh (#251)
The font pickers (editor, fallback, UI, terminal) become editable comboboxes: type to search installed families or enter any family name, and Refresh re-reads the system fonts. ide-fonts' cached family list is now refreshable (DirectWrite re-queries the system collection with checkForUpdates; CoreText and fontconfig are read anew), exposed through system_font_families(refresh). Before the first native result the pickers fall back to Canvas detection of common families; saved names and the last catalog are kept when a refresh fails. Fonts are enumerated on the local desktop in remote-development windows too. Co-authored-by: bghtyu <[email protected]>
Цей коміт міститься в:
1 джерело
285c7187fb
коміт
00693334f7
25 files changed
+861
-291
No files matched your search
@@ -1,14 +1,15 @@
|
||||
//! Font families installed on this machine, for the font pickers in Settings.
|
||||
//! Enumerates fonts on the local desktop, including in remote-development windows.
|
||||
|
||||
use ide_core::{IdeError, IdeResult};
|
||||
use ide_fonts::FontFamily;
|
||||
|
||||
/// Every installed family, sorted, each flagged monospaced or not. Read once
|
||||
/// per run (off the command threads) and cached.
|
||||
/// Every installed family, sorted, each flagged monospaced or not. Read on
|
||||
/// first use (off the command threads), cached, and re-queried on `refresh`.
|
||||
#[tauri::command]
|
||||
#[specta::specta]
|
||||
pub async fn system_font_families() -> IdeResult<Vec<FontFamily>> {
|
||||
tauri::async_runtime::spawn_blocking(|| ide_fonts::families().to_vec())
|
||||
pub async fn system_font_families(refresh: bool) -> IdeResult<Vec<FontFamily>> {
|
||||
tauri::async_runtime::spawn_blocking(move || ide_fonts::families(refresh).to_vec())
|
||||
.await
|
||||
.map_err(|e| IdeError::internal(e.to_string()))
|
||||
}
|
||||
Reference in new issue
Заблокувати користувача