-
Notifications
You must be signed in to change notification settings - Fork 8.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement cell size customizations #14255
Changes from all commits
aaec2a5
ba8e165
f6e730e
6bbc1cd
9554470
504f483
17f8e47
dd34a30
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,7 @@ namespace Microsoft.Terminal.Settings.Editor | |
|
||
OBSERVABLE_PROJECTED_APPEARANCE_SETTING(String, FontFace); | ||
OBSERVABLE_PROJECTED_APPEARANCE_SETTING(Single, FontSize); | ||
OBSERVABLE_PROJECTED_APPEARANCE_SETTING(Double, LineHeight); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. one's a single, one's a double! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
OBSERVABLE_PROJECTED_APPEARANCE_SETTING(Windows.UI.Text.FontWeight, FontWeight); | ||
|
||
OBSERVABLE_PROJECTED_APPEARANCE_SETTING(String, DarkColorSchemeName); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -219,7 +219,6 @@ | |
Visibility="{x:Bind Appearance.IsDefault, Mode=OneWay}"> | ||
<muxc:NumberBox x:Name="_fontSizeBox" | ||
x:Uid="Profile_FontSizeBox" | ||
AcceptsExpression="False" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does it accept expressions now? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. false is the default! |
||
LargeChange="10" | ||
Maximum="128" | ||
Minimum="1" | ||
|
@@ -228,6 +227,22 @@ | |
Value="{x:Bind Appearance.FontSize, Mode=TwoWay}" /> | ||
</local:SettingContainer> | ||
|
||
<!-- Line Height --> | ||
<local:SettingContainer x:Uid="Profile_LineHeight" | ||
ClearSettingValue="{x:Bind Appearance.ClearLineHeight}" | ||
HasSettingValue="{x:Bind Appearance.HasLineHeight, Mode=OneWay}" | ||
SettingOverrideSource="{x:Bind Appearance.LineHeightOverrideSource, Mode=OneWay}" | ||
Visibility="{x:Bind Appearance.IsDefault, Mode=OneWay}"> | ||
<muxc:NumberBox x:Name="_lineHeightBox" | ||
lhecker marked this conversation as resolved.
Show resolved
Hide resolved
|
||
x:Uid="Profile_LineHeightBox" | ||
LargeChange="0.1" | ||
Maximum="10" | ||
Minimum="0.1" | ||
SmallChange="0.1" | ||
Style="{StaticResource NumberBoxSettingStyle}" | ||
Value="{x:Bind Appearance.LineHeight, Mode=TwoWay}" /> | ||
</local:SettingContainer> | ||
|
||
<!-- Font Weight --> | ||
<local:SettingContainer x:Name="FontWeightContainer" | ||
x:Uid="Profile_FontWeight" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -874,6 +874,22 @@ | |
<value>Size of the font in points.</value> | ||
<comment>A description for what the "font size" setting does. Presented near "Profile_FontSize".</comment> | ||
</data> | ||
<data name="Profile_LineHeight.Header" xml:space="preserve"> | ||
<value>Line height</value> | ||
<comment>Header for a control that sets the text line height.</comment> | ||
</data> | ||
<data name="Profile_LineHeightBox.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve"> | ||
<value>Line height</value> | ||
<comment>Header for a control that sets the text line height.</comment> | ||
</data> | ||
<data name="Profile_LineHeight.HelpText" xml:space="preserve"> | ||
<value>Sets the height of each line in the terminal as a multiple of the font size. The default depends on your font and is usually around 1.2.</value> | ||
<comment>A description for what the "line height" setting does. Presented near "Profile_LineHeight".</comment> | ||
</data> | ||
<data name="Profile_LineHeightBox.PlaceholderText" xml:space="preserve"> | ||
<value>1.2</value> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will users be confused that it says 1.2 but the default is not 1.2? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I felt like a placeholder made the input feel a little less confusing. 1.2 is reasonably close to the line height of most fonts (I've seen anything between about 1.15 and 1.35). |
||
<comment>"1.2" is a decimal number.</comment> | ||
</data> | ||
carlos-zamora marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<data name="Profile_FontWeightComboBox.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve"> | ||
<value>Font weight</value> | ||
<comment>Name for a control to select the weight (i.e. bold, thin, etc.) of the text in the app.</comment> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -324,11 +324,9 @@ Json::Value Profile::ToJson() const | |
MTSM_PROFILE_SETTINGS(PROFILE_SETTINGS_TO_JSON) | ||
#undef PROFILE_SETTINGS_TO_JSON | ||
|
||
// Font settings | ||
const auto fontInfoImpl = winrt::get_self<FontConfig>(_FontInfo); | ||
if (fontInfoImpl->HasAnyOptionSet()) | ||
if (auto fontJSON = winrt::get_self<FontConfig>(_FontInfo)->ToJson(); !fontJSON.empty()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. interesting. serialize first, then check! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep! I felt like that it made the code a lot simpler. |
||
{ | ||
json[JsonKey(FontInfoKey)] = winrt::get_self<FontConfig>(_FontInfo)->ToJson(); | ||
json[JsonKey(FontInfoKey)] = std::move(fontJSON); | ||
} | ||
|
||
if (_UnfocusedAppearance) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See microsoft/microsoft-ui-xaml#7851