Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/Spectron/App.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@
<NativeMenu.Menu>
<NativeMenu>
<NativeMenuItem Header="About Spectron" Click="AboutMenuItem_OnClick" />
<NativeMenuItemSeparator/>
<NativeMenuItem Header="Settings..." Gesture="Cmd+," Click="SettingsMenuItem_OnClick"/>
</NativeMenu>
</NativeMenu.Menu>

<Application.Styles>
<FluentTheme>
<FluentTheme.Palettes>
<ColorPaletteResources x:Key="Light" Accent="#ff0073cf" AltHigh="White" AltLow="White" AltMedium="White" AltMediumHigh="White" AltMediumLow="White" BaseHigh="Black" BaseLow="#ffcccccc" BaseMedium="#ff898989" BaseMediumHigh="#ff5d5d5d" BaseMediumLow="#ff737373" ChromeAltLow="#ff5d5d5d" ChromeBlackHigh="Black" ChromeBlackLow="#ffcccccc" ChromeBlackMedium="#ff5d5d5d" ChromeBlackMediumLow="#ff898989" ChromeDisabledHigh="#ffcccccc" ChromeDisabledLow="#ff898989" ChromeGray="#ff737373" ChromeHigh="#ffcccccc" ChromeLow="#ffececec" ChromeMedium="#ffe6e6e6" ChromeMediumLow="#ffececec" ChromeWhite="White" ListLow="#ffe6e6e6" ListMedium="#ffcccccc" RegionColor="White" />
<ColorPaletteResources x:Key="Light" Accent="#ff0073cf" AltHigh="White" AltLow="White" AltMedium="White" AltMediumHigh="White" AltMediumLow="White" BaseHigh="Black" BaseLow="#ffc8c8c8" BaseMedium="#ff878787" BaseMediumHigh="#ff5b5b5b" BaseMediumLow="#ff717171" ChromeAltLow="#ff5b5b5b" ChromeBlackHigh="Black" ChromeBlackLow="#ffc8c8c8" ChromeBlackMedium="#ff5b5b5b" ChromeBlackMediumLow="#ff878787" ChromeDisabledHigh="#ffc8c8c8" ChromeDisabledLow="#ff878787" ChromeGray="#ff717171" ChromeHigh="#ffc8c8c8" ChromeLow="#ffebebeb" ChromeMedium="#ffe4e4e4" ChromeMediumLow="#ffebebeb" ChromeWhite="White" ListLow="#ffe4e4e4" ListMedium="#ffc8c8c8" RegionColor="#ffd8d8d8" />
<ColorPaletteResources x:Key="Dark" Accent="#ffcc4d11" AltHigh="Black" AltLow="Black" AltMedium="Black" AltMediumHigh="Black" AltMediumLow="Black" BaseHigh="White" BaseLow="#ff2f7bad" BaseMedium="#ff8dbfdf" BaseMediumHigh="#ffa5d0ec" BaseMediumLow="#ff5e9dc6" ChromeAltLow="#ffa5d0ec" ChromeBlackHigh="Black" ChromeBlackLow="#ffa5d0ec" ChromeBlackMedium="Black" ChromeBlackMediumLow="Black" ChromeDisabledHigh="#ff2f7bad" ChromeDisabledLow="#ff8dbfdf" ChromeGray="#ff76aed3" ChromeHigh="#ff76aed3" ChromeLow="#ff093b73" ChromeMedium="#ff134b82" ChromeMediumLow="#ff266b9f" ChromeWhite="White" ListLow="#ff134b82" ListMedium="#ff2f7bad" RegionColor="#ff030a12" />
</FluentTheme.Palettes>
</FluentTheme>
Expand Down
10 changes: 0 additions & 10 deletions src/Spectron/App.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,4 @@ private void AboutMenuItem_OnClick(object? sender, EventArgs e)
var aboutView = new AboutView();
aboutView.ShowDialog(MainWindow);
}

private void SettingsMenuItem_OnClick(object? sender, EventArgs e)
{
if (MainWindow == null)
{
return;
}

MainWindowViewModel?.OpenPreferencesWindow();
}
}
29 changes: 23 additions & 6 deletions src/Spectron/Controls/GamepadControlsMapping.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<converters:TypeMatchConverter x:Key="TypeMatchConverter"/>
</UserControl.Resources>

<Grid RowDefinitions="*,50">
<Grid ColumnDefinitions="*,100">
<DataGrid Name="DataGrid"
ItemsSource="{Binding Mappings}"
Margin="10"
Expand All @@ -30,19 +30,19 @@

<DataGrid.Columns>
<DataGridTextColumn Header="Button" Binding="{Binding Name}" Width="200"/>
<DataGridTemplateColumn Header="Action" >
<DataGridTemplateColumn Header="Action" Width="*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock
Width="250"
HorizontalAlignment="Stretch"
Padding="10 0 0 0"
Text="{Binding SelectedAction.Name}" VerticalAlignment="Center" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox
Width="250"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
Padding="10 0 0 0"
ItemsSource="{Binding Actions}"
Expand Down Expand Up @@ -75,7 +75,24 @@
</DataGrid.Columns>
</DataGrid>

<TextBlock Grid.Row="1" TextAlignment="Left" Margin="10 0 0 0" Text="Press a button to locate the mapping" FontSize="10" VerticalAlignment="Top"/>
<Button Grid.Row="1" HorizontalAlignment="Right" Margin="0 0 10 0" Content="Defaults" Command="{Binding SetDefaultMappingCommand}"/>
<StackPanel
Grid.Column="1"
Margin="0 0 0 10"
VerticalAlignment="Bottom">

<TextBlock
Text="Press gamepad button to find the mapping"
TextWrapping="Wrap"
HorizontalAlignment="Center"
TextAlignment="Center"
Margin="0 0 0 20"
Opacity=".6"
FontSize="12"/>

<Button
Content="Defaults"
HorizontalAlignment="Center"
Command="{Binding SetDefaultMappingCommand}"/>
</StackPanel>
</Grid>
</UserControl>
6 changes: 6 additions & 0 deletions src/Spectron/Controls/MainMenu.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
<converters:ValueEqualityConverter x:Key="ValueEqualityConverter"/>
</UserControl.Resources>

<UserControl.Styles>
<Style Selector="MenuItem">
<Setter Property="Padding" Value="10 6 10 6"/>
</Style>
</UserControl.Styles>

<Menu Focusable="False">
<MenuItem Header="File" Padding="10 0 10 0" IsTabStop="False" Focusable="False">
<MenuItem Header="Load..." InputGesture="{OnPlatform Ctrl+O, macOS=Cmd+O}" Command="{Binding LoadFileCommand}"/>
Expand Down
Loading