Skip to content

Commit e7128f9

Browse files
authored
Merge pull request #1566 from onesounds/ThemeRedesign
Improve Themes
2 parents 63a05fc + 7f375be commit e7128f9

32 files changed

+1307
-769
lines changed

Flow.Launcher/Flow.Launcher.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,4 +126,4 @@
126126
<Analyzer Include="@(FilteredAnalyzer)" />
127127
</ItemGroup>
128128
</Target>
129-
</Project>
129+
</Project>

Flow.Launcher/MainWindow.xaml

Lines changed: 189 additions & 177 deletions
Large diffs are not rendered by default.

Flow.Launcher/ResultListBox.xaml

Lines changed: 78 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
88
xmlns:vm="clr-namespace:Flow.Launcher.ViewModel"
99
MaxHeight="{Binding MaxHeight}"
10-
Margin="{Binding Margin}"
10+
Margin="{DynamicResource ResultMargin}"
1111
HorizontalContentAlignment="Stretch"
1212
d:DataContext="{d:DesignInstance vm:ResultsViewModel}"
1313
d:DesignHeight="100"
@@ -17,6 +17,10 @@
1717
ItemsSource="{Binding Results}"
1818
KeyboardNavigation.DirectionalNavigation="Cycle"
1919
PreviewMouseDown="ListBox_PreviewMouseDown"
20+
PreviewMouseLeftButtonDown="ResultList_PreviewMouseLeftButtonDown"
21+
PreviewMouseLeftButtonUp="ResultListBox_OnPreviewMouseUp"
22+
PreviewMouseMove="ResultList_MouseMove"
23+
PreviewMouseRightButtonDown="ResultListBox_OnPreviewMouseRightButtonDown"
2024
SelectedIndex="{Binding SelectedIndex, Mode=TwoWay}"
2125
SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
2226
SelectionChanged="OnSelectionChanged"
@@ -25,17 +29,12 @@
2529
VirtualizingStackPanel.IsVirtualizing="True"
2630
VirtualizingStackPanel.VirtualizationMode="Standard"
2731
Visibility="{Binding Visbility}"
28-
mc:Ignorable="d"
29-
PreviewMouseMove="ResultList_MouseMove"
30-
PreviewMouseLeftButtonDown="ResultList_PreviewMouseLeftButtonDown"
31-
PreviewMouseLeftButtonUp="ResultListBox_OnPreviewMouseUp"
32-
PreviewMouseRightButtonDown="ResultListBox_OnPreviewMouseRightButtonDown">
32+
mc:Ignorable="d">
3333
<!-- IsSynchronizedWithCurrentItem: http://stackoverflow.com/a/7833798/2833083 -->
3434

3535
<ListBox.ItemTemplate>
3636
<DataTemplate>
37-
<Button
38-
HorizontalAlignment="Stretch">
37+
<Button HorizontalAlignment="Stretch">
3938
<Button.Template>
4039
<ControlTemplate>
4140
<ContentPresenter Content="{TemplateBinding Button.Content}" />
@@ -56,19 +55,19 @@
5655
<Grid.ColumnDefinitions>
5756
<ColumnDefinition Width="60" />
5857
<ColumnDefinition Width="9*" />
59-
<ColumnDefinition Width="Auto" />
58+
<ColumnDefinition Width="Auto" MinWidth="8" />
6059
</Grid.ColumnDefinitions>
6160
<StackPanel
6261
Grid.Column="2"
6362
Margin="0,0,10,0"
63+
VerticalAlignment="Center"
6464
Visibility="{Binding ShowOpenResultHotkey}">
6565
<TextBlock
6666
x:Name="Hotkey"
6767
Margin="12,0,12,0"
68-
Padding="0,10,0,10"
68+
Padding="0,0,0,0"
6969
HorizontalAlignment="Right"
7070
VerticalAlignment="Center"
71-
Opacity="0.8"
7271
Style="{DynamicResource ItemHotkeyStyle}">
7372
<TextBlock.Visibility>
7473
<Binding Converter="{StaticResource ResourceKey=OpenResultHotkeyVisibilityConverter}" RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType=ListBoxItem}" />
@@ -81,69 +80,93 @@
8180
</TextBlock.Text>
8281
</TextBlock>
8382
</StackPanel>
84-
<Border
85-
Margin="9,0,0,0"
86-
BorderBrush="Transparent"
87-
BorderThickness="0">
88-
<Image
89-
x:Name="ImageIcon"
90-
Width="{Binding IconXY}"
91-
Height="{Binding IconXY}"
92-
Margin="0,0,0,0" IsHitTestVisible="False"
93-
HorizontalAlignment="Center"
94-
Source="{Binding Image, TargetNullValue={x:Null}}"
95-
Stretch="Uniform"
96-
Visibility="{Binding ShowIcon}">
97-
<Image.Clip>
98-
<EllipseGeometry RadiusX="{Binding IconRadius}" RadiusY="{Binding IconRadius}" Center="16 16"/>
99-
</Image.Clip>
100-
</Image>
101-
</Border>
102-
<Border
103-
Margin="9,0,0,0"
104-
BorderBrush="Transparent"
105-
BorderThickness="0">
106-
<TextBlock
83+
84+
<Grid Grid.Column="0">
85+
<Grid.ColumnDefinitions>
86+
<ColumnDefinition Width="Auto" />
87+
<ColumnDefinition />
88+
</Grid.ColumnDefinitions>
89+
90+
<Border
91+
x:Name="Bullet"
10792
Grid.Column="0"
108-
HorizontalAlignment="Center"
109-
VerticalAlignment="Center"
110-
FontFamily="{Binding Glyph.FontFamily}"
111-
Style="{DynamicResource ItemGlyph}"
112-
Text="{Binding Glyph.Glyph}"
113-
Visibility="{Binding ShowGlyph}" />
114-
</Border>
93+
Style="{DynamicResource BulletStyle}" />
94+
95+
<Border
96+
Grid.Column="1"
97+
Margin="9,0,0,0"
98+
BorderBrush="Transparent"
99+
BorderThickness="1">
100+
<Image
101+
x:Name="ImageIcon"
102+
Width="{Binding IconXY}"
103+
Height="{Binding IconXY}"
104+
Margin="0,0,0,0"
105+
HorizontalAlignment="Center"
106+
IsHitTestVisible="False"
107+
Source="{Binding Image, TargetNullValue={x:Null}}"
108+
Stretch="Uniform"
109+
Visibility="{Binding ShowIcon}">
110+
<Image.Clip>
111+
<EllipseGeometry
112+
Center="16 16"
113+
RadiusX="{Binding IconRadius}"
114+
RadiusY="{Binding IconRadius}" />
115+
</Image.Clip>
116+
</Image>
117+
</Border>
118+
<Border
119+
Grid.Column="1"
120+
Margin="9,0,0,0"
121+
BorderBrush="Transparent"
122+
BorderThickness="0">
123+
<TextBlock
124+
x:Name="GlyphIcon"
125+
HorizontalAlignment="Center"
126+
VerticalAlignment="Center"
127+
FontFamily="{Binding Glyph.FontFamily}"
128+
Style="{DynamicResource ItemGlyph}"
129+
Text="{Binding Glyph.Glyph}"
130+
Visibility="{Binding ShowGlyph}" />
131+
</Border>
132+
</Grid>
133+
115134
<Grid
116135
Grid.Column="1"
117136
Margin="6,0,10,0"
118-
HorizontalAlignment="Stretch">
137+
HorizontalAlignment="Stretch"
138+
VerticalAlignment="Center">
119139
<Grid.RowDefinitions>
120-
<RowDefinition />
140+
<RowDefinition Height="Auto" />
121141
<RowDefinition x:Name="SubTitleRowDefinition" Height="Auto" />
122142
</Grid.RowDefinitions>
123143
<ProgressBar
124144
x:Name="progressbarResult"
145+
Grid.Row="0"
125146
Foreground="{Binding Result.ProgressBarColor}"
126147
Value="{Binding ResultProgress, Mode=OneWay}">
127148
<ProgressBar.Style>
128-
<Style TargetType="ProgressBar" BasedOn="{StaticResource ProgressBarResult}">
129-
<Setter Property="Visibility" Value="Visible"/>
149+
<Style BasedOn="{StaticResource ProgressBarResult}" TargetType="ProgressBar">
150+
<Setter Property="Visibility" Value="Visible" />
130151
<Style.Triggers>
131152
<DataTrigger Binding="{Binding Result.ProgressBar}" Value="{x:Null}">
132-
<Setter Property="Visibility" Value="Collapsed"/>
153+
<Setter Property="Visibility" Value="Collapsed" />
133154
</DataTrigger>
134155
</Style.Triggers>
135156
</Style>
136157
</ProgressBar.Style>
137158
</ProgressBar>
138159
<TextBlock
139160
x:Name="Title"
161+
Grid.Row="0"
140162
VerticalAlignment="Center"
141163
DockPanel.Dock="Left"
164+
IsEnabled="False"
142165
Style="{DynamicResource ItemTitleStyle}"
143166
Text="{Binding Result.Title}"
167+
TextTrimming="CharacterEllipsis"
144168
ToolTip="{Binding ShowTitleToolTip}"
145-
ToolTipService.ShowOnDisabled="True"
146-
IsEnabled="False">
169+
ToolTipService.ShowOnDisabled="True">
147170
<vm:ResultsViewModel.FormattedText>
148171
<MultiBinding Converter="{StaticResource HighlightTextConverter}">
149172
<Binding Path="Result.Title" />
@@ -155,10 +178,11 @@
155178
x:Name="SubTitle"
156179
Grid.Row="1"
157180
IsEnabled="False"
158-
ToolTipService.ShowOnDisabled="True"
159181
Style="{DynamicResource ItemSubTitleStyle}"
160182
Text="{Binding Result.SubTitle}"
161-
ToolTip="{Binding ShowSubTitleToolTip}"/>
183+
TextTrimming="CharacterEllipsis"
184+
ToolTip="{Binding ShowSubTitleToolTip}"
185+
ToolTipService.ShowOnDisabled="True" />
162186
</Grid>
163187

164188
</Grid>
@@ -167,10 +191,12 @@
167191
<!-- a result item height is 52 including margin -->
168192
<DataTemplate.Triggers>
169193
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ListBoxItem}}, Path=IsSelected}" Value="True">
194+
<Setter TargetName="Bullet" Property="Style" Value="{DynamicResource ItemBulletSelectedStyle}" />
170195
<Setter TargetName="Title" Property="Style" Value="{DynamicResource ItemTitleSelectedStyle}" />
171196
<Setter TargetName="SubTitle" Property="Style" Value="{DynamicResource ItemSubTitleSelectedStyle}" />
172197
<Setter TargetName="Hotkey" Property="Style" Value="{DynamicResource ItemHotkeySelectedStyle}" />
173198
<Setter TargetName="ImageIcon" Property="Style" Value="{DynamicResource ItemImageSelectedStyle}" />
199+
<Setter TargetName="GlyphIcon" Property="Style" Value="{DynamicResource ItemGlyphSelectedStyle}" />
174200
</DataTrigger>
175201
</DataTemplate.Triggers>
176202
</DataTemplate>
@@ -189,8 +215,10 @@
189215
<ControlTemplate TargetType="{x:Type ListBoxItem}">
190216
<Border
191217
x:Name="Bd"
218+
Margin="{DynamicResource ItemMargin}"
192219
Background="{TemplateBinding Background}"
193220
BorderBrush="{TemplateBinding BorderBrush}"
221+
CornerRadius="{DynamicResource ItemRadius}"
194222
SnapsToDevicePixels="True">
195223
<ContentPresenter
196224
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"

Flow.Launcher/SettingWindow.xaml

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,10 @@
3939
</Window.CommandBindings>
4040

4141
<Window.Resources>
42-
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
4342
<converters:BorderClipConverter x:Key="BorderClipConverter" />
4443
<converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
4544
<converters:TextConverter x:Key="TextConverter" />
46-
<converters:TranlationConverter x:Key="TranlationConverter" />
45+
<converters:TranlationConverter x:Key="TranslationConverter" />
4746
<CollectionViewSource x:Key="SortedFonts" Source="{Binding Source={x:Static Fonts.SystemFontFamilies}}">
4847
<CollectionViewSource.SortDescriptions>
4948
<scm:SortDescription PropertyName="Source" />
@@ -1824,17 +1823,18 @@
18241823
<StackPanel
18251824
x:Name="ClockPanel"
18261825
IsHitTestVisible="False"
1827-
Style="{DynamicResource ClockPanel}">
1826+
Style="{DynamicResource ClockPanel}"
1827+
Visibility="Visible">
18281828
<TextBlock
18291829
x:Name="ClockBox"
18301830
Style="{DynamicResource ClockBox}"
18311831
Text="{Binding ClockText}"
1832-
Visibility="{Binding Settings.UseClock, Converter={StaticResource BooleanToVisibilityConverter}}" />
1832+
Visibility="{Binding Settings.UseClock, Converter={StaticResource BoolToVisibilityConverter}}" />
18331833
<TextBlock
18341834
x:Name="DateBox"
18351835
Style="{DynamicResource DateBox}"
18361836
Text="{Binding DateText}"
1837-
Visibility="{Binding Settings.UseDate, Converter={StaticResource BooleanToVisibilityConverter}}" />
1837+
Visibility="{Binding Settings.UseDate, Converter={StaticResource BoolToVisibilityConverter}}" />
18381838
</StackPanel>
18391839
<Canvas Style="{DynamicResource SearchIconPosition}">
18401840
<Path
@@ -2012,8 +2012,8 @@
20122012
Margin="10"
20132013
HorizontalAlignment="Right"
20142014
DockPanel.Dock="Top">
2015-
<Hyperlink NavigateUri="{Binding Theme, Mode=OneWay}" RequestNavigate="OnRequestNavigate">
2016-
<Run Text="{DynamicResource howToCreateTheme}" />
2015+
<Hyperlink NavigateUri="{Binding ThemeGallery, Mode=OneWay}" RequestNavigate="OnRequestNavigate">
2016+
<Run Text="{DynamicResource browserMoreThemes}" />
20172017
</Hyperlink>
20182018
</TextBlock>
20192019
</Border>
@@ -2323,7 +2323,7 @@
23232323
</ItemsControl>
23242324
</Border>
23252325

2326-
<Border Margin="0,0,0,18" Style="{DynamicResource SettingGroupBox}">
2326+
<Border Margin="0,0,0,0" Style="{DynamicResource SettingGroupBox}">
23272327
<ItemsControl Style="{StaticResource SettingGrid}">
23282328
<StackPanel Style="{StaticResource TextPanel}">
23292329
<TextBlock Style="{DynamicResource SettingTitleLabel}" Text="{DynamicResource ThemeFolder}" />
@@ -2341,6 +2341,16 @@
23412341
</TextBlock>
23422342
</ItemsControl>
23432343
</Border>
2344+
<Border>
2345+
<TextBlock
2346+
Margin="10,10,10,18"
2347+
HorizontalAlignment="Right"
2348+
DockPanel.Dock="Top">
2349+
<Hyperlink NavigateUri="{Binding Theme, Mode=OneWay}" RequestNavigate="OnRequestNavigate">
2350+
<Run Text="{DynamicResource howToCreateTheme}" />
2351+
</Hyperlink>
2352+
</TextBlock>
2353+
</Border>
23442354
</StackPanel>
23452355
</StackPanel>
23462356
</Grid>
@@ -2615,7 +2625,7 @@
26152625
<GridViewColumn Width="430" Header="{DynamicResource builtinShortcutDescription}">
26162626
<GridViewColumn.CellTemplate>
26172627
<DataTemplate>
2618-
<TextBlock Text="{Binding Description, Converter={StaticResource TranlationConverter}}" />
2628+
<TextBlock Text="{Binding Description, Converter={StaticResource TranslationConverter}}" />
26192629
</DataTemplate>
26202630
</GridViewColumn.CellTemplate>
26212631
</GridViewColumn>

0 commit comments

Comments
 (0)