commit 083b2dfd2763f44864ed3800d05c79f324cf3909
parent 144d8dd8f88c9a0c9e31760d2b372e42e674caa8
Author: William Casarin <jb55@jb55.com>
Date: Fri, 27 Feb 2026 13:53:23 -0800
settings: remove font size setting, use zoom level only
The font size slider only affected NoteBody text and was redundant
with the zoom level control which scales all UI elements uniformly.
Also fixes broken setup_chrome reference in preview.rs.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat:
7 files changed, 7 insertions(+), 125 deletions(-)
diff --git a/crates/notedeck/src/app.rs b/crates/notedeck/src/app.rs
@@ -356,13 +356,7 @@ impl Notedeck {
pub fn setup(&self, ctx: &egui::Context) {
// Initialize global i18n context
//crate::i18n::init_global_i18n(i18n.clone());
- crate::setup::setup_egui_context(
- ctx,
- self.args.options,
- self.theme(),
- self.note_body_font_size(),
- self.zoom_factor(),
- );
+ crate::setup::setup_egui_context(ctx, self.args.options, self.theme(), self.zoom_factor());
}
#[inline]
@@ -434,10 +428,6 @@ impl Notedeck {
self.settings.theme()
}
- pub fn note_body_font_size(&self) -> f32 {
- self.settings.note_body_font_size()
- }
-
pub fn zoom_factor(&self) -> f32 {
self.settings.zoom_factor()
}
diff --git a/crates/notedeck/src/persist/mod.rs b/crates/notedeck/src/persist/mod.rs
@@ -6,5 +6,4 @@ pub use app_size::AppSizeHandler;
pub use settings_handler::Settings;
pub use settings_handler::SettingsHandler;
pub use settings_handler::DEFAULT_MAX_HASHTAGS_PER_NOTE;
-pub use settings_handler::DEFAULT_NOTE_BODY_FONT_SIZE;
pub use token_handler::TokenHandler;
diff --git a/crates/notedeck/src/persist/settings_handler.rs b/crates/notedeck/src/persist/settings_handler.rs
@@ -15,10 +15,6 @@ const DEFAULT_ZOOM_FACTOR: f32 = 1.0;
const DEFAULT_SHOW_SOURCE_CLIENT: &str = "hide";
const DEFAULT_SHOW_REPLIES_NEWEST_FIRST: bool = false;
const DEFAULT_TOS_VERSION: &str = "1.0";
-#[cfg(any(target_os = "android", target_os = "ios"))]
-pub const DEFAULT_NOTE_BODY_FONT_SIZE: f32 = 13.0;
-#[cfg(not(any(target_os = "android", target_os = "ios")))]
-pub const DEFAULT_NOTE_BODY_FONT_SIZE: f32 = 16.0;
pub const DEFAULT_MAX_HASHTAGS_PER_NOTE: usize = 3;
fn deserialize_theme(serialized_theme: &str) -> Option<ThemePreference> {
@@ -37,7 +33,6 @@ pub struct Settings {
pub zoom_factor: f32,
pub show_source_client: String,
pub show_replies_newest_first: bool,
- pub note_body_font_size: f32,
#[serde(default = "default_animate_nav_transitions")]
pub animate_nav_transitions: bool,
pub max_hashtags_per_note: usize,
@@ -69,7 +64,6 @@ impl Default for Settings {
zoom_factor: DEFAULT_ZOOM_FACTOR,
show_source_client: DEFAULT_SHOW_SOURCE_CLIENT.to_string(),
show_replies_newest_first: DEFAULT_SHOW_REPLIES_NEWEST_FIRST,
- note_body_font_size: DEFAULT_NOTE_BODY_FONT_SIZE,
animate_nav_transitions: default_animate_nav_transitions(),
max_hashtags_per_note: DEFAULT_MAX_HASHTAGS_PER_NOTE,
welcome_completed: false,
@@ -216,11 +210,6 @@ impl SettingsHandler {
self.try_save_settings();
}
- pub fn set_note_body_font_size(&mut self, value: f32) {
- self.get_settings_mut().note_body_font_size = value;
- self.try_save_settings();
- }
-
pub fn set_animate_nav_transitions(&mut self, value: bool) {
self.get_settings_mut().animate_nav_transitions = value;
self.try_save_settings();
@@ -285,13 +274,6 @@ impl SettingsHandler {
self.current_settings.is_some()
}
- pub fn note_body_font_size(&self) -> f32 {
- self.current_settings
- .as_ref()
- .map(|s| s.note_body_font_size)
- .unwrap_or(DEFAULT_NOTE_BODY_FONT_SIZE)
- }
-
pub fn max_hashtags_per_note(&self) -> usize {
self.current_settings
.as_ref()
diff --git a/crates/notedeck/src/setup.rs b/crates/notedeck/src/setup.rs
@@ -1,15 +1,12 @@
use crate::fonts;
use crate::theme;
use crate::NotedeckOptions;
-use crate::NotedeckTextStyle;
-use egui::FontId;
use egui::ThemePreference;
pub fn setup_egui_context(
ctx: &egui::Context,
options: NotedeckOptions,
theme: ThemePreference,
- note_body_font_size: f32,
zoom_factor: f32,
) {
let is_mobile = options.contains(NotedeckOptions::Mobile) || crate::ui::is_compiled_as_mobile();
@@ -36,11 +33,4 @@ pub fn setup_egui_context(
ctx.all_styles_mut(|style| crate::theme::add_custom_style(is_mobile, style));
ctx.set_zoom_factor(zoom_factor);
-
- let mut style = (*ctx.style()).clone();
- style.text_styles.insert(
- NotedeckTextStyle::NoteBody.text_style(),
- FontId::proportional(note_body_font_size),
- );
- ctx.set_style(style);
}
diff --git a/crates/notedeck_chrome/src/preview.rs b/crates/notedeck_chrome/src/preview.rs
@@ -1,5 +1,5 @@
use notedeck::{DataPath, Notedeck};
-use notedeck_chrome::setup::{generate_native_options, setup_chrome};
+use notedeck_chrome::setup::generate_native_options;
use notedeck_columns::ui::configure_deck::ConfigureDeckView;
use notedeck_columns::ui::edit_deck::EditDeckView;
use notedeck_columns::ui::profile::EditProfileView;
@@ -38,13 +38,7 @@ impl PreviewRunner {
"unrecognized args: {:?}",
notedeck.unrecognized_args()
);
- setup_chrome(
- ctx,
- notedeck.args(),
- notedeck.theme(),
- notedeck.note_body_font_size(),
- notedeck.zoom_factor(),
- );
+ notedeck.setup(ctx);
notedeck.set_app(PreviewApp::new(preview));
diff --git a/crates/notedeck_columns/src/nav.rs b/crates/notedeck_columns/src/nav.rs
@@ -736,7 +736,6 @@ fn render_nav_body(
SettingsView::new(
ctx.settings.get_settings_mut(),
&mut note_context,
- &mut app.note_options,
&db_path,
&mut app.view_state.compact,
)
diff --git a/crates/notedeck_columns/src/ui/settings.rs b/crates/notedeck_columns/src/ui/settings.rs
@@ -1,23 +1,19 @@
use egui::{
- vec2, Button, Color32, ComboBox, CornerRadius, FontId, Frame, Layout, Margin, RichText,
- ScrollArea, TextEdit, ThemePreference,
+ vec2, Button, Color32, ComboBox, CornerRadius, Frame, Layout, Margin, RichText, ScrollArea,
+ TextEdit, ThemePreference,
};
use egui_extras::{Size, StripBuilder};
-use enostr::NoteId;
-use nostrdb::Transaction;
use notedeck::{
tr, ui::richtext_small, DragResponse, LanguageIdentifier, NoteContext, NotedeckTextStyle,
- Settings, DEFAULT_MAX_HASHTAGS_PER_NOTE, DEFAULT_NOTE_BODY_FONT_SIZE,
+ Settings, DEFAULT_MAX_HASHTAGS_PER_NOTE,
};
use notedeck_ui::{
app_images::{copy_to_clipboard_dark_image, copy_to_clipboard_image},
- AnimationHelper, NoteOptions, NoteView,
+ AnimationHelper, NoteOptions,
};
use crate::{nav::RouterAction, ui::account_login_view::eye_button, Damus, Route};
-const PREVIEW_NOTE_ID: &str = "note1edjc8ggj07hwv77g2405uh6j2jkk5aud22gktxrvc2wnre4vdwgqzlv2gw";
-
const MIN_ZOOM: f32 = 0.5;
const MAX_ZOOM: f32 = 3.0;
const ZOOM_STEP: f32 = 0.1;
@@ -28,7 +24,6 @@ pub enum SettingsAction {
SetTheme(ThemePreference),
SetLocale(LanguageIdentifier),
SetRepliestNewestFirst(bool),
- SetNoteBodyFontSize(f32),
SetAnimateNavTransitions(bool),
SetMaxHashtagsPerNote(usize),
OpenRelays,
@@ -74,17 +69,6 @@ impl SettingsAction {
Self::ClearCacheFolder => {
let _ = app_ctx.img_cache.clear_folder_contents();
}
- Self::SetNoteBodyFontSize(size) => {
- let mut style = (*egui_ctx.style()).clone();
- style.text_styles.insert(
- NotedeckTextStyle::NoteBody.text_style(),
- FontId::proportional(size),
- );
- egui_ctx.set_style(style);
-
- app_ctx.settings.set_note_body_font_size(size);
- }
-
Self::SetAnimateNavTransitions(value) => {
app_ctx.settings.set_animate_nav_transitions(value);
}
@@ -134,7 +118,6 @@ impl SettingsAction {
pub struct SettingsView<'a> {
settings: &'a mut Settings,
note_context: &'a mut NoteContext<'a>,
- note_options: &'a mut NoteOptions,
db_path: &'a std::path::Path,
compact: &'a mut notedeck::compact::CompactState,
}
@@ -162,14 +145,12 @@ impl<'a> SettingsView<'a> {
pub fn new(
settings: &'a mut Settings,
note_context: &'a mut NoteContext<'a>,
- note_options: &'a mut NoteOptions,
db_path: &'a std::path::Path,
compact: &'a mut notedeck::compact::CompactState,
) -> Self {
Self {
settings,
note_context,
- note_options,
db_path,
compact,
}
@@ -196,59 +177,6 @@ impl<'a> SettingsView<'a> {
"Label for appearance settings section",
);
settings_group(ui, title, |ui| {
- ui.horizontal_wrapped(|ui| {
- ui.label(richtext_small(tr!(
- self.note_context.i18n,
- "Font size:",
- "Label for font size, Appearance settings section",
- )));
-
- if ui
- .add(
- egui::Slider::new(&mut self.settings.note_body_font_size, 8.0..=32.0)
- .text(""),
- )
- .changed()
- {
- action = Some(SettingsAction::SetNoteBodyFontSize(
- self.settings.note_body_font_size,
- ));
- };
-
- if ui
- .button(richtext_small(tr!(
- self.note_context.i18n,
- "Reset",
- "Label for reset note body font size, Appearance settings section",
- )))
- .clicked()
- {
- action = Some(SettingsAction::SetNoteBodyFontSize(
- DEFAULT_NOTE_BODY_FONT_SIZE,
- ));
- }
- });
-
- let txn = Transaction::new(self.note_context.ndb).unwrap();
-
- if let Some(note_id) = NoteId::from_bech(PREVIEW_NOTE_ID) {
- if let Ok(preview_note) =
- self.note_context.ndb.get_note_by_id(&txn, note_id.bytes())
- {
- notedeck_ui::padding(8.0, ui, |ui| {
- if notedeck::ui::is_narrow(ui.ctx()) {
- ui.set_max_width(ui.available_width());
-
- NoteView::new(self.note_context, &preview_note, *self.note_options)
- .actionbar(false)
- .options_button(false)
- .show(ui);
- }
- });
- ui.separator();
- }
- }
-
let current_zoom = ui.ctx().zoom_factor();
ui.horizontal_wrapped(|ui| {