mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 04:07:40 +02:00
Fix #565
1. Fix resultlistbox visibility 2. Fix #565 3. Remove unused convertor
This commit is contained in:
@@ -1,40 +0,0 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using Wox.Core.UserSettings;
|
||||
|
||||
namespace Wox.Converters
|
||||
{
|
||||
public class OpacityModeConverter : ConvertorBase<OpacityModeConverter>
|
||||
{
|
||||
public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (!(value is OpacityMode)) return value.ToString();
|
||||
var mode = (OpacityMode) value;
|
||||
switch (mode)
|
||||
{
|
||||
case OpacityMode.Normal:
|
||||
return "Normal Window";
|
||||
case OpacityMode.LayeredWindow:
|
||||
{
|
||||
if (Environment.OSVersion.Version.Major < 5)
|
||||
return "Layered Window (not supported by your Windows)";
|
||||
if (Environment.OSVersion.Version.Major == 5)
|
||||
return "Layered Window (not recommended on your Windows)";
|
||||
return "Layered Window";
|
||||
}
|
||||
case OpacityMode.DWM:
|
||||
{
|
||||
if (Environment.OSVersion.Version.Major < 6)
|
||||
return "DWM-Enabled Window (not supported by your Windows)";
|
||||
return "DWM-Enabled Window";
|
||||
}
|
||||
}
|
||||
return value.ToString();
|
||||
}
|
||||
|
||||
public override object ProvideValue(IServiceProvider serviceProvider)
|
||||
{
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Wox.Converters
|
||||
{
|
||||
public class StringEmptyConverter : ConvertorBase<StringEmptyConverter>
|
||||
{
|
||||
public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
return string.IsNullOrEmpty((string)value) ? parameter : value;
|
||||
}
|
||||
|
||||
public override object ProvideValue(IServiceProvider serviceProvider)
|
||||
{
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Windows;
|
||||
using Wox.Plugin;
|
||||
|
||||
namespace Wox.Converters
|
||||
{
|
||||
public class StringNullOrEmptyToVisibilityConverter : ConvertorBase<StringNullOrEmptyToVisibilityConverter>
|
||||
{
|
||||
public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
return string.IsNullOrEmpty(value as string) ? Visibility.Collapsed : Visibility.Visible;
|
||||
}
|
||||
|
||||
public override object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public override object ProvideValue(IServiceProvider serviceProvider)
|
||||
{
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public class ContextMenuEmptyToWidthConverter : ConvertorBase<ContextMenuEmptyToWidthConverter>
|
||||
{
|
||||
public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
List<Result> results = value as List<Result>;
|
||||
return results == null || results.Count == 0 ? 0 : 17;
|
||||
}
|
||||
|
||||
public override object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public override object ProvideValue(IServiceProvider serviceProvider)
|
||||
{
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user