mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 11:16:51 +02:00
merge with master
This commit is contained in:
BIN
Wox/Images/sleep.png
Normal file
BIN
Wox/Images/sleep.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
@@ -1,4 +1,5 @@
|
||||
<UserControl x:Class="Wox.ResultPanel"
|
||||
x:Name="Results"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
@@ -6,8 +7,7 @@
|
||||
xmlns:converters="clr-namespace:Wox.Converters"
|
||||
mc:Ignorable="d" d:DesignWidth="100" d:DesignHeight="100">
|
||||
|
||||
<!-- set max height of listbox to allow 6 results showed at once -->
|
||||
<ListBox x:Name="lbResults" MaxHeight="300" AllowDrop="True" Drop="ListBoxItem_OnDrop" HorizontalContentAlignment="Stretch" PreviewMouseDown="LbResults_OnPreviewMouseDown" Style="{DynamicResource BaseListboxStyle}" SelectionChanged ="lbResults_SelectionChanged" Focusable="False" KeyboardNavigation.DirectionalNavigation="Cycle" SelectionMode="Single" VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Standard">
|
||||
<ListBox x:Name="lbResults" MaxHeight="{Binding ElementName=Results, Path=MaxResultsToShow}" HorizontalContentAlignment="Stretch" PreviewMouseDown="LbResults_OnPreviewMouseDown" Style="{DynamicResource BaseListboxStyle}" SelectionChanged ="lbResults_SelectionChanged" Focusable="False" KeyboardNavigation.DirectionalNavigation="Cycle" SelectionMode="Single" VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Standard">
|
||||
<ListBox.Resources>
|
||||
<!--SelectedItem with focus-->
|
||||
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="{DynamicResource ItemSelectedBackgroundColor}"/>
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using Wox.Helper;
|
||||
using Wox.Core.UserSettings;
|
||||
using Wox.Plugin;
|
||||
using Wox.Storage;
|
||||
using UserControl = System.Windows.Controls.UserControl;
|
||||
@@ -33,6 +31,8 @@ namespace Wox
|
||||
|
||||
public bool Dirty { get; set; }
|
||||
|
||||
public int MaxResultsToShow { get { return UserSettingStorage.Instance.MaxResultsToShow * 50; } }
|
||||
|
||||
public void AddResults(List<Result> results)
|
||||
{
|
||||
if (Dirty)
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
xmlns:woxPlugin="clr-namespace:Wox.Plugin;assembly=Wox.Plugin"
|
||||
xmlns:converters="clr-namespace:Wox.Converters"
|
||||
xmlns:userSettings="clr-namespace:Wox.Core.UserSettings;assembly=Wox.Core"
|
||||
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
||||
Icon="Images\app.png"
|
||||
Title="{DynamicResource woxsettings}"
|
||||
ResizeMode="NoResize"
|
||||
@@ -38,6 +39,10 @@
|
||||
<TextBlock Text="{DynamicResource language}"></TextBlock>
|
||||
<ComboBox Margin="10 0 0 0" Width="100" x:Name="cbLanguages" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="10">
|
||||
<ComboBox Name="comboMaxResultsToShow"/>
|
||||
<Label>Maximum number of results to show at a time</Label>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</TabItem>
|
||||
<TabItem Header="{DynamicResource plugin}" x:Name="tabPlugin" PreviewMouseLeftButtonDown="TabPlugin_OnPreviewMouseLeftButtonDown">
|
||||
@@ -308,7 +313,7 @@
|
||||
<StackPanel Grid.Column="1" Grid.Row="1" Orientation="Horizontal">
|
||||
<TextBlock Margin="6" HorizontalAlignment="Left" x:Name="tbVersion" Text="1.0.0"></TextBlock>
|
||||
</StackPanel>
|
||||
|
||||
|
||||
<TextBlock x:Name="tbActivatedTimes" Grid.Row="2" Margin="6" Grid.ColumnSpan="2" Text="{DynamicResource about_activate_times}"></TextBlock>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
|
||||
@@ -87,11 +87,21 @@ namespace Wox
|
||||
};
|
||||
|
||||
cbStartWithWindows.IsChecked = CheckApplicationIsStartupWithWindow();
|
||||
comboMaxResultsToShow.SelectionChanged += (o, e) =>
|
||||
{
|
||||
UserSettingStorage.Instance.MaxResultsToShow = (int)comboMaxResultsToShow.SelectedItem;
|
||||
UserSettingStorage.Instance.Save();
|
||||
MainWindow.pnlResult.lbResults.GetBindingExpression(MaxHeightProperty).UpdateTarget();
|
||||
};
|
||||
|
||||
cbHideWhenDeactive.IsChecked = UserSettingStorage.Instance.HideWhenDeactive;
|
||||
cbDontPromptUpdateMsg.IsChecked = UserSettingStorage.Instance.DontPromptUpdateMsg;
|
||||
cbRememberLastLocation.IsChecked = UserSettingStorage.Instance.RememberLastLaunchLocation;
|
||||
|
||||
LoadLanguages();
|
||||
comboMaxResultsToShow.ItemsSource = Enumerable.Range(2, 16);
|
||||
var maxResults = UserSettingStorage.Instance.MaxResultsToShow;
|
||||
comboMaxResultsToShow.SelectedItem = maxResults == 0 ? 6 : maxResults;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -351,6 +351,11 @@
|
||||
<ItemGroup>
|
||||
<None Include="Resources\app.ico" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Images\sleep.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Resource>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
||||
<PropertyGroup>
|
||||
|
||||
Reference in New Issue
Block a user