ui: Track changes to UI font size made via actions with settings (#23265)

Fixes #5380

Closes #5380

Release Notes:

- Font size changes made with actions are now persisted in user settings
This commit is contained in:
Piotr Osiewicz 2025-01-17 00:28:18 +01:00 committed by GitHub
parent 24495f09f9
commit 795376cb07
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 89 additions and 156 deletions

View file

@ -160,10 +160,7 @@ use std::{
pub use sum_tree::Bias;
use sum_tree::TreeMap;
use text::{BufferId, OffsetUtf16, Rope};
use theme::{
observe_buffer_font_size_adjustment, ActiveTheme, PlayerColor, StatusColors, SyntaxTheme,
ThemeColors, ThemeSettings,
};
use theme::{ActiveTheme, PlayerColor, StatusColors, SyntaxTheme, ThemeColors, ThemeSettings};
use ui::{
h_flex, prelude::*, ButtonSize, ButtonStyle, Disclosure, IconButton, IconName, IconSize,
PopoverMenuHandle, Tooltip,
@ -1344,7 +1341,6 @@ impl Editor {
cx.observe(&display_map, Self::on_display_map_changed),
cx.observe(&blink_manager, |_, _, cx| cx.notify()),
cx.observe_global::<SettingsStore>(Self::settings_changed),
observe_buffer_font_size_adjustment(cx, |_, cx| cx.notify()),
cx.observe_window_activation(|editor, cx| {
let active = cx.is_window_active();
editor.blink_manager.update(cx, |blink_manager, cx| {
@ -14366,7 +14362,7 @@ impl Render for Editor {
font_family: settings.buffer_font.family.clone(),
font_features: settings.buffer_font.features.clone(),
font_fallbacks: settings.buffer_font.fallbacks.clone(),
font_size: settings.buffer_font_size(cx).into(),
font_size: settings.buffer_font_size().into(),
font_weight: settings.buffer_font.weight,
line_height: relative(settings.buffer_line_height.value()),
..Default::default()