Skip to content
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

Added option to allow the space character to show as ␣ #171

Merged
merged 2 commits into from
Mar 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Carnac.Logic/Models/PopupSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,6 @@ public string SortDescription
public bool ShowApplicationIcon { get; set; }
public bool SettingsConfigured { get; set; }
public bool ShowOnlyModifiers { get; set; }
public bool ShowSpaceAsIcon { get; set; }
}
}
21 changes: 18 additions & 3 deletions src/Carnac/UI/KeyShowView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,24 @@
Padding="0" />
</StackPanel>
<DataTemplate.Triggers>
<DataTrigger Value=" " Binding="{Binding .}">
<Setter TargetName="regular" Property="Control.MinWidth" Value="10" />
</DataTrigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding .}" Value=" " />
<Condition
Binding="{Binding DataContext.Settings.ShowSpaceAsIcon, RelativeSource={RelativeSource AncestorType=Window}}"
Value="True" />
</MultiDataTrigger.Conditions>
<Setter TargetName="regular" Property="TextBlock.Text" Value="␣" />
</MultiDataTrigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding .}" Value=" " />
<Condition
Binding="{Binding DataContext.Settings.ShowSpaceAsIcon, RelativeSource={RelativeSource AncestorType=Window}}"
Value="False" />
</MultiDataTrigger.Conditions>
<Setter TargetName="regular" Property="Control.MinWidth" Value="10"/>
</MultiDataTrigger>
<DataTrigger Value="Return" Binding="{Binding .}">
<Setter TargetName="KeyCapBorder" Property="Control.Visibility" Value="Visible" />
<Setter TargetName="KeyCap" Property="Text" Value="↵" />
Expand Down
5 changes: 4 additions & 1 deletion src/Carnac/UI/PreferencesView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,10 @@
ItemsSource="{Binding AvailableColors}"
ItemTemplate="{StaticResource ColourPickerTemplate}" />
</ui:PreferencesField>


<ui:PreferencesField Header="Show Space as ␣">
<CheckBox IsChecked="{Binding Settings.ShowSpaceAsIcon}" Content="shows space as ' ␣ ' instead of ' '" />
</ui:PreferencesField>
<ui:PreferencesField Header="Shortcuts Only">
<CheckBox IsChecked="{Binding Settings.DetectShortcutsOnly}" Content="shows only keys which are listed in keymaps folder" />
</ui:PreferencesField>
Expand Down