Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make hints look more like Vimium #28

Merged
merged 2 commits into from
Jan 12, 2021
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
2 changes: 1 addition & 1 deletion src/HuntAndPeck/Services/HintLabelService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public IList<string> GetHintStrings(int hintCount)
return hintStrings;
}

var hintCharacters = new[] { 's', 'a', 'd', 'f', 'j', 'k', 'l', 'e', 'w', 'c', 'm', 'p', 'g', 'h' };
var hintCharacters = new[] { 'S', 'A', 'D', 'F', 'J', 'K', 'L', 'E', 'W', 'C', 'M', 'P', 'G', 'H' };
var digitsNeeded = (int)Math.Ceiling(Math.Log(hintCount) / Math.Log(hintCharacters.Length));

var wholeHintCount = (int)Math.Pow(hintCharacters.Length, digitsNeeded);
Expand Down
2 changes: 1 addition & 1 deletion src/HuntAndPeck/ViewModels/OverlayViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public string MatchString
x.Active = false;
}

var matching = Hints.Where(x => x.Label.StartsWith(value)).ToArray();
var matching = Hints.Where(x => x.Label.StartsWith(value, StringComparison.OrdinalIgnoreCase)).ToArray();
foreach (var x in matching)
{
x.Active = true;
Expand Down
7 changes: 3 additions & 4 deletions src/HuntAndPeck/Views/OverlayView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid>
<Rectangle Width="{Binding Hint.BoundingRectangle.Width}" Height="{Binding Hint.BoundingRectangle.Height}" Stroke="Red" StrokeDashArray="1 2">
<!--<Rectangle Width="{Binding Hint.BoundingRectangle.Width}" Height="{Binding Hint.BoundingRectangle.Height}" Stroke="Red" StrokeDashArray="1 2">
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please remove this?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a file conflict, normally I wouldn't worry about commented code :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I resolved a conflict in HintLabelService.cs. There's no conflict now..

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍

<Rectangle.Fill>
<SolidColorBrush Color="Yellow" Opacity="0.05" />
</Rectangle.Fill>
</Rectangle>
</Rectangle>-->
<Viewbox StretchDirection="DownOnly" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="1 1 0 0" Width="{Binding Hint.BoundingRectangle.Width}" Height="{Binding Hint.BoundingRectangle.Height}">
<TextBlock Text="{Binding Label}" FontFamily="Courier New" FontWeight="ExtraBold" FontSize="14" Style="{StaticResource HintStyle}">
<TextBlock Text="{Binding Label}" FontFamily="Helvetica, Arial" FontWeight="Bold" FontSize="12" Style="{StaticResource HintStyle}">
</TextBlock>
</Viewbox>
</Grid>
Expand All @@ -59,4 +59,3 @@
</Grid>
</local:ForegroundWindow>