Skip to content

Commit

Permalink
Polish settings UI localized text (#9124)
Browse files Browse the repository at this point in the history
Updates the following text in the settings UI
- focus follow mouse mode is introduced to be more instructional
- focus follow mouse mode tooltip removed
- avoid double negative in "disable pane animation"

Closes #8900 
Updates #6459 Settings UI text
  • Loading branch information
carlos-zamora authored Feb 19, 2021
1 parent 69318d3 commit 1774302
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 28 deletions.
6 changes: 6 additions & 0 deletions src/cascadia/TerminalSettingsEditor/Converters.idl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ namespace Microsoft.Terminal.Settings.Editor
FontWeightConverter();
};

runtimeclass InvertedBooleanConverter : [default] Windows.UI.Xaml.Data.IValueConverter
{
InvertedBooleanConverter();
};

runtimeclass InvertedBooleanToVisibilityConverter : [default] Windows.UI.Xaml.Data.IValueConverter
{
InvertedBooleanToVisibilityConverter();
Expand Down Expand Up @@ -48,6 +53,7 @@ namespace Microsoft.Terminal.Settings.Editor
{
StringIsNotDesktopConverter();
};

runtimeclass DesktopWallpaperToEmptyStringConverter : [default] Windows.UI.Xaml.Data.IValueConverter
{
DesktopWallpaperToEmptyStringConverter();
Expand Down
7 changes: 5 additions & 2 deletions src/cascadia/TerminalSettingsEditor/GlobalAppearance.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ the MIT License. See LICENSE in the project root for license information. -->
<DataTemplate x:DataType="local:EnumEntry" x:Key="EnumRadioButtonTemplate">
<RadioButton Content="{x:Bind EnumName, Mode=OneWay}"/>
</DataTemplate>

<local:InvertedBooleanConverter x:Key="InvertedBooleanConverter"/>
</ResourceDictionary>
</Page.Resources>

Expand Down Expand Up @@ -60,8 +62,9 @@ the MIT License. See LICENSE in the project root for license information. -->
</local:SettingContainer>

<!--Disable Animations-->
<local:SettingContainer x:Uid="Globals_DisableAnimations">
<ToggleSwitch IsOn="{x:Bind State.Globals.DisableAnimations, Mode=TwoWay}"/>
<!-- NOTE: the UID is "DisablePaneAnimationsReversed" not "DisablePaneAnimations". See GH#9124 for more details. -->
<local:SettingContainer x:Uid="Globals_DisableAnimationsReversed">
<ToggleSwitch IsOn="{x:Bind State.Globals.DisableAnimations, Mode=TwoWay, Converter={StaticResource InvertedBooleanConverter}}"/>
</local:SettingContainer>
</StackPanel>
</ScrollViewer>
Expand Down
28 changes: 28 additions & 0 deletions src/cascadia/TerminalSettingsEditor/InvertedBooleanConverter.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

#include "pch.h"
#include "InvertedBooleanConverter.h"
#include "InvertedBooleanConverter.g.cpp"

using namespace winrt::Windows;
using namespace winrt::Windows::UI::Xaml;

namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
{
Foundation::IInspectable InvertedBooleanConverter::Convert(Foundation::IInspectable const& value,
Windows::UI::Xaml::Interop::TypeName const& /* targetType */,
Foundation::IInspectable const& /* parameter */,
hstring const& /* language */)
{
return winrt::box_value(!winrt::unbox_value<bool>(value));
}

Foundation::IInspectable InvertedBooleanConverter::ConvertBack(Foundation::IInspectable const& value,
Windows::UI::Xaml::Interop::TypeName const& /* targetType */,
Foundation::IInspectable const& /*parameter*/,
hstring const& /* language */)
{
return winrt::box_value(!winrt::unbox_value<bool>(value));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

#pragma once

#include "InvertedBooleanConverter.g.h"
#include "../inc/cppwinrt_utils.h"

DECLARE_CONVERTER(winrt::Microsoft::Terminal::Settings::Editor, InvertedBooleanConverter);
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,6 @@
#pragma once

#include "InvertedBooleanToVisibilityConverter.g.h"
#include "Utils.h"
#include "../inc/cppwinrt_utils.h"

namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
{
struct InvertedBooleanToVisibilityConverter : InvertedBooleanToVisibilityConverterT<InvertedBooleanToVisibilityConverter>
{
InvertedBooleanToVisibilityConverter() = default;

Windows::Foundation::IInspectable Convert(Windows::Foundation::IInspectable const& value,
Windows::UI::Xaml::Interop::TypeName const& targetType,
Windows::Foundation::IInspectable const& parameter,
hstring const& language);

Windows::Foundation::IInspectable ConvertBack(Windows::Foundation::IInspectable const& value,
Windows::UI::Xaml::Interop::TypeName const& targetType,
Windows::Foundation::IInspectable const& parameter,
hstring const& language);
};
}

namespace winrt::Microsoft::Terminal::Settings::Editor::factory_implementation
{
BASIC_FACTORY(InvertedBooleanToVisibilityConverter);
}
DECLARE_CONVERTER(winrt::Microsoft::Terminal::Settings::Editor, InvertedBooleanToVisibilityConverter);
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
<ClInclude Include="FontWeightConverter.h">
<DependentUpon>Converters.idl</DependentUpon>
</ClInclude>
<ClInclude Include="InvertedBooleanConverter.h">
<DependentUpon>Converters.idl</DependentUpon>
</ClInclude>
<ClInclude Include="InvertedBooleanToVisibilityConverter.h">
<DependentUpon>Converters.idl</DependentUpon>
</ClInclude>
Expand Down Expand Up @@ -138,6 +141,9 @@
<ClCompile Include="FontWeightConverter.cpp">
<DependentUpon>Converters.idl</DependentUpon>
</ClCompile>
<ClCompile Include="InvertedBooleanConverter.cpp">
<DependentUpon>Converters.idl</DependentUpon>
</ClCompile>
<ClCompile Include="InvertedBooleanToVisibilityConverter.cpp">
<DependentUpon>Converters.idl</DependentUpon>
</ClCompile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -841,10 +841,10 @@
<comment>This is the object of "SettingContainer_OverrideIntro".</comment>
</data>
<data name="Globals_FocusFollowMouse.Header" xml:space="preserve">
<value>Enable Focus Follow Mouse mode</value>
<value>Automatically focus pane on mouse hover</value>
</data>
<data name="Globals_FocusFollowMouse.HelpText" xml:space="preserve">
<value>When checked, the terminal will the focus pane on mouse hover.</value>
<data name="Globals_DisableAnimationsReversed.Header" xml:space="preserve">
<value>Pane animations</value>
</data>
<data name="ColorScheme_TerminalColorsHeader.Text" xml:space="preserve">
<value>Terminal colors</value>
Expand Down

0 comments on commit 1774302

Please sign in to comment.