Add Note Width setting to cap editor content width (#137)

This commit is contained in:
Yuri Karamian
2026-06-20 15:01:01 +02:00
parent f0f19125d5
commit 1c46935cc5
8 changed files with 74 additions and 2 deletions
+8
View File
@@ -122,6 +122,14 @@ pub fn set_ui_scale(state: State<'_, AppState>, scale: f64) -> Result<(), String
Ok(())
}
#[tauri::command]
pub fn set_content_width(state: State<'_, AppState>, width: Option<u32>) -> Result<(), String> {
let mut config = state.config.lock().map_err(|e| e.to_string())?;
config.content_width = width;
save_app_config(&config)?;
Ok(())
}
// ── Notebooks ──
#[tauri::command]
+1
View File
@@ -106,6 +106,7 @@ pub fn run() {
commands::set_font_family,
commands::set_line_height,
commands::set_ui_scale,
commands::set_content_width,
commands::get_notebooks,
commands::count_root_notes,
commands::create_notebook,
+3
View File
@@ -72,6 +72,8 @@ pub struct AppConfig {
#[serde(default)]
pub ui_scale: Option<f64>,
#[serde(default)]
pub content_width: Option<u32>,
#[serde(default)]
pub compact_notes: bool,
#[serde(default = "default_true")]
pub show_note_dates: bool,
@@ -205,6 +207,7 @@ impl Default for AppConfig {
font_family: None,
line_height: None,
ui_scale: None,
content_width: None,
compact_notes: false,
show_note_dates: true,
time_format: "relative".to_string(),