Skip to content

Commit

Permalink
Fix text wrap in plugin manager and add curve join shortcut
Browse files Browse the repository at this point in the history
  • Loading branch information
willtrnr committed May 24, 2021
1 parent 9746760 commit d461c75
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 16 deletions.
29 changes: 16 additions & 13 deletions AffinityEx.Launcher/PluginsManagerDialog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:affui="clr-namespace:Serif.Affinity.UI;assembly=Serif.Affinity"
Title="Plugins Manager" SizeToContent="WidthAndHeight" ResizeMode="NoResize" WindowStartupLocation="CenterOwner">
Title="Plugins Manager"
SizeToContent="WidthAndHeight"
WindowStartupLocation="CenterOwner"
>
<FrameworkElement.Resources>
<ResourceDictionary>
<Style x:Key="{x:Type ListBoxItem}" TargetType="{x:Type ListBoxItem}" BasedOn="{StaticResource ListBoxItemBase}">
Expand All @@ -19,44 +22,44 @@
</Style>
</ResourceDictionary>
</FrameworkElement.Resources>
<Border Width="500" Style="{DynamicResource DialogRootContainer}">
<Border Style="{DynamicResource DialogRootContainer}" Width="600">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid Grid.Row="0" Style="{StaticResource InnerGridStyle}">
<Grid Grid.Row="0" Style="{StaticResource InnerGridStyle}" MinHeight="300" VerticalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="200" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid Grid.Column="0" Style="{StaticResource InnerGridStyle}">
<Grid Grid.Column="0" Style="{StaticResource InnerGridStyle}" VerticalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>
<Label Grid.Row="0" Content="Plugins" />
<ListBox Grid.Row="1" x:Name="Plugins" Width="160" Height="215" AlternationCount="2" ItemsSource="{Binding Plugins}" SelectedIndex="{Binding SelectedPluginIndex, Mode=TwoWay}">
<ListBox Grid.Row="1" x:Name="Plugins" AlternationCount="2" ItemsSource="{Binding Plugins}" SelectedIndex="{Binding SelectedPluginIndex, Mode=TwoWay}">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name, Mode=OneWay}" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
<Grid Grid.Column="1" x:Name="SelectedPlugin" DataContext="{Binding SelectedPlugin, Mode=OneWay}" Style="{StaticResource InnerGridStyle}" VerticalAlignment="Top">
<Grid Grid.Column="1" x:Name="SelectedPlugin" DataContext="{Binding SelectedPlugin, Mode=OneWay}" Style="{StaticResource InnerGridStyle}" VerticalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>
<Label Grid.Row="0" x:Name="SelectedPluginName" Content="{Binding Name, Mode=OneWay}" FontWeight="Bold" />
<TextBlock Grid.Row="1" x:Name="SelectedPluginDescription" Text="{Binding Description, Mode=OneWay}" TextWrapping="Wrap" />
<TextBlock Grid.Row="2">
<TextBlock Grid.Row="1">
<Hyperlink x:Name="SelectedPluginHomepageUrl" NavigateUri="{Binding HomepageUrl, Mode=OneWay}" RequestNavigate="SelectedPluginHomepageUrl_RequestNavigate">
<TextBlock Text="{Binding HomepageUrl}" />
</Hyperlink>
</TextBlock>
<TextBlock Grid.Row="2" x:Name="SelectedPluginDescription" Text="{Binding Description, Mode=OneWay}" TextWrapping="Wrap" />
</Grid>
</Grid>
<Grid Grid.Row="1" Style="{StaticResource InnerGridStyle}">
Expand Down
8 changes: 5 additions & 3 deletions AffinityEx.Plugins/DesignerExtraShortcutsPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ public override WorkspaceShortcuts GetShortcuts(Workspace workspace) {
switch (workspace.Name) {
case "Vector":
shortcuts.Commands = new List<WorkspaceCommandShortcut>() {
// In Node edit tool, bind 'W' to toggle Transform Mode
// With Node edit tool, bind 'W' to toggle Transform Mode
new WorkspaceCommandShortcut(typeof(NodeToolTransformModeCommand), Key.W),
// In Node edit tool, bind 'S' to smooth node
// With Node edit tool, bind 'S' to convert to smooth node
new WorkspaceCommandShortcut(typeof(ChangeCurveNodeTypeSmoothCommand), Key.S),
// In Node edit tool, bind 'Shift+S' to sharp node
// With Node edit tool, bind 'Shift+S' to convert to sharp node
new WorkspaceCommandShortcut(typeof(ChangeCurveNodeTypeSharpCommand), Key.S, ModifierKeys.Shift),
// With Node edit tool, bind 'Shift+J' to join curves
new WorkspaceCommandShortcut(typeof(JoinCurvesCommand), Key.J, ModifierKeys.Shift),
};
break;
}
Expand Down

0 comments on commit d461c75

Please sign in to comment.