mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Merge pull request #1383 from Sparrkle/ProgressBarBindingError
Fixed Progressbar Binding Error (ProgressBar Value is Not Nullable)
This commit is contained in:
commit
8e05f312af
4 changed files with 24 additions and 9 deletions
|
|
@ -114,8 +114,18 @@
|
|||
<ProgressBar
|
||||
x:Name="progressbarResult"
|
||||
Foreground="{Binding Result.ProgressBarColor}"
|
||||
Style="{DynamicResource ProgressBarResult}"
|
||||
Value="{Binding Result.ProgressBar}" />
|
||||
Value="{Binding ResultProgress, Mode=OneWay}">
|
||||
<ProgressBar.Style>
|
||||
<Style TargetType="ProgressBar" BasedOn="{StaticResource ProgressBarResult}">
|
||||
<Setter Property="Visibility" Value="Visible"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding Result.ProgressBar}" Value="{x:Null}">
|
||||
<Setter Property="Visibility" Value="Collapsed"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</ProgressBar.Style>
|
||||
</ProgressBar>
|
||||
<TextBlock
|
||||
x:Name="Title"
|
||||
VerticalAlignment="Center"
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:system="clr-namespace:System;assembly=mscorlib"
|
||||
xmlns:userSettings="clr-namespace:Flow.Launcher.Infrastructure.UserSettings;assembly=Flow.Launcher.Infrastructure">
|
||||
|
||||
|
||||
<!-- Further font customisations are dynamically loaded in Theme.cs -->
|
||||
<Style x:Key="BaseQueryBoxStyle" TargetType="{x:Type TextBox}">
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
|
|
@ -89,11 +89,6 @@
|
|||
<Setter Property="Minimum" Value="0" />
|
||||
<Setter Property="Visibility" Value="Visible" />
|
||||
<Setter Property="Foreground" Value="#26a0da " />
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding Result.ProgressBar}" Value="{x:Null}">
|
||||
<Setter Property="Visibility" Value="Collapsed" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="BaseItemTitleStyle" TargetType="{x:Type TextBlock}">
|
||||
|
|
|
|||
|
|
@ -162,6 +162,16 @@ namespace Flow.Launcher.ViewModel
|
|||
}
|
||||
|
||||
public Result Result { get; }
|
||||
public int ResultProgress
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Result.ProgressBar == null)
|
||||
return 0;
|
||||
|
||||
return Result.ProgressBar.Value;
|
||||
}
|
||||
}
|
||||
|
||||
public string QuerySuggestionText { get; set; }
|
||||
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search
|
|||
internal static Result CreateDriveSpaceDisplayResult(string path, bool windowsIndexed = false)
|
||||
{
|
||||
var progressBarColor = "#26a0da";
|
||||
int? progressValue = null;
|
||||
int progressValue = 0;
|
||||
var title = string.Empty; // hide title when use progress bar,
|
||||
var driveLetter = path.Substring(0, 1).ToUpper();
|
||||
var driveName = driveLetter + ":\\";
|
||||
|
|
|
|||
Loading…
Reference in a new issue