Fix font sizes not reacting on settings change (#26060)
Proper version of https://github.com/zed-industries/zed/pull/25425 When https://github.com/zed-industries/zed/pull/24857 returned font updates on settings changes, settings values, not in-memory ones should be compared. This PR returns back the logic finally, and changes it to explicitly track the settings values, not the in-memory ones. Also adds the same tracking for UI font changes, which had never been tracked before. Release Notes: - Fixed font sizes not reacting on settings change
This commit is contained in:
parent
db28b9bbde
commit
fc01f496a9
2 changed files with 35 additions and 0 deletions
|
@ -579,6 +579,22 @@ impl ThemeSettings {
|
|||
clamp_font_size(font_size)
|
||||
}
|
||||
|
||||
/// Returns the buffer font size, read from the settings.
|
||||
///
|
||||
/// The real buffer font size is stored in-memory, to support temporary font size changes.
|
||||
/// Use [`Self::buffer_font_size`] to get the real font size.
|
||||
pub fn buffer_font_size_settings(&self) -> Pixels {
|
||||
self.buffer_font_size
|
||||
}
|
||||
|
||||
/// Returns the UI font size, read from the settings.
|
||||
///
|
||||
/// The real UI font size is stored in-memory, to support temporary font size changes.
|
||||
/// Use [`Self::ui_font_size`] to get the real font size.
|
||||
pub fn ui_font_size_settings(&self) -> Pixels {
|
||||
self.ui_font_size
|
||||
}
|
||||
|
||||
// TODO: Rename: `line_height` -> `buffer_line_height`
|
||||
/// Returns the buffer's line height.
|
||||
pub fn line_height(&self) -> f32 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue