Move font size adjustment code to the theme crate
This commit is contained in:
parent
258723566f
commit
42eca3048f
10 changed files with 69 additions and 56 deletions
|
@ -123,7 +123,7 @@ pub fn init(cx: &mut AppContext) {
|
|||
pub struct TerminalSettings {
|
||||
pub shell: Shell,
|
||||
pub working_directory: WorkingDirectory,
|
||||
pub font_size: Option<f32>,
|
||||
font_size: Option<f32>,
|
||||
pub font_family: Option<String>,
|
||||
pub line_height: TerminalLineHeight,
|
||||
pub font_features: Option<fonts::Features>,
|
||||
|
@ -149,6 +149,13 @@ pub struct TerminalSettingsContent {
|
|||
pub copy_on_select: Option<bool>,
|
||||
}
|
||||
|
||||
impl TerminalSettings {
|
||||
pub fn font_size(&self, cx: &AppContext) -> Option<f32> {
|
||||
self.font_size
|
||||
.map(|size| theme::adjusted_font_size(size, cx))
|
||||
}
|
||||
}
|
||||
|
||||
impl settings::Setting for TerminalSettings {
|
||||
const KEY: Option<&'static str> = Some("terminal");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue