UI changes.

This commit is contained in:
qianlifeng
2014-02-21 18:59:47 +08:00
parent 18ee6ecf80
commit a9123d2966
6 changed files with 65 additions and 24 deletions

View File

@@ -7,6 +7,45 @@
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Themes/Default.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
<Style x:Key="BaseWindowStyle" TargetType="{x:Type Window}">
<Setter Property="Height" Value="80" />
<Setter Property="Width" Value="500" />
<Setter Property="Background" Value="#424242" />
</Style>
<Style x:Key="BaseQueryBoxStyle" TargetType="{x:Type TextBox}">
<Setter Property="BorderThickness" Value="0" />
<Setter Property="FontSize" Value="25" />
<Setter Property="FontWeight" Value="Medium" />
<Setter Property="AllowDrop" Value="true" />
<Setter Property="Height" Value="46" />
<Setter Property="Background" Value="#616161" />
<Setter Property="Foreground" Value="#E3E0E3" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Stylus.IsFlicksEnabled" Value="False" />
</Style>
<!-- search item title -->
<Style x:Key="BaseItemTitleStyle" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#FFFFF8" />
<Setter Property="FontSize" Value="16" />
<Setter Property="FontWeight" Value="Medium" />
</Style>
<!-- search item selected title -->
<Style x:Key="BaseItemTitleSelectedStyle" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#FFFFF8" />
<Setter Property="FontSize" Value="16" />
<Setter Property="FontWeight" Value="Medium" />
</Style>
<!-- search item sub title -->
<Style x:Key="BaseItemSubTitleStyle" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#D9D9D4" />
</Style>
<Style x:Key="BaseItemSubTitleSelectedStyle" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#D9D9D4" />
</Style>
</ResourceDictionary>
</Application.Resources>
</Application>

View File

@@ -41,7 +41,7 @@ namespace Wox
InitialTray();
hook.KeyPressed += OnHotKey;
hook.RegisterHotKey(XModifierKeys.Alt, Keys.Space);
hook.RegisterHotKey(XModifierKeys.Win, Keys.W);
ThreadPool.SetMaxThreads(30, 10);
InitProgressbarAnimation();
try
@@ -53,7 +53,6 @@ namespace Wox
SetTheme(CommonStorage.Instance.UserSetting.Theme = "Default");
}
Plugins.Init();
}
private void WakeupApp()
@@ -201,6 +200,7 @@ namespace Wox
Top = (SystemParameters.PrimaryScreenHeight - ActualHeight) / 3;
//WakeupApp();
Plugins.Init();
keyboardListener.hookedKeyboardCallback += KListener_hookedKeyboardCallback;
}
@@ -302,7 +302,7 @@ namespace Wox
resultCtrl.AddResults(l);
Debug.WriteLine("Time:" + (Environment.TickCount - t1) + " Count:" + l.Count);
Debug.WriteLine("Total Time:" + (Environment.TickCount - t1) + " Count:" + l.Count);
})), TimeSpan.FromMilliseconds(50));
}

View File

@@ -44,6 +44,12 @@
<TextBlock Style="{DynamicResource ItemSubTitleStyle}" Visibility="{Binding SubTitle, Converter={wox:StringNullOrEmptyToVisibilityConverter}}" Grid.Row="1" x:Name="tbSubTitle" Text="{Binding SubTitle}"></TextBlock>
</Grid>
</Grid>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ListBoxItem}}, Path=IsSelected}" Value="True">
<Setter TargetName="tbTitle" Property="Style" Value="{DynamicResource ItemTitleSelectedStyle}"/>
<Setter TargetName="tbSubTitle" Property="Style" Value="{DynamicResource ItemSubTitleSelectedStyle}"/>
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>

View File

@@ -1,4 +1,6 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
using Wox.Helper;
@@ -23,7 +25,6 @@ namespace Wox
lbResults.Items.Insert(position, result);
}
gridContainer.Margin = lbResults.Items.Count > 0 ? new Thickness { Top = 8 } : new Thickness { Top = 0 };
lbResults.UpdateLayout();
SelectFirst();
}

View File

@@ -1,16 +1,7 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">
<Style x:Key="QueryBoxStyle" TargetType="{x:Type TextBox}">
<Setter Property="BorderThickness" Value="0" />
<Setter Property="FontSize" Value="25" />
<Setter Property="FontWeight" Value="Medium" />
<Setter Property="AllowDrop" Value="true" />
<Setter Property="Height" Value="46" />
<Setter Property="Background" Value="#616161" />
<Setter Property="Foreground" Value="#E3E0E3" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Stylus.IsFlicksEnabled" Value="False" />
<Style x:Key="QueryBoxStyle" TargetType="{x:Type TextBox}" BasedOn="{StaticResource BaseQueryBoxStyle}">
</Style>
<Style x:Key="WindowStyle" TargetType="{x:Type Window}">
<Setter Property="Height" Value="80" />
@@ -25,15 +16,16 @@
</Style>
<!-- Item Style -->
<Style x:Key="ItemTitleStyle" TargetType="{x:Type TextBlock}">
<Style x:Key="ItemTitleStyle" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource BaseItemTitleStyle}">
<Setter Property="Foreground" Value="#FFFFF8" />
<Setter Property="FontSize" Value="16" />
<Setter Property="FontWeight" Value="Medium" />
</Style>
<Style x:Key="ItemSubTitleStyle" TargetType="{x:Type TextBlock}">
<Style x:Key="ItemSubTitleStyle" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource BaseItemSubTitleStyle}">
<Setter Property="Foreground" Value="#D9D9D4" />
</Style>
<Style x:Key="ItemTitleSelectedStyle" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource BaseItemTitleSelectedStyle}">
</Style>
<Style x:Key="ItemSubTitleSelectedStyle" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource BaseItemSubTitleSelectedStyle}">
</Style>
<Color x:Key="ResultItemHighlightBackgroundColor">#4F6180</Color>
<Style x:Key="listboxStyle" TargetType="{x:Type ListBox}">

View File

@@ -23,7 +23,6 @@
<Setter Property="Stroke" Value="Blue"></Setter>
</Style>
<Color x:Key="ResultItemHighlightBackgroundColor">#543BFD</Color>
<!-- Item Style -->
<Style x:Key="ItemTitleStyle" TargetType="{x:Type TextBlock}" >
@@ -34,9 +33,13 @@
<Style x:Key="ItemSubTitleStyle" TargetType="{x:Type TextBlock}" >
<Setter Property="Foreground" Value="#B3B2B0"></Setter>
</Style>
<Style x:Key="ItemStyle" TargetType="{x:Type UserControl}" >
<Setter Property="Background" Value="Transparent"></Setter>
<Style x:Key="ItemTitleSelectedStyle" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#F6F6FF" />
</Style>
<Style x:Key="ItemSubTitleSelectedStyle" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#F6F6FF" />
</Style>
<Color x:Key="ResultItemHighlightBackgroundColor">#543BFD</Color>
<Style x:Key="listboxStyle" TargetType="{x:Type ListBox}">
<Setter Property="BorderBrush" Value="Transparent"/>
@@ -128,4 +131,4 @@
</Setter>
</Style>
</ResourceDictionary>
</ResourceDictionary>