Skip to content

Commit 65df098

Browse files
committed
Make the fetch button more obviously disabled in the minified state
1 parent 7e9c875 commit 65df098

File tree

5 files changed

+24
-21
lines changed

5 files changed

+24
-21
lines changed

EnhancePoE/UserControls/MainOverlayContent.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@
291291
</Grid>
292292
</Border>
293293
<Button x:Name="RefreshButton"
294-
Click="RefreshButton_Click_1"
294+
Click="OnFetchButtonClicked"
295295
Width="50"
296296
IsEnabled="{Binding FetchButtonEnabled}"
297297
Grid.Column="11"

EnhancePoE/UserControls/MainOverlayContent.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ private void OpenStashTabOverlay_Click( object sender, RoutedEventArgs e )
1515
MainWindow.RunStashTabOverlay();
1616
}
1717

18-
private void RefreshButton_Click_1( object sender, RoutedEventArgs e )
18+
private void OnFetchButtonClicked( object sender, RoutedEventArgs e )
1919
{
2020
MainWindow.Overlay.RunFetching();
2121
}

EnhancePoE/UserControls/MainOverlayContentMinified.xaml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
55
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
66
xmlns:properties="clr-namespace:EnhancePoE.Properties"
7+
xmlns:local="clr-namespace:EnhancePoE"
78
FontSize="14"
8-
mc:Ignorable="d">
9+
mc:Ignorable="d"
10+
d:DataContext="{d:DesignInstance Type={x:Type local:ChaosRecipeEnhancer}}">
911
<Grid>
1012
<Grid.ColumnDefinitions>
1113
<ColumnDefinition Width="3" />
@@ -315,15 +317,29 @@
315317
Width="30"
316318
CornerRadius="50"
317319
Margin="3,0"
318-
PreviewMouseDown="RefreshButton_Click_1"
319-
Background="White"
320+
PreviewMouseDown="OnFetchButtonClicked"
320321
BorderThickness="3"
321-
BorderBrush="{Binding FetchButtonColor}">
322+
BorderBrush="Green">
323+
<Border.Background>
324+
<SolidColorBrush Color="LawnGreen"
325+
Opacity="0.3" />
326+
</Border.Background>
327+
<Border.Style>
328+
<Style TargetType="{x:Type Border}">
329+
<Style.Triggers>
330+
<Trigger Property="IsEnabled"
331+
Value="False">
332+
<Setter Property="Opacity"
333+
Value="0.3" />
334+
</Trigger>
335+
</Style.Triggers>
336+
</Style>
337+
</Border.Style>
322338
<TextBlock Text="S"
323339
VerticalAlignment="Center"
324340
HorizontalAlignment="Center"
325341
TextAlignment="Center"
326-
Foreground="{Binding FetchButtonColor}" />
342+
Foreground="Green" />
327343
</Border>
328344
<ProgressBar Grid.Column="1"
329345
Grid.ColumnSpan="12"

EnhancePoE/UserControls/MainOverlayContentMinified.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ private void OpenStashTabOverlay_Click( object sender, RoutedEventArgs e )
1515
MainWindow.RunStashTabOverlay();
1616
}
1717

18-
private void RefreshButton_Click_1( object sender, RoutedEventArgs e )
18+
private void OnFetchButtonClicked( object sender, RoutedEventArgs e )
1919
{
2020
MainWindow.Overlay.RunFetching();
2121
}

EnhancePoE/View/ChaosRecipeEnhancer.xaml.cs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -181,17 +181,6 @@ public ContentElement MainOverlayContent
181181
}
182182
}
183183

184-
private SolidColorBrush _fetchButtonColor = Brushes.Green;
185-
public SolidColorBrush FetchButtonColor
186-
{
187-
get => _fetchButtonColor;
188-
set
189-
{
190-
_fetchButtonColor = value;
191-
OnPropertyChanged( nameof( FetchButtonColor ) );
192-
}
193-
}
194-
195184
private int _ringsAmount;
196185
public int RingsAmount
197186
{
@@ -330,7 +319,6 @@ private async void FetchData()
330319
{
331320
IsIndeterminate = true;
332321
FetchButtonEnabled = false;
333-
FetchButtonColor = Brushes.DimGray;
334322
} );
335323
await Dispatcher.Invoke( async () =>
336324
{
@@ -381,7 +369,6 @@ await Task.Delay( fetchCooldown * 1000 ).ContinueWith( _ =>
381369
{
382370
IsIndeterminate = false;
383371
FetchButtonEnabled = true;
384-
FetchButtonColor = Brushes.Green;
385372
FetchingActive = false;
386373
} );
387374
Trace.WriteLine( "end of fetch function reached" );

0 commit comments

Comments
 (0)