Improved input editor theming
This commit is contained in:
@@ -12,11 +12,6 @@ menu-highlight = #505050
|
||||
menu-border = #FFFFFF
|
||||
menu-checked = #5A5A5A
|
||||
|
||||
button-foreground = #DDDDDD
|
||||
button-background = #505050
|
||||
button-hover = #555555
|
||||
button-border = #707070
|
||||
|
||||
|
||||
[light]
|
||||
|
||||
@@ -30,8 +25,3 @@ menu-background = #DFDFDF
|
||||
menu-highlight = #BFBFBF
|
||||
menu-border = #6A6A6A
|
||||
menu-checked = #AAAAAA
|
||||
|
||||
button-foreground = #000000
|
||||
button-background = #BBBBBB
|
||||
button-hover = #CCCCCC
|
||||
button-border = #6A6A6A
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
>
|
||||
|
||||
<Window.Resources>
|
||||
<Style x:Key="DataGrid_Font_Centering" TargetType="{x:Type DataGridCell}">
|
||||
<Style x:Key="DataGridFontCentering" TargetType="{x:Type DataGridCell}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type DataGridCell}">
|
||||
@@ -29,6 +29,19 @@
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<LinearGradientBrush x:Key="HeaderBrush" StartPoint="0.5,0" EndPoint="0.5,1">
|
||||
<GradientStop Color="Gray" Offset="0"/>
|
||||
<GradientStop Color="Gray" Offset="1"/>
|
||||
<GradientStop Color="#323232" Offset="0.5"/>
|
||||
</LinearGradientBrush>
|
||||
|
||||
<Style x:Key="HeaderStyle" TargetType="DataGridColumnHeader">
|
||||
<Setter Property="Background" Value="{StaticResource HeaderBrush}" />
|
||||
<Setter Property="Foreground" Value="White" />
|
||||
<Setter Property="MinHeight" Value="22" />
|
||||
<Setter Property="Cursor" Value="Hand" />
|
||||
</Style>
|
||||
</Window.Resources>
|
||||
|
||||
<Grid>
|
||||
@@ -46,15 +59,27 @@
|
||||
/>
|
||||
|
||||
<DataGrid
|
||||
x:Name="DataGrid"
|
||||
Name="DataGrid"
|
||||
Grid.Row="1"
|
||||
CommandManager.PreviewCanExecute="DataGrid_PreviewCanExecute"
|
||||
AutoGenerateColumns="False"
|
||||
CellStyle="{StaticResource DataGrid_Font_Centering}"
|
||||
ColumnHeaderStyle="{StaticResource HeaderStyle}"
|
||||
Foreground="{Binding Theme.Foreground}"
|
||||
Background="{Binding Theme.Background}"
|
||||
RowBackground="{Binding Theme.Background}"
|
||||
HorizontalGridLinesBrush="{Binding Theme.Foreground}"
|
||||
VerticalGridLinesBrush="{Binding Theme.Foreground}"
|
||||
CellStyle="{StaticResource DataGridFontCentering}"
|
||||
>
|
||||
|
||||
<DataGrid.Resources>
|
||||
<Style BasedOn="{StaticResource {x:Type DataGridColumnHeader}}" TargetType="{x:Type DataGridColumnHeader}">
|
||||
<Setter Property="Background" Value="{Binding DataContext.Theme.Background, ElementName=DataGrid}" />
|
||||
</Style>
|
||||
</DataGrid.Resources>
|
||||
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="Menu" Binding="{Binding Path}"/>
|
||||
<DataGridTextColumn Header="Menu" Binding="{Binding Path}"/>
|
||||
|
||||
<DataGridTemplateColumn Header="Input">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
@@ -65,9 +90,8 @@
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
|
||||
<DataGridTextColumn Header="Command" Binding="{Binding Command}" MaxWidth="330" />
|
||||
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
|
||||
@@ -42,6 +42,7 @@ namespace mpvnet
|
||||
if (SearchControl.SearchTextBox.Text == "?")
|
||||
{
|
||||
SearchControl.SearchTextBox.Text = "";
|
||||
|
||||
Msg.ShowInfo("Filtering",
|
||||
"Reduce the filter scope with:" + BR2 +
|
||||
"i input" + BR2 +
|
||||
@@ -53,9 +54,13 @@ namespace mpvnet
|
||||
|
||||
bool Filter(CommandItem item)
|
||||
{
|
||||
if (item.Command == "") return false;
|
||||
if (item.Command == "")
|
||||
return false;
|
||||
|
||||
string searchText = SearchControl.SearchTextBox.Text.ToLower();
|
||||
if (searchText == "" || searchText == "?") return true;
|
||||
|
||||
if (searchText == "" || searchText == "?")
|
||||
return true;
|
||||
|
||||
if (searchText.Length == 1)
|
||||
return item.Input.ToLower().Replace("ctrl+", "").Replace("shift+", "").Replace("alt+", "") == searchText.ToLower();
|
||||
@@ -74,8 +79,8 @@ namespace mpvnet
|
||||
else if (searchText.StartsWith("c ") || searchText.StartsWith("c:"))
|
||||
return item.Command.ToLower().Contains(searchText.Substring(2).Trim());
|
||||
else if (item.Command.ToLower().Contains(searchText) ||
|
||||
item.Path.ToLower().Contains(searchText) ||
|
||||
item.Input.ToLower().Contains(searchText))
|
||||
item.Path.ToLower().Contains(searchText) ||
|
||||
item.Input.ToLower().Contains(searchText))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -85,7 +90,10 @@ namespace mpvnet
|
||||
void ButtonClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
CommandItem item = ((Button)e.Source).DataContext as CommandItem;
|
||||
if (item is null) return;
|
||||
|
||||
if (item is null)
|
||||
return;
|
||||
|
||||
LearnWindow w = new LearnWindow();
|
||||
w.Owner = this;
|
||||
w.InputItem = item;
|
||||
@@ -109,10 +117,12 @@ namespace mpvnet
|
||||
foreach (string line in Properties.Resources.input_conf.Split(new[] { "\r\n" }, StringSplitOptions.None))
|
||||
{
|
||||
string test = line.Trim();
|
||||
if (test == "" || test.StartsWith("#")) text += test + "\r\n";
|
||||
|
||||
if (test == "" || test.StartsWith("#"))
|
||||
text += test + BR;
|
||||
}
|
||||
|
||||
text = "\r\n" + text.Trim() + "\r\n\r\n";
|
||||
text = BR + text.Trim() + BR2;
|
||||
|
||||
foreach (CommandItem item in CommandItem.Items)
|
||||
{
|
||||
@@ -127,8 +137,9 @@ namespace mpvnet
|
||||
if (item.Path.Trim() != "")
|
||||
line = line.PadRight(40) + " #menu: " + item.Path;
|
||||
|
||||
text += line + "\r\n";
|
||||
text += line + BR;
|
||||
}
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user