Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
3a0594f
- Changing Result item and hotkey layout
onesounds Sep 27, 2021
0c47557
Add Modern Theme
onesounds Sep 27, 2021
b07a437
delete margin
onesounds Sep 27, 2021
7789c1c
adjust padding
onesounds Sep 27, 2021
c6f1a00
adjust
onesounds Sep 27, 2021
53c04fd
Fix Separator
onesounds Sep 27, 2021
f07a009
- Add Textbox Caret Color
onesounds Sep 27, 2021
4ced995
- Delete Comment
onesounds Sep 27, 2021
f83212a
remove itemgroup in csproj.
onesounds Sep 27, 2021
c227ba3
- fix for build (recovery some item group)
onesounds Sep 27, 2021
3bc3563
- Rollback Classic Skins
onesounds Sep 28, 2021
46917ea
but default hotkey color is not same subtitle color in classicthemes …
onesounds Sep 28, 2021
3e25030
Merge branch 'ModernTheme' of https://github.com/onesounds/Flow.Launc…
onesounds Sep 28, 2021
91d21a7
- Search Ico- In the theme, search icons can be inserted and styled (…
onesounds Sep 28, 2021
505b4cb
fix win11light theme seperator margin
onesounds Sep 28, 2021
8eba28f
- fix the theme preview in setting window
onesounds Sep 28, 2021
f1bfa5c
Fix Selected color in Darker.theme
onesounds Sep 30, 2021
9d10b7f
Fix the White Querybox in Metro Server.theme
onesounds Sep 30, 2021
bb7b0cd
- Add Magnifier in Win 11 Light/Dark Theme
onesounds Sep 30, 2021
ecb0cac
- Add listbox clipping class for rounded corner theme.
onesounds Oct 1, 2021
6a58576
- clean code
onesounds Oct 1, 2021
136f227
- Fix Responsive Query Area
onesounds Oct 1, 2021
c89d277
- Fix Responsive Query Area
onesounds Oct 1, 2021
49f00f5
- Fix List Item Margin
onesounds Oct 1, 2021
8e93969
- Fix pink theme (querybox witdh)
onesounds Oct 1, 2021
6048de4
- Fix Querybox Width
onesounds Oct 1, 2021
6211275
- Fix Setting window preview (last item clip)
onesounds Oct 1, 2021
c32ae79
Merge branch 'ModernTheme' of https://github.com/onesounds/Flow.Launc…
onesounds Oct 1, 2021
2b7855c
Change default Scrollbar Thumb color
onesounds Oct 1, 2021
39b53d9
Change default Scrollbar Thumb color
onesounds Oct 1, 2021
2144577
- Adjust Theme Preivew in setting window
onesounds Oct 1, 2021
03d134d
Add sublime theme
onesounds Oct 1, 2021
6e047e0
Fix Icon Image little cut #710
onesounds Oct 1, 2021
e7b4dd1
- Add ItemHotkeySelectedStyle Property
onesounds Oct 2, 2021
df3c5bf
- Add ItemHotkeySelectedStyle Property
onesounds Oct 2, 2021
89f4f5d
Fix Win11Light font size
onesounds Oct 2, 2021
1621f34
Fix Win11Light font size
onesounds Oct 2, 2021
92f0041
Merge branch 'ModernTheme' of https://github.com/onesounds/Flow.Launc…
onesounds Oct 2, 2021
c1b0929
- Redesign Setting Window
onesounds Oct 3, 2021
832405a
- Adjust base.xaml to match original(1.8) size for classic themes
onesounds Oct 4, 2021
1c96f04
- Adjust base.xaml to match original(1.8) size for classic themes
onesounds Oct 4, 2021
ca179be
- Adjust Plugin Tab in setting window
onesounds Oct 4, 2021
ed5bd5b
Merge branch 'ModernTheme' of https://github.com/onesounds/Flow.Launc…
onesounds Oct 4, 2021
4e01019
Merge branch 'ModernTheme' of https://github.com/onesounds/Flow.Launc…
onesounds Oct 4, 2021
d084793
Merge branch 'ModernTheme' of https://github.com/onesounds/Flow.Launc…
onesounds Oct 4, 2021
e201df9
- Fix Dropshadow
onesounds Oct 4, 2021
6c43a48
- Add Left/Right Key for context menu.
onesounds Oct 4, 2021
a5534ca
Update Flow.Launcher/Converters/BorderClipConverter.cs
onesounds Oct 5, 2021
d1e7b4e
Update Flow.Launcher/Flow.Launcher.csproj
onesounds Oct 5, 2021
1948ec5
Update Flow.Launcher/Flow.Launcher.csproj
onesounds Oct 5, 2021
88a9767
- delete csproj
onesounds Oct 5, 2021
10accd5
- Change value progress bar (using actual window)
onesounds Oct 5, 2021
d902a1e
use switch statement for Left/Right context menu logic
jjw24 Oct 5, 2021
e14bb23
- Merge "use switch statement for Left/Right context menu logic"
onesounds Oct 5, 2021
1b1a81d
- Rollback progressbar
onesounds Oct 5, 2021
12f95d1
- Fix Sperator(if it has) is not visible in the context menu or history.
onesounds Oct 5, 2021
25b5f30
- Add automatically height for subtitle.
onesounds Oct 5, 2021
8aaeb85
- item of *.lnk remove subtitle (for test)
onesounds Oct 5, 2021
66e722b
- Change context icon to glyph in some plugin
onesounds Oct 6, 2021
1149ff5
- Add Close Context menu in main window query bar
onesounds Oct 6, 2021
c74a2db
- Add clock in query bar (sublime theme only)
onesounds Oct 6, 2021
763cab8
Revert "- Add clock in query bar (sublime theme only)"
onesounds Oct 6, 2021
54145d7
revert subtitle change
jjw24 Oct 6, 2021
5f0df98
adjust Program plugin width
jjw24 Oct 6, 2021
04a10ed
add glyph option to settings
jjw24 Oct 7, 2021
4f19355
update wording
jjw24 Oct 7, 2021
1d746c2
- Fix ProgressBar (Finally!)
onesounds Oct 7, 2021
42dda34
add ItemHotkeyStyle key into dictionary
jjw24 Oct 8, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 26 additions & 23 deletions Flow.Launcher.Core/Resource/Theme.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,9 @@ private ResourceDictionary CurrentThemeResourceDictionary()
public ResourceDictionary GetResourceDictionary()
{
var dict = CurrentThemeResourceDictionary();

Style queryBoxStyle = dict["QueryBoxStyle"] as Style;
Style querySuggestionBoxStyle = dict["QuerySuggestionBoxStyle"] as Style;

if (queryBoxStyle != null && querySuggestionBoxStyle != null)

if (dict["QueryBoxStyle"] is Style queryBoxStyle &&
dict["QuerySuggestionBoxStyle"] is Style querySuggestionBoxStyle)
{
var fontFamily = new FontFamily(Settings.QueryBoxFont);
var fontStyle = FontHelper.GetFontStyleFromInvariantStringOrNormal(Settings.QueryBoxFontStyle);
Expand All @@ -174,19 +172,22 @@ public ResourceDictionary GetResourceDictionary()
querySuggestionBoxStyle.Setters.Add(new Setter(TextBox.FontStretchProperty, fontStretch));
}

Style resultItemStyle = dict["ItemTitleStyle"] as Style;
Style resultSubItemStyle = dict["ItemSubTitleStyle"] as Style;
Style resultItemSelectedStyle = dict["ItemTitleSelectedStyle"] as Style;
Style resultSubItemSelectedStyle = dict["ItemSubTitleSelectedStyle"] as Style;
if (resultItemStyle != null && resultSubItemStyle != null && resultSubItemSelectedStyle != null && resultItemSelectedStyle != null)
if (dict["ItemTitleStyle"] is Style resultItemStyle &&
dict["ItemSubTitleStyle"] is Style resultSubItemStyle &&
dict["ItemSubTitleSelectedStyle"] is Style resultSubItemSelectedStyle &&
dict["ItemTitleSelectedStyle"] is Style resultItemSelectedStyle &&
dict["ItemHotkeyStyle"] is Style resultHotkeyItemStyle &&
dict["ItemHotkeySelectedStyle"] is Style resultHotkeyItemSelectedStyle)
{
Setter fontFamily = new Setter(TextBlock.FontFamilyProperty, new FontFamily(Settings.ResultFont));
Setter fontStyle = new Setter(TextBlock.FontStyleProperty, FontHelper.GetFontStyleFromInvariantStringOrNormal(Settings.ResultFontStyle));
Setter fontWeight = new Setter(TextBlock.FontWeightProperty, FontHelper.GetFontWeightFromInvariantStringOrNormal(Settings.ResultFontWeight));
Setter fontStretch = new Setter(TextBlock.FontStretchProperty, FontHelper.GetFontStretchFromInvariantStringOrNormal(Settings.ResultFontStretch));

Setter[] setters = { fontFamily, fontStyle, fontWeight, fontStretch };
Array.ForEach(new[] { resultItemStyle, resultSubItemStyle, resultItemSelectedStyle, resultSubItemSelectedStyle }, o => Array.ForEach(setters, p => o.Setters.Add(p)));
Array.ForEach(
new[] { resultItemStyle, resultSubItemStyle, resultItemSelectedStyle, resultSubItemSelectedStyle, resultHotkeyItemStyle, resultHotkeyItemSelectedStyle }, o
=> Array.ForEach(setters, p => o.Setters.Add(p)));
}

var windowStyle = dict["WindowStyle"] as Style;
Expand Down Expand Up @@ -236,17 +237,19 @@ private string GetThemePath(string themeName)

public void AddDropShadowEffectToCurrentTheme()
{
var dict = CurrentThemeResourceDictionary();
var dict = GetResourceDictionary();

var windowBorderStyle = dict["WindowBorderStyle"] as Style;

var effectSetter = new Setter();
effectSetter.Property = Border.EffectProperty;
effectSetter.Value = new DropShadowEffect
var effectSetter = new Setter
{
Opacity = 0.9,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you provide a screenshot for people to check the effect of this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
It turned into a softer shadow. I tried to give it a feeling that is commonly used in modern Windows.

ShadowDepth = 2,
BlurRadius = 15
Property = Border.EffectProperty,
Value = new DropShadowEffect
{
Opacity = 0.4,
ShadowDepth = 2,
BlurRadius = 15
}
};

var marginSetter = windowBorderStyle.Setters.FirstOrDefault(setterBase => setterBase is Setter setter && setter.Property == Border.MarginProperty) as Setter;
Expand All @@ -261,7 +264,7 @@ public void AddDropShadowEffectToCurrentTheme()
}
else
{
var baseMargin = (Thickness) marginSetter.Value;
var baseMargin = (Thickness)marginSetter.Value;
var newMargin = new Thickness(
baseMargin.Left + ShadowExtraMargin,
baseMargin.Top + ShadowExtraMargin,
Expand All @@ -282,8 +285,8 @@ public void RemoveDropShadowEffectFromCurrentTheme()

var effectSetter = windowBorderStyle.Setters.FirstOrDefault(setterBase => setterBase is Setter setter && setter.Property == Border.EffectProperty) as Setter;
var marginSetter = windowBorderStyle.Setters.FirstOrDefault(setterBase => setterBase is Setter setter && setter.Property == Border.MarginProperty) as Setter;
if(effectSetter != null)

if (effectSetter != null)
{
windowBorderStyle.Setters.Remove(effectSetter);
}
Expand Down Expand Up @@ -371,11 +374,11 @@ private bool IsBlurTheme()
private void SetWindowAccent(Window w, AccentState state)
{
var windowHelper = new WindowInteropHelper(w);

// this determines the width of the main query window
w.Width = mainWindowWidth;
windowHelper.EnsureHandle();

var accent = new AccentPolicy { AccentState = state };
var accentStructSize = Marshal.SizeOf(accent);

Expand Down
1 change: 1 addition & 0 deletions Flow.Launcher.Infrastructure/UserSettings/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public string Language
public string ResultFontStyle { get; set; }
public string ResultFontWeight { get; set; }
public string ResultFontStretch { get; set; }
public bool UseGlyphIcons { get; set; } = true;


/// <summary>
Expand Down
57 changes: 57 additions & 0 deletions Flow.Launcher/Converters/BorderClipConverter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Data;
using System.Windows.Media;
using System.Windows.Documents;
using System.Windows.Shapes;

// For Clipping inside listbox item

namespace Flow.Launcher.Converters
{
public class BorderClipConverter : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
if (values.Length == 3 && values[0] is double && values[1] is double && values[2] is CornerRadius)
{
var width = (double)values[0];
var height = (double)values[1];
Path myPath = new Path();
if (width < Double.Epsilon || height < Double.Epsilon)
{
return Geometry.Empty;
}
var radius = (CornerRadius)values[2];
var radiusHeight = radius.TopLeft;

// Drawing Round box for bottom round, and rect for top area of listbox.
var corner = new RectangleGeometry(new Rect(0, 0, width, height), radius.TopLeft, radius.TopLeft);
var box = new RectangleGeometry(new Rect(0, 0, width, radiusHeight), 0, 0);

GeometryGroup myGeometryGroup = new GeometryGroup();
myGeometryGroup.Children.Add(corner);
myGeometryGroup.Children.Add(box);

CombinedGeometry c1 = new CombinedGeometry(GeometryCombineMode.Union, corner, box);
myPath.Data = c1;

myPath.Data.Freeze();
return myPath.Data;
}

return DependencyProperty.UnsetValue;
}

public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
{
throw new NotSupportedException();
}
}

}
5 changes: 4 additions & 1 deletion Flow.Launcher/Converters/HighlightTextConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Data;
using System.Windows.Media;
using System.Windows.Documents;

namespace Flow.Launcher.Converters
Expand All @@ -30,7 +31,9 @@ public object Convert(object[] value, Type targetType, object parameter, Culture
var currentCharacter = text.Substring(i, 1);
if (this.ShouldHighlight(highlightData, i))
{
textBlock.Inlines.Add(new Bold(new Run(currentCharacter)));

textBlock.Inlines.Add(new Run(currentCharacter) { Style = (Style)Application.Current.FindResource("HighlightStyle") });

}
else
{
Expand Down
3 changes: 3 additions & 0 deletions Flow.Launcher/Flow.Launcher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Resources\Segoe Fluent Icons.ttf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>

<ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions Flow.Launcher/HotkeyControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
d:DesignHeight="300" d:DesignWidth="300">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150" />
<ColumnDefinition Width="125" />
<ColumnDefinition Width="160" />
</Grid.ColumnDefinitions>
<TextBox x:Name="tbHotkey" TabIndex="100" VerticalContentAlignment="Center" Grid.Column="0"
PreviewKeyDown="TbHotkey_OnPreviewKeyDown" input:InputMethod.IsInputMethodEnabled="False"/>
<TextBlock x:Name="tbMsg" Visibility="Hidden" Margin="5 0 0 0" VerticalAlignment="Center" Grid.Column="1" />
<TextBlock x:Name="tbMsg" Visibility="Hidden" Margin="8 0 0 0" VerticalAlignment="Center" Grid.Column="0" HorizontalAlignment="Right"/>
<TextBox x:Name="tbHotkey" TabIndex="100" VerticalContentAlignment="Center" Grid.Column="1"
PreviewKeyDown="TbHotkey_OnPreviewKeyDown" input:InputMethod.IsInputMethodEnabled="False" Margin="5 0 18 0"/>
</Grid>
</UserControl>
7 changes: 4 additions & 3 deletions Flow.Launcher/Languages/en.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<system:String x:Key="hideNotifyIcon">Hide tray icon</system:String>
<system:String x:Key="querySearchPrecision">Query Search Precision</system:String>
<system:String x:Key="ShouldUsePinyin">Should Use Pinyin</system:String>
<system:String x:Key="ShouldUsePinyinToolTip">Allows using Pinyin to search. Pinyin is the standard system of romanized spelling for transliterating Chinese</system:String>
<system:String x:Key="ShouldUsePinyinToolTip">Allows using Pinyin to search. Pinyin is the standard system of romanized spelling for translating Chinese</system:String>
<system:String x:Key="shadowEffectNotAllowed">Shadow effect is not allowed while current theme has blur effect enabled</system:String>

<!--Setting Plugin-->
Expand Down Expand Up @@ -81,8 +81,9 @@
<system:String x:Key="pleaseSelectAnItem">Please select an item</system:String>
<system:String x:Key="deleteCustomHotkeyWarning">Are you sure you want to delete {0} plugin hotkey?</system:String>
<system:String x:Key="queryWindowShadowEffect">Query window shadow effect</system:String>
<system:String x:Key="shadowEffectCPUUsage">Shadow effect has a substantial usage of GPU.</system:String>
<system:String x:Key="shadowEffectPerformance">Not recommended if your computer performance is limited.</system:String>
<system:String x:Key="shadowEffectCPUUsage">Shadow effect has a substantial usage of GPU. Not recommended if your computer performance is limited.</system:String>
<system:String x:Key="useGlyphUI">Use Segoe Fluent Icons</system:String>
<system:String x:Key="useGlyphUIEffect">Use Segoe Fluent Icons for query results where supported</system:String>

<!--Setting Proxy-->
<system:String x:Key="proxy">HTTP Proxy</system:String>
Expand Down
3 changes: 1 addition & 2 deletions Flow.Launcher/Languages/sk.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@
<system:String x:Key="pleaseSelectAnItem">Vyberte položku, prosím</system:String>
<system:String x:Key="deleteCustomHotkeyWarning">Ste si istý, že chcete odstrániť klávesovú skratku {0} pre plugin?</system:String>
<system:String x:Key="queryWindowShadowEffect">Tieňový efekt v poli vyhľadávania</system:String>
<system:String x:Key="shadowEffectCPUUsage">Tieňový efekt významne využíva GPU.</system:String>
<system:String x:Key="shadowEffectPerformance">Neodporúča sa, ak je výkon počítača obmedzený.</system:String>
<system:String x:Key="shadowEffectCPUUsage">Tieňový efekt významne využíva GPU. Neodporúča sa, ak je výkon počítača obmedzený.</system:String>

<!--Setting Proxy-->
<system:String x:Key="proxy">HTTP Proxy</system:String>
Expand Down
3 changes: 1 addition & 2 deletions Flow.Launcher/Languages/zh-cn.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@
<system:String x:Key="pleaseSelectAnItem">请选择一项</system:String>
<system:String x:Key="deleteCustomHotkeyWarning">你确定要删除插件 {0} 的热键吗?</system:String>
<system:String x:Key="queryWindowShadowEffect">查询窗口阴影效果</system:String>
<system:String x:Key="shadowEffectCPUUsage">阴影效果将占用大量的GPU资源。</system:String>
<system:String x:Key="shadowEffectPerformance">如果您的计算机性能有限,则不建议使用。</system:String>
<system:String x:Key="shadowEffectCPUUsage">阴影效果将占用大量的GPU资源。 如果您的计算机性能有限,则不建议使用。</system:String>

<!--设置,代理-->
<system:String x:Key="proxy">HTTP 代理</system:String>
Expand Down
Loading