Use editor's current font size to scale UI elements (#11844)

This is a follow-up to #11817 and fixes the case where the font size has
been changed with `cmd +/-` and not through the settings.

It now works with both: when the font size is adjusted in the settings
and when changing it via shortcuts.

Release Notes:

- N/A

Demo:


https://github.com/zed-industries/zed/assets/1185253/2e539bd3-f5cc-4aae-9f04-9ae014187959
This commit is contained in:
Thorsten Ball 2024-05-15 10:05:42 +02:00 committed by GitHub
parent 8629a076a7
commit 8bc41e150e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 23 additions and 27 deletions

View file

@ -348,14 +348,6 @@ impl Icon {
self
}
pub fn font_size(self, font_size: AbsoluteLength) -> Self {
let rems = match font_size {
AbsoluteLength::Pixels(pixels) => rems_from_px(pixels.into()),
AbsoluteLength::Rems(rems) => rems,
};
self.custom_size(rems)
}
pub fn transform(mut self, transformation: Transformation) -> Self {
self.transformation = transformation;
self