From 07fe141f8a6de4ba82afb318571efca61663acb8 Mon Sep 17 00:00:00 2001 From: bao-qian Date: Sun, 24 Apr 2016 17:06:23 +0100 Subject: [PATCH] Fix #565 1. Fix resultlistbox visibility 2. Fix #565 3. Remove unused convertor --- Wox/Converters/OpacityModeConverter.cs | 40 ----------------- Wox/Converters/StringEmptyConverter.cs | 18 -------- .../StringNullOrEmptyToVisibilityConverter.cs | 45 ------------------- Wox/ResultListBox.xaml | 1 - Wox/SettingWindow.xaml | 4 +- Wox/ViewModel/MainViewModel.cs | 6 +++ Wox/Wox.csproj | 3 -- 7 files changed, 7 insertions(+), 110 deletions(-) delete mode 100644 Wox/Converters/OpacityModeConverter.cs delete mode 100644 Wox/Converters/StringEmptyConverter.cs delete mode 100644 Wox/Converters/StringNullOrEmptyToVisibilityConverter.cs diff --git a/Wox/Converters/OpacityModeConverter.cs b/Wox/Converters/OpacityModeConverter.cs deleted file mode 100644 index 7eb94de814..0000000000 --- a/Wox/Converters/OpacityModeConverter.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using System.Globalization; -using Wox.Core.UserSettings; - -namespace Wox.Converters -{ - public class OpacityModeConverter : ConvertorBase - { - 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; - } - } -} \ No newline at end of file diff --git a/Wox/Converters/StringEmptyConverter.cs b/Wox/Converters/StringEmptyConverter.cs deleted file mode 100644 index be88a4a6be..0000000000 --- a/Wox/Converters/StringEmptyConverter.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Globalization; - -namespace Wox.Converters -{ - public class StringEmptyConverter : ConvertorBase - { - 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; - } - } -} \ No newline at end of file diff --git a/Wox/Converters/StringNullOrEmptyToVisibilityConverter.cs b/Wox/Converters/StringNullOrEmptyToVisibilityConverter.cs deleted file mode 100644 index f536e74735..0000000000 --- a/Wox/Converters/StringNullOrEmptyToVisibilityConverter.cs +++ /dev/null @@ -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 - { - 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 - { - public override object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - List results = value as List; - 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; - } - } -} \ No newline at end of file diff --git a/Wox/ResultListBox.xaml b/Wox/ResultListBox.xaml index 38d8dcb90d..e39899babb 100644 --- a/Wox/ResultListBox.xaml +++ b/Wox/ResultListBox.xaml @@ -45,7 +45,6 @@ VerticalAlignment="Center" ToolTip="{Binding Title}" x:Name="tbTitle" Text="{Binding Title}" /> diff --git a/Wox/SettingWindow.xaml b/Wox/SettingWindow.xaml index e6ef2bce54..6df47ccd25 100644 --- a/Wox/SettingWindow.xaml +++ b/Wox/SettingWindow.xaml @@ -79,7 +79,6 @@ @@ -115,8 +114,7 @@ x:Name="pluginAuthor" Text="{DynamicResource author}" /> + ToolTip="{Binding Source=pluginSubTitle, Path=Text}"/> diff --git a/Wox/ViewModel/MainViewModel.cs b/Wox/ViewModel/MainViewModel.cs index ed606ccad4..4d680ed1e0 100644 --- a/Wox/ViewModel/MainViewModel.cs +++ b/Wox/ViewModel/MainViewModel.cs @@ -389,6 +389,7 @@ namespace Wox.ViewModel else { Results.Clear(); + ResultListBoxVisibility = Visibility.Collapsed; } } } @@ -565,6 +566,11 @@ namespace Wox.ViewModel { ResultListBoxVisibility = Visibility.Visible; } + else + { + ResultListBoxVisibility = Visibility.Collapsed; + } + } #endregion diff --git a/Wox/Wox.csproj b/Wox/Wox.csproj index d59992e8cf..be5dbc83cb 100644 --- a/Wox/Wox.csproj +++ b/Wox/Wox.csproj @@ -124,9 +124,6 @@ - - -