|
| 1 | +<UserControl xmlns="https://github.com/avaloniaui" |
| 2 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 3 | + xmlns:utils="clr-namespace:plugin_OpenVR.Utils" |
| 4 | + xmlns:pluginOpenVr="clr-namespace:plugin_OpenVR" |
| 5 | + xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia" |
| 6 | + x:Class="plugin_OpenVR.Pages.ActionsManager" |
| 7 | + MaxWidth="790" MinWidth="790" MaxHeight="475" MinHeight="475" |
| 8 | + x:Name="Root"> |
| 9 | + |
| 10 | + <!--Inner grid--> |
| 11 | + <Grid VerticalAlignment="Stretch" MaxWidth="790" MinWidth="790" |
| 12 | + MaxHeight="475" MinHeight="475" Margin="20" |
| 13 | + ColumnDefinitions="170,40,*" x:Name="OuterGrid"> |
| 14 | + |
| 15 | + <!--The selector part--> |
| 16 | + <Border Grid.Column="0" Margin="-20" Classes="cardSingle" Padding="30"> |
| 17 | + <Grid RowDefinitions="*,Auto"> |
| 18 | + <ScrollViewer HorizontalAlignment="Stretch" VerticalAlignment="Stretch" |
| 19 | + VerticalScrollBarVisibility="Visible" Grid.Row="0" |
| 20 | + Padding="20,0, 13, 0" Margin="-20,0, -15, 0"> |
| 21 | + <ListBox x:Name="ActionsListView" |
| 22 | + SelectionChanged="ActionsListView_OnSelectionChanged" |
| 23 | + ItemsSource="{Binding #Root.CustomActions, Mode=OneWay}"> |
| 24 | + <ListBox.ItemTemplate> |
| 25 | + <DataTemplate x:DataType="pluginOpenVr:InputAction"> |
| 26 | + <TextBlock Text="{Binding NameLocalized}" /> |
| 27 | + </DataTemplate> |
| 28 | + </ListBox.ItemTemplate> |
| 29 | + </ListBox> |
| 30 | + </ScrollViewer> |
| 31 | + |
| 32 | + <StackPanel Orientation="Vertical" Grid.Row="1"> |
| 33 | + <Button Height="36" Click="NewActionItem_OnClick" |
| 34 | + BorderThickness="0" Background="Transparent"> |
| 35 | + <Grid ColumnDefinitions="Auto, *" ColumnSpacing="6"> |
| 36 | + <Viewbox MaxHeight="16" MaxWidth="16"> |
| 37 | + <controls:SymbolIcon Symbol="Add" /> |
| 38 | + </Viewbox> |
| 39 | + <TextBlock Text="{utils:Translate '/InputActions/Picker/Options/New'}" |
| 40 | + Grid.Column="1" VerticalAlignment="Center" FontSize="15" /> |
| 41 | + </Grid> |
| 42 | + </Button> |
| 43 | + </StackPanel> |
| 44 | + </Grid> |
| 45 | + </Border> |
| 46 | + |
| 47 | + <!--The preview part--> |
| 48 | + <Grid Grid.Column="2" RowDefinitions="Auto,Auto,*" |
| 49 | + Margin="-8,15,15,15" x:Name="PreviewGrid"> |
| 50 | + <TextBlock FontWeight="SemiBold" |
| 51 | + Text="{Binding #Root.SelectedActionName, Mode=OneWay}" |
| 52 | + IsVisible="{Binding #Root.IsAddingNewActionInverse, Mode=OneWay}" |
| 53 | + VerticalAlignment="Top" HorizontalAlignment="Left" MaxWidth="370" |
| 54 | + FontSize="26" Margin="0,-7,0,0" TextTrimming="CharacterEllipsis" /> |
| 55 | + |
| 56 | + <TextBox FontWeight="SemiBold" |
| 57 | + Text="{Binding #Root.SelectedActionName, Mode=TwoWay}" |
| 58 | + IsVisible="{Binding #Root.IsAddingNewAction, Mode=OneWay}" Grid.Row="0" |
| 59 | + Watermark="{utils:Translate '/SettingsPage/Placeholders/NewAction'}" |
| 60 | + VerticalAlignment="Top" HorizontalAlignment="Left" FontSize="20" |
| 61 | + Margin="0,-5,0,5" Background="Transparent" MaxWidth="370" MinWidth="370" |
| 62 | + AcceptsReturn="False" TextWrapping="NoWrap" /> |
| 63 | + |
| 64 | + <SplitButton Click="ActionTestButton_OnClick" x:Name="ActionRemoveSplitButton" |
| 65 | + IsEnabled="{Binding #Root.ActionValid, Mode=OneWay}" |
| 66 | + IsVisible="{Binding #Root.IsAddingNewActionInverse, Mode=OneWay}" |
| 67 | + Content="{utils:Translate '/InputActions/Buttons/Test'}" |
| 68 | + HorizontalAlignment="Right" VerticalAlignment="Top" Grid.Row="0" |
| 69 | + Margin="0,-2,0,0"> |
| 70 | + <SplitButton.Flyout> |
| 71 | + <Flyout Placement="Bottom"> |
| 72 | + <Button Click="RemoveAction_OnClick" |
| 73 | + IsEnabled="{Binding #Root.ActionValid, Mode=OneWay}" |
| 74 | + Content="{utils:Translate '/InputActions/Buttons/Remove'}" /> |
| 75 | + </Flyout> |
| 76 | + </SplitButton.Flyout> |
| 77 | + </SplitButton> |
| 78 | + |
| 79 | + <Button Classes="accent" Click="AddNewAction_OnClick" |
| 80 | + IsEnabled="{Binding #Root.ActionValid, Mode=OneWay}" |
| 81 | + IsVisible="{Binding #Root.IsAddingNewAction, Mode=OneWay}" |
| 82 | + Content="{utils:Translate '/InputActions/Buttons/Add'}" |
| 83 | + HorizontalAlignment="Right" VerticalAlignment="Top" Grid.Row="0" |
| 84 | + Margin="0,-2,0,0" /> |
| 85 | + |
| 86 | + <!--"Select to preview" grid--> |
| 87 | + <Grid Grid.Row="2" Opacity="0.75" |
| 88 | + IsVisible="{Binding #Root.SelectedActionInvalid, Mode=OneWay}"> |
| 89 | + <Grid.ColumnDefinitions> |
| 90 | + <ColumnDefinition Width="*" /> |
| 91 | + <ColumnDefinition Width="8*" MinWidth="250" MaxWidth="500" /> |
| 92 | + <ColumnDefinition Width="*" /> |
| 93 | + </Grid.ColumnDefinitions> |
| 94 | + <StackPanel Grid.Column="1" Orientation="Vertical" VerticalAlignment="Center" |
| 95 | + HorizontalAlignment="Center" Margin="0,-35,0,0"> |
| 96 | + <controls:FontIcon FontSize="120" Margin="0,0,0,25" Glyph="" /> |
| 97 | + <TextBlock HorizontalAlignment="Center" TextWrapping="Wrap" FontSize="14" |
| 98 | + TextTrimming="CharacterEllipsis" |
| 99 | + Text="{utils:Translate '/InputActions/Picker/NoSelection'}" /> |
| 100 | + </StackPanel> |
| 101 | + </Grid> |
| 102 | + |
| 103 | + <!--Actual preview data--> |
| 104 | + <Grid Grid.Row="2" RowDefinitions="Auto, *, Auto" RowSpacing="12" |
| 105 | + IsVisible="{Binding #Root.SelectedActionValid, Mode=OneWay}" |
| 106 | + Opacity="{Binding #Root.SelectedActionValidOpacity, Mode=OneWay}"> |
| 107 | + <Grid.Transitions> |
| 108 | + <Transitions> |
| 109 | + <DoubleTransition Property="Opacity" Duration="0:0:0.3" |
| 110 | + Easing="CircularEaseInOut" /> |
| 111 | + </Transitions> |
| 112 | + </Grid.Transitions> |
| 113 | + |
| 114 | + <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" FontSize="14" |
| 115 | + Grid.Row="0" TextAlignment="Left" Margin="2,0,0,0" |
| 116 | + Text="{Binding #Root.SelectedActionDescription, Mode=OneWay}" |
| 117 | + Opacity="0.75" /> |
| 118 | + <TextBox Grid.Row="1" Text="{Binding #Root.SelectedActionCode, Mode=TwoWay}" |
| 119 | + VerticalAlignment="Stretch" AcceptsReturn="True" TextWrapping="Wrap" |
| 120 | + Watermark="{utils:Translate '/InputActions/Code/Input'}" /> |
| 121 | + <TextBox Grid.Row="2" x:Name="TestResultsBox" IsReadOnly="True" |
| 122 | + IsEnabled="{Binding #Root.IsAddingNewActionInverse, Mode=OneWay}" |
| 123 | + Text="{utils:Translate '/InputActions/Code/Test'}" /> |
| 124 | + </Grid> |
| 125 | + </Grid> |
| 126 | + </Grid> |
| 127 | +</UserControl> |
0 commit comments