Skip to content

Commit 2614c59

Browse files
committed
change UI theme
1 parent 7551bdb commit 2614c59

4 files changed

Lines changed: 198 additions & 42 deletions

File tree

GitContentSearch.UI/App.axaml

Lines changed: 106 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,114 @@
11
<Application xmlns="https://github.com/avaloniaui"
22
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
33
x:Class="GitContentSearch.UI.App"
4-
RequestedThemeVariant="Default">
4+
RequestedThemeVariant="Dark">
55

66
<Application.Styles>
77
<FluentTheme />
8+
9+
<Style Selector="Window">
10+
<Setter Property="Background" Value="#1A1B1F"/>
11+
</Style>
12+
13+
<!-- Base Button Style -->
14+
<Style Selector="Button">
15+
<Setter Property="CornerRadius" Value="8"/>
16+
<Setter Property="Padding" Value="16,8"/>
17+
<Setter Property="FontWeight" Value="SemiBold"/>
18+
<Setter Property="BorderThickness" Value="1"/>
19+
</Style>
20+
21+
<!-- Primary Button Style (for main actions like Start Search) -->
22+
<Style Selector="Button.Primary">
23+
<Setter Property="Background" Value="#00A3D9"/>
24+
<Setter Property="Foreground" Value="Black"/>
25+
<Setter Property="BorderThickness" Value="0"/>
26+
</Style>
27+
28+
<Style Selector="Button.Primary:pointerover /template/ ContentPresenter">
29+
<Setter Property="Background" Value="#00B8F3"/>
30+
<Setter Property="Foreground" Value="Black"/>
31+
</Style>
32+
33+
<Style Selector="Button.Primary:pressed /template/ ContentPresenter">
34+
<Setter Property="Background" Value="#008DBB"/>
35+
<Setter Property="Foreground" Value="Black"/>
36+
<Setter Property="RenderTransform" Value="scale(0.98)"/>
37+
</Style>
38+
39+
<!-- Secondary Button Style (for actions like Browse) -->
40+
<Style Selector="Button.Secondary">
41+
<Setter Property="Background" Value="Transparent"/>
42+
<Setter Property="Foreground" Value="#00A3D9"/>
43+
<Setter Property="BorderBrush" Value="#00A3D9"/>
44+
</Style>
45+
46+
<Style Selector="Button.Secondary:pointerover /template/ ContentPresenter">
47+
<Setter Property="Background" Value="#1A00A3D9"/>
48+
<Setter Property="Foreground" Value="#00B8F3"/>
49+
<Setter Property="BorderBrush" Value="#00B8F3"/>
50+
</Style>
51+
52+
<Style Selector="Button.Secondary:pressed /template/ ContentPresenter">
53+
<Setter Property="Background" Value="#2A00A3D9"/>
54+
<Setter Property="Foreground" Value="#008DBB"/>
55+
<Setter Property="BorderBrush" Value="#008DBB"/>
56+
<Setter Property="RenderTransform" Value="scale(0.98)"/>
57+
</Style>
58+
59+
<!-- Disabled States for Both Button Types -->
60+
<Style Selector="Button.Primary:disabled /template/ ContentPresenter">
61+
<Setter Property="Background" Value="#4D00A3D9"/>
62+
<Setter Property="Foreground" Value="#99000000"/>
63+
</Style>
64+
65+
<Style Selector="Button.Secondary:disabled /template/ ContentPresenter">
66+
<Setter Property="Background" Value="Transparent"/>
67+
<Setter Property="Foreground" Value="#4D00A3D9"/>
68+
<Setter Property="BorderBrush" Value="#4D00A3D9"/>
69+
</Style>
70+
71+
<!-- Template Binding for Both Button Types -->
72+
<Style Selector="Button /template/ ContentPresenter">
73+
<Setter Property="Background" Value="{TemplateBinding Background}"/>
74+
<Setter Property="BorderBrush" Value="{TemplateBinding BorderBrush}"/>
75+
<Setter Property="BorderThickness" Value="{TemplateBinding BorderThickness}"/>
76+
<Setter Property="CornerRadius" Value="{TemplateBinding CornerRadius}"/>
77+
</Style>
78+
79+
<!-- TextBox Styles -->
80+
<Style Selector="TextBox">
81+
<Setter Property="Background" Value="#2A2B2F"/>
82+
<Setter Property="Foreground" Value="White"/>
83+
<Setter Property="CornerRadius" Value="8"/>
84+
<Setter Property="Padding" Value="12,8"/>
85+
<Setter Property="BorderThickness" Value="1"/>
86+
<Setter Property="BorderBrush" Value="#3A3B3F"/>
87+
</Style>
88+
89+
<Style Selector="TextBox:focus">
90+
<Setter Property="BorderBrush" Value="#00A3D9"/>
91+
</Style>
92+
93+
<!-- CheckBox Styles -->
94+
<Style Selector="CheckBox">
95+
<Setter Property="Foreground" Value="White"/>
96+
</Style>
97+
98+
<Style Selector="CheckBox:checked /template/ Border#NormalRectangle">
99+
<Setter Property="Background" Value="#00A3D9"/>
100+
<Setter Property="BorderBrush" Value="#00A3D9"/>
101+
</Style>
102+
103+
<!-- TextBlock Styles -->
104+
<Style Selector="TextBlock">
105+
<Setter Property="Foreground" Value="#FFFFFF"/>
106+
</Style>
107+
108+
<!-- ProgressBar Styles -->
109+
<Style Selector="ProgressBar">
110+
<Setter Property="Foreground" Value="#00A3D9"/>
111+
<Setter Property="Background" Value="#2A2B2F"/>
112+
</Style>
8113
</Application.Styles>
9114
</Application>

GitContentSearch.UI/Views/MainWindow.axaml

Lines changed: 57 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,79 +7,104 @@
77
x:Class="GitContentSearch.UI.Views.MainWindow"
88
x:DataType="vm:MainWindowViewModel"
99
Icon="/Assets/gitcontentsearch.ico"
10-
Title="Git Content Search">
10+
Title="Git Content Search"
11+
MinWidth="700"
12+
MinHeight="600"
13+
WindowStartupLocation="CenterScreen">
1114

1215
<Design.DataContext>
1316
<vm:MainWindowViewModel/>
1417
</Design.DataContext>
1518

16-
<Grid Margin="20" RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,*">
19+
<Grid Margin="24" RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,*">
1720
<!-- File Path -->
18-
<Grid Grid.Row="0" ColumnDefinitions="Auto,*,Auto" Margin="0,5">
19-
<TextBlock Grid.Column="0" Text="File Path:" VerticalAlignment="Center" Width="120"/>
20-
<TextBox Grid.Column="1" Text="{Binding FilePath}" Margin="5,0"/>
21-
<Button Grid.Column="2" Content="Browse" Command="{Binding BrowseFilePathCommand}" Margin="5,0"/>
21+
<Grid Grid.Row="0" ColumnDefinitions="Auto,*,Auto" Margin="0,8">
22+
<TextBlock Grid.Column="0" Text="File Path" VerticalAlignment="Center" Width="140" FontWeight="Medium"/>
23+
<TextBox Grid.Column="1" Text="{Binding FilePath}" Margin="8,0"/>
24+
<Button Grid.Column="2"
25+
Classes="Secondary"
26+
Content="Browse"
27+
Command="{Binding BrowseFilePathCommand}"
28+
Margin="8,0"/>
2229
</Grid>
2330

2431
<!-- Search String -->
25-
<Grid Grid.Row="1" ColumnDefinitions="Auto,*" Margin="0,5">
26-
<TextBlock Grid.Column="0" Text="Search String:" VerticalAlignment="Center" Width="120"/>
27-
<TextBox Grid.Column="1" Text="{Binding SearchString}" Margin="5,0"/>
32+
<Grid Grid.Row="1" ColumnDefinitions="Auto,*" Margin="0,8">
33+
<TextBlock Grid.Column="0" Text="Search String" VerticalAlignment="Center" Width="140" FontWeight="Medium"/>
34+
<TextBox Grid.Column="1" Text="{Binding SearchString}" Margin="8,0"/>
2835
</Grid>
2936

3037
<!-- Commit Range -->
31-
<Grid Grid.Row="2" ColumnDefinitions="Auto,*,Auto,*" Margin="0,5">
32-
<TextBlock Grid.Column="0" Text="Earliest Commit:" VerticalAlignment="Center" Width="120"/>
33-
<TextBox Grid.Column="1" Text="{Binding EarliestCommit}" Margin="5,0"/>
34-
<TextBlock Grid.Column="2" Text="Latest Commit:" VerticalAlignment="Center" Margin="10,0"/>
35-
<TextBox Grid.Column="3" Text="{Binding LatestCommit}" Margin="5,0"/>
38+
<Grid Grid.Row="2" ColumnDefinitions="Auto,*,Auto,*" Margin="0,8">
39+
<TextBlock Grid.Column="0" Text="Earliest Commit" VerticalAlignment="Center" Width="140" FontWeight="Medium"/>
40+
<TextBox Grid.Column="1" Text="{Binding EarliestCommit}" Margin="8,0"/>
41+
<TextBlock Grid.Column="2" Text="Latest Commit" VerticalAlignment="Center" Margin="16,0" FontWeight="Medium"/>
42+
<TextBox Grid.Column="3" Text="{Binding LatestCommit}" Margin="8,0"/>
3643
</Grid>
3744

3845
<!-- Working Directory -->
39-
<Grid Grid.Row="3" ColumnDefinitions="Auto,*,Auto" Margin="0,5">
40-
<TextBlock Grid.Column="0" Text="Working Directory:" VerticalAlignment="Center" Width="120"/>
41-
<TextBox Grid.Column="1" Text="{Binding WorkingDirectory}" Margin="5,0"/>
42-
<Button Grid.Column="2" Content="Browse" Command="{Binding BrowseWorkingDirectoryCommand}" Margin="5,0"/>
46+
<Grid Grid.Row="3" ColumnDefinitions="Auto,*,Auto" Margin="0,8">
47+
<TextBlock Grid.Column="0" Text="Working Directory" VerticalAlignment="Center" Width="140" FontWeight="Medium"/>
48+
<TextBox Grid.Column="1" Text="{Binding WorkingDirectory}" Margin="8,0"/>
49+
<Button Grid.Column="2"
50+
Classes="Secondary"
51+
Content="Browse"
52+
Command="{Binding BrowseWorkingDirectoryCommand}"
53+
Margin="8,0"/>
4354
</Grid>
4455

4556
<!-- Log Directory -->
46-
<Grid Grid.Row="4" ColumnDefinitions="Auto,*,Auto" Margin="0,5">
47-
<TextBlock Grid.Column="0" Text="Log Directory:" VerticalAlignment="Center" Width="120"/>
48-
<TextBox Grid.Column="1" Text="{Binding LogDirectory}" Margin="5,0"/>
49-
<Button Grid.Column="2" Content="Browse" Command="{Binding BrowseLogDirectoryCommand}" Margin="5,0"/>
57+
<Grid Grid.Row="4" ColumnDefinitions="Auto,*,Auto" Margin="0,8">
58+
<TextBlock Grid.Column="0" Text="Log Directory" VerticalAlignment="Center" Width="140" FontWeight="Medium"/>
59+
<TextBox Grid.Column="1" Text="{Binding LogDirectory}" Margin="8,0"/>
60+
<Button Grid.Column="2"
61+
Classes="Secondary"
62+
Content="Browse"
63+
Command="{Binding BrowseLogDirectoryCommand}"
64+
Margin="8,0"/>
5065
</Grid>
5166

5267
<!-- Options -->
53-
<StackPanel Grid.Row="5" Orientation="Horizontal" Margin="0,10">
54-
<CheckBox Content="Disable Linear Search" IsChecked="{Binding DisableLinearSearch}" Margin="120,0,20,0"/>
55-
<CheckBox Content="Follow History" IsChecked="{Binding FollowHistory}"/>
56-
</StackPanel>
68+
<Grid Grid.Row="5" ColumnDefinitions="Auto,*" Margin="0,8">
69+
<TextBlock Grid.Column="0" Text="Options" VerticalAlignment="Center" Width="140" FontWeight="Medium"/>
70+
<StackPanel Grid.Column="1" Orientation="Horizontal" Margin="8,0">
71+
<CheckBox Content="Disable Linear Search" IsChecked="{Binding DisableLinearSearch}" Margin="0,0,24,0"/>
72+
<CheckBox Content="Follow History" IsChecked="{Binding FollowHistory}"/>
73+
</StackPanel>
74+
</Grid>
5775

5876
<!-- Search Button and Progress -->
59-
<Grid Grid.Row="6" Margin="0,10">
77+
<Grid Grid.Row="6" Margin="0,8">
6078
<Grid.ColumnDefinitions>
6179
<ColumnDefinition Width="120"/>
6280
<ColumnDefinition Width="*"/>
6381
</Grid.ColumnDefinitions>
6482
<Button Grid.Column="0"
83+
Classes="Primary"
6584
Content="Start Search"
6685
Command="{Binding StartSearchCommand}"/>
6786
<ProgressBar Grid.Column="1"
87+
Height="4"
6888
Value="{Binding SearchProgress}"
6989
IsVisible="{Binding IsSearching}"
70-
Margin="5,0"/>
90+
Margin="8,0"/>
7191
</Grid>
7292

7393
<!-- Log Output -->
7494
<Border Grid.Row="7"
75-
BorderBrush="Gray"
95+
BorderBrush="#3A3B3F"
7696
BorderThickness="1"
77-
Margin="0,10">
78-
<ScrollViewer>
97+
CornerRadius="8"
98+
Margin="0,16,0,0">
99+
<ScrollViewer Margin="8">
79100
<ItemsControl ItemsSource="{Binding LogOutput}">
80101
<ItemsControl.ItemTemplate>
81102
<DataTemplate>
82-
<TextBlock Text="{Binding}" TextWrapping="Wrap"/>
103+
<TextBlock Text="{Binding}"
104+
TextWrapping="Wrap"
105+
Foreground="#CCCCCC"
106+
FontFamily="Consolas"
107+
Margin="0,2"/>
83108
</DataTemplate>
84109
</ItemsControl.ItemTemplate>
85110
</ItemsControl>

README.md

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,22 @@
22

33
## Overview
44

5-
**GitContentSearch** is the ideal tool if you've ever wanted to do `git blame` on Excel files. This command-line tool allows you to efficiently search for content across different Git commits in Excel files (.xls, .xlsx) and text files (.txt, .sql, .cs, etc.), making it a powerful solution for tracking changes even in non-text formats.
5+
**GitContentSearch** is the ideal tool if you've ever wanted to do `git blame` on Excel files. This tool comes in two flavors - a command-line interface (CLI) and a graphical user interface (UI). It allows you to efficiently search for content across different Git commits in Excel files (.xls, .xlsx) and text files (.txt, .sql, .cs, etc.), making it a powerful solution for tracking changes even in non-text formats.
66

77
The app identifies the commit where the search string appears, using an optimized binary search algorithm and reverse linear search for faster results in large commit histories. Progress is logged to a file, allowing you to resume the search if interrupted.
88

9+
> **Note**: Currently, the application has been primarily tested on Windows and may not work properly on Linux/MacOS. Cross-platform support is planned for future releases.
10+
11+
![GitContentSearch UI Main Window](images/ui/main-window.png)
12+
913
## Features
1014

15+
- **Two Interfaces**: Choose between a CLI for automation and scripting, or a modern UI for a more visual experience.
1116
- **Optimized Search**: Quickly identifies the commit where the search string first appears and last disappears.
1217
- **Searches Across Multiple File Types**: Search in Excel files (.xls, .xlsx) and text files (.txt, .sql, .cs, etc.).
1318
- **Log File**: Keeps track of all checked commits and results, allowing you to continue the search later.
1419
- **Commit Range**: Specify an earliest and latest commit to limit the search scope.
15-
- **Follow File History**: Use the `--follow` option to follow file renames and history across commits.
20+
- **Follow File History**: Use the `--follow` option (CLI) or toggle in UI to follow file renames and history across commits.
1621

1722
## Installation
1823

@@ -29,16 +34,36 @@ cd GitContentSearch
2934
dotnet publish -c Release
3035
```
3136

32-
**Add the executable folder to your PATH environment variable**
33-
34-
After building the application, you will want to add the folder containing the GitContentSearch.exe (or equivalent for your operating system) to your PATH environment variable. This allows you to run the tool from any directory in your command line.
37+
### CLI Installation
3538

39+
The CLI executable will be available at:
3640
```
3741
/path/to/your/git/repository/GitContentSearch/bin/Release/netX.X/publish/
3842
```
3943

44+
Add this folder to your PATH environment variable to run the tool from any directory in your command line.
45+
46+
### UI Installation
47+
48+
The UI executable will be available at:
49+
```
50+
/path/to/your/git/repository/GitContentSearch.UI/bin/Release/netX.X/publish/
51+
```
52+
53+
For easy access, you can create a shortcut to `GitContentSearch.UI.exe` on your desktop from the publish folder.
54+
4055
## Usage
4156

57+
### UI Version
58+
59+
1. Launch `GitContentSearch.UI.exe`
60+
2. Configure your Git repository settings
61+
3. Enter the file path and search string
62+
4. Optionally set commit range and other search options
63+
5. Click Search to begin
64+
65+
### CLI Version
66+
4267
**1. Navigate to your Git directory**:
4368

4469
Before running the tool, ensure you're in the directory where your Git repository is located:
@@ -50,10 +75,10 @@ cd /path/to/your/git/repository
5075
**2. Run the tool**:
5176

5277
```bash
53-
GitContentSearch.exe <remote-file-path> <search-string> [--earliest-commit=<commit>] [--latest-commit=<commit>] [--working-directory=<path>] [--log-directory=<path>]
78+
GitContentSearch.exe <remote-file-path> <search-string> [--earliest-commit=<commit>] [--latest-commit=<commit>] [--working-directory=<path>] [--log-directory=<path>] [--disable-linear-search] [--follow]
5479
```
5580

56-
### Arguments
81+
### CLI Arguments
5782

5883
* `<file-path>`: The path to the Content file within the Git repository.
5984
* `<search-string>`: The string you want to search for in the Content file.
@@ -64,7 +89,7 @@ GitContentSearch.exe <remote-file-path> <search-string> [--earliest-commit=<comm
6489
* `--log-directory=<path>`: (Optional) The directory where the log file and temporary files will be stored. Defaults to the user's temp directory if not provided.
6590
* `--follow`: (Optional) Follow file renames and history across commits.
6691

67-
### Example
92+
### CLI Example
6893

6994
```bash
7095
GitContentSearch.exe "path/to/your/file.xlsx" "SearchString" --earliest-commit=abc123 --latest-commit=def456 --working-directory="/your/git/repo" --log-directory="/your/log/directory" --follow
@@ -80,8 +105,9 @@ Search Log: A file named search_log.txt is created in the log directory, detaili
80105

81106
## Dependencies
82107

83-
* NPOI: [NPOI](https://github.com/nissl-lab/npoi) is a .NET library that provides support for reading and writing Microsoft Office formats, including Content (.xls, .xlsx). It's used in this project to process Content files.
84108
* Git: Make sure Git is installed on your system, as the app relies on the git show command.
109+
* NPOI: [NPOI](https://github.com/nissl-lab/npoi) is a .NET library that provides support for reading and writing Microsoft Office formats, including Content (.xls, .xlsx). It's used in this project to process Excel files.
110+
* AvaloniaUI: The UI version is built using [AvaloniaUI](https://avaloniaui.net/), a cross-platform UI framework for .NET.
85111

86112
## Contributing
87113

images/ui/main-window.png

218 KB
Loading

0 commit comments

Comments
 (0)