mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Fixed Progressbar Binding Error (ProgressBar Value is Not Nullable)
This commit is contained in:
parent
c81dd32d99
commit
314f2d6a90
4 changed files with 13 additions and 9 deletions
|
|
@ -201,7 +201,12 @@ namespace Flow.Launcher.Plugin
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Progress bar display. Providing an int value between 0-100 will trigger the progress bar to be displayed on the result
|
/// Progress bar display. Providing an int value between 0-100 will trigger the progress bar to be displayed on the result
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? ProgressBar { get; set; }
|
public int ProgressBarValue { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Progress bar visibility Check
|
||||||
|
/// </summary>
|
||||||
|
public bool IsProgressBarVisible { get; set; } = false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Optionally set the color of the progress bar
|
/// Optionally set the color of the progress bar
|
||||||
|
|
|
||||||
|
|
@ -115,7 +115,7 @@
|
||||||
x:Name="progressbarResult"
|
x:Name="progressbarResult"
|
||||||
Foreground="{Binding Result.ProgressBarColor}"
|
Foreground="{Binding Result.ProgressBarColor}"
|
||||||
Style="{DynamicResource ProgressBarResult}"
|
Style="{DynamicResource ProgressBarResult}"
|
||||||
Value="{Binding Result.ProgressBar}" />
|
Value="{Binding Result.ProgressBarValue}" />
|
||||||
<TextBlock
|
<TextBlock
|
||||||
x:Name="Title"
|
x:Name="Title"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@
|
||||||
xmlns:system="clr-namespace:System;assembly=mscorlib"
|
xmlns:system="clr-namespace:System;assembly=mscorlib"
|
||||||
xmlns:userSettings="clr-namespace:Flow.Launcher.Infrastructure.UserSettings;assembly=Flow.Launcher.Infrastructure">
|
xmlns:userSettings="clr-namespace:Flow.Launcher.Infrastructure.UserSettings;assembly=Flow.Launcher.Infrastructure">
|
||||||
|
|
||||||
|
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
|
||||||
|
|
||||||
<!-- Further font customisations are dynamically loaded in Theme.cs -->
|
<!-- Further font customisations are dynamically loaded in Theme.cs -->
|
||||||
<Style x:Key="BaseQueryBoxStyle" TargetType="{x:Type TextBox}">
|
<Style x:Key="BaseQueryBoxStyle" TargetType="{x:Type TextBox}">
|
||||||
<Setter Property="BorderThickness" Value="0" />
|
<Setter Property="BorderThickness" Value="0" />
|
||||||
|
|
@ -89,11 +91,7 @@
|
||||||
<Setter Property="Minimum" Value="0" />
|
<Setter Property="Minimum" Value="0" />
|
||||||
<Setter Property="Visibility" Value="Visible" />
|
<Setter Property="Visibility" Value="Visible" />
|
||||||
<Setter Property="Foreground" Value="#26a0da " />
|
<Setter Property="Foreground" Value="#26a0da " />
|
||||||
<Style.Triggers>
|
<Setter Property="Visibility" Value="{Binding Result.IsProgressBarVisible, Converter={StaticResource BooleanToVisibilityConverter}}"/>
|
||||||
<DataTrigger Binding="{Binding Result.ProgressBar}" Value="{x:Null}">
|
|
||||||
<Setter Property="Visibility" Value="Collapsed" />
|
|
||||||
</DataTrigger>
|
|
||||||
</Style.Triggers>
|
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style x:Key="BaseItemTitleStyle" TargetType="{x:Type TextBlock}">
|
<Style x:Key="BaseItemTitleStyle" TargetType="{x:Type TextBlock}">
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search
|
||||||
internal static Result CreateDriveSpaceDisplayResult(string path, bool windowsIndexed = false)
|
internal static Result CreateDriveSpaceDisplayResult(string path, bool windowsIndexed = false)
|
||||||
{
|
{
|
||||||
var progressBarColor = "#26a0da";
|
var progressBarColor = "#26a0da";
|
||||||
int? progressValue = null;
|
int progressValue = 0;
|
||||||
var title = string.Empty; // hide title when use progress bar,
|
var title = string.Empty; // hide title when use progress bar,
|
||||||
var driveLetter = path.Substring(0, 1).ToUpper();
|
var driveLetter = path.Substring(0, 1).ToUpper();
|
||||||
var driveName = driveLetter + ":\\";
|
var driveName = driveLetter + ":\\";
|
||||||
|
|
@ -100,7 +100,8 @@ namespace Flow.Launcher.Plugin.Explorer.Search
|
||||||
AutoCompleteText = GetPathWithActionKeyword(path, ResultType.Folder),
|
AutoCompleteText = GetPathWithActionKeyword(path, ResultType.Folder),
|
||||||
IcoPath = path,
|
IcoPath = path,
|
||||||
Score = 500,
|
Score = 500,
|
||||||
ProgressBar = progressValue,
|
ProgressBarValue = progressValue,
|
||||||
|
IsProgressBarVisible = true,
|
||||||
ProgressBarColor = progressBarColor,
|
ProgressBarColor = progressBarColor,
|
||||||
Action = c =>
|
Action = c =>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue