Skip to content

Commit 9f3d2e1

Browse files
committed
- Add 'No Result' message when no result
- Adjust Control Position
1 parent 1798e26 commit 9f3d2e1

File tree

2 files changed

+74
-22
lines changed

2 files changed

+74
-22
lines changed

Flow.Launcher/Languages/en.xaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@
6060

6161
<!-- Setting Plugin -->
6262
<system:String x:Key="searchplugin">Search Plugin</system:String>
63+
<system:String x:Key="searchplugin_Noresult_Title">No results to display</system:String>
64+
<system:String x:Key="searchplugin_Noresult_Subtitle">Try another search term.</system:String>
65+
<system:String x:Key="searchplugin_Noresult_Subtitle_Network">Please check your network connection or try another search term.</system:String>
6366
<system:String x:Key="plugin">Plugin</system:String>
6467
<system:String x:Key="browserMorePlugins">Find more plugins</system:String>
6568
<system:String x:Key="enable">On</system:String>

Flow.Launcher/SettingWindow.xaml

Lines changed: 71 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,55 @@
386386
<!--#endregion-->
387387
</Style>
388388

389+
<Style
390+
x:Key="PluginListStyle"
391+
BasedOn="{StaticResource {x:Type ListBox}}"
392+
TargetType="ListBox">
393+
<Style.Triggers>
394+
<DataTrigger Binding="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=Items.Count}" Value="0">
395+
<Setter Property="Template">
396+
<Setter.Value>
397+
<ControlTemplate>
398+
<Grid>
399+
<StackPanel>
400+
<TextBlock
401+
Margin="0,20,0,4"
402+
FontWeight="Bold"
403+
Text="{DynamicResource searchplugin_Noresult_Title}" />
404+
<TextBlock Text="{DynamicResource searchplugin_Noresult_Subtitle}" />
405+
</StackPanel>
406+
</Grid>
407+
</ControlTemplate>
408+
</Setter.Value>
409+
</Setter>
410+
</DataTrigger>
411+
</Style.Triggers>
412+
</Style>
413+
414+
<Style
415+
x:Key="StoreListStyle"
416+
BasedOn="{StaticResource {x:Type ListBox}}"
417+
TargetType="ListBox">
418+
<Style.Triggers>
419+
<DataTrigger Binding="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=Items.Count}" Value="0">
420+
<Setter Property="Template">
421+
<Setter.Value>
422+
<ControlTemplate>
423+
<Grid>
424+
<StackPanel>
425+
<TextBlock
426+
Margin="0,20,0,4"
427+
FontWeight="Bold"
428+
Text="{DynamicResource searchplugin_Noresult_Title}" />
429+
<TextBlock Text="{DynamicResource searchplugin_Noresult_Subtitle_Network}" />
430+
</StackPanel>
431+
</Grid>
432+
</ControlTemplate>
433+
</Setter.Value>
434+
</Setter>
435+
</DataTrigger>
436+
</Style.Triggers>
437+
</Style>
389438
<!-- For Tab Header responsive Width -->
390439
<Style TargetType="{x:Type TabControl}">
391440
<Setter Property="FontSize" Value="14" />
@@ -914,7 +963,7 @@
914963
<DockPanel DockPanel.Dock="Right">
915964
<TextBox
916965
Name="pluginFilterTxb"
917-
Width="250"
966+
Width="150"
918967
Height="34"
919968
Margin="0,5,26,0"
920969
HorizontalAlignment="Right"
@@ -975,7 +1024,8 @@
9751024
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
9761025
SelectedItem="{Binding SelectedPlugin}"
9771026
SelectionChanged="SelectedPluginChanged"
978-
SnapsToDevicePixels="True">
1027+
SnapsToDevicePixels="True"
1028+
Style="{DynamicResource PluginListStyle}">
9791029
<ListBox.ItemsPanel>
9801030
<ItemsPanelTemplate>
9811031
<StackPanel Margin="0,0,0,18" />
@@ -1322,22 +1372,12 @@
13221372
<DockPanel
13231373
Grid.Row="0"
13241374
Grid.Column="1"
1325-
Margin="5,18,0,0">
1326-
<Button
1327-
Height="34"
1328-
Margin="0,5,16,5"
1329-
Padding="12,4,12,4"
1330-
HorizontalAlignment="Right"
1331-
VerticalAlignment="Center"
1332-
Click="OnPluginStoreRefreshClick"
1333-
Content="{DynamicResource refresh}"
1334-
DockPanel.Dock="Right"
1335-
FontSize="13" />
1375+
Margin="5,24,0,0">
13361376
<TextBox
13371377
Name="pluginStoreFilterTxb"
1338-
Width="250"
1378+
Width="150"
13391379
Height="34"
1340-
Margin="0,0,6,0"
1380+
Margin="0,0,26,0"
13411381
HorizontalAlignment="Right"
13421382
DockPanel.Dock="Right"
13431383
FontSize="14"
@@ -1375,7 +1415,16 @@
13751415
</Style>
13761416
</TextBox.Style>
13771417
</TextBox>
1378-
1418+
<Button
1419+
Height="34"
1420+
Margin="0,5,10,5"
1421+
Padding="12,4,12,4"
1422+
HorizontalAlignment="Right"
1423+
VerticalAlignment="Center"
1424+
Click="OnPluginStoreRefreshClick"
1425+
Content="{DynamicResource refresh}"
1426+
DockPanel.Dock="Right"
1427+
FontSize="13" />
13791428
</DockPanel>
13801429
<Border
13811430
Grid.Row="1"
@@ -1385,19 +1434,20 @@
13851434
<ListBox
13861435
x:Name="StoreListBox"
13871436
Width="Auto"
1388-
Margin="6,0,0,0"
1437+
Margin="5,1,0,0"
13891438
Padding="0,0,0,0"
13901439
HorizontalAlignment="Stretch"
13911440
VerticalContentAlignment="Center"
13921441
Background="{DynamicResource Color01B}"
13931442
ItemContainerStyle="{StaticResource StoreList}"
13941443
ItemsSource="{Binding ExternalPlugins}"
13951444
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
1396-
SelectionMode="Single">
1445+
SelectionMode="Single"
1446+
Style="{DynamicResource StoreListStyle}">
13971447
<ListBox.ItemsPanel>
13981448
<ItemsPanelTemplate>
13991449
<UniformGrid
1400-
Margin="0,0,6,18"
1450+
Margin="0,0,17,18"
14011451
HorizontalAlignment="Left"
14021452
VerticalAlignment="Top"
14031453
Columns="3"
@@ -1576,15 +1626,15 @@
15761626
VerticalAlignment="Top">
15771627
<StackPanel Orientation="Vertical">
15781628
<TextBlock
1579-
Margin="20,20,0,0"
1629+
Margin="20,20,20,0"
15801630
Padding="0,0,0,0"
15811631
FontWeight="Bold"
15821632
Foreground="{DynamicResource Color05B}"
15831633
Text="{Binding Name}"
15841634
TextWrapping="WrapWithOverflow"
15851635
ToolTip="{Binding Name}" />
15861636
<TextBlock
1587-
Margin="20,4,0,0"
1637+
Margin="20,4,20,0"
15881638
Padding="0,0,20,0"
15891639
Foreground="{DynamicResource Color05B}"
15901640
Text="{Binding Version}"
@@ -1625,7 +1675,6 @@
16251675
</ListBox.ItemTemplate>
16261676
</ListBox>
16271677
</Border>
1628-
16291678
</Grid>
16301679
</TabItem>
16311680
<!--#endregion-->

0 commit comments

Comments
 (0)