Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
ba35f12
Add GetString api function
Jack251970 Jun 6, 2025
1f4578c
Add release notes window
Jack251970 Jun 6, 2025
7117ba0
Test release notes window
Jack251970 Jun 6, 2025
c241d21
Fix height
Jack251970 Jun 6, 2025
af0e118
Use loaded event & Add style
Jack251970 Jun 6, 2025
0249621
Add progress ring
Jack251970 Jun 6, 2025
1ef8d65
Adjust size
Jack251970 Jun 6, 2025
1f61d93
Follow theme change
Jack251970 Jun 6, 2025
394fd1d
Support light/dark style
Jack251970 Jun 7, 2025
84e91d2
Fix display issue
Jack251970 Jun 7, 2025
eee57e2
Improve code quality
Jack251970 Jun 7, 2025
458a8b3
Add mdxaml plugins
Jack251970 Jun 7, 2025
414db19
Open release notes in about page
Jack251970 Jun 7, 2025
749dcc6
Show release version after update
Jack251970 Jun 7, 2025
54c6eaa
Add see more uri button
Jack251970 Jun 7, 2025
88a2088
Update min width & min height
Jack251970 Jun 7, 2025
b4d5e57
Fix size change issue
Jack251970 Jun 7, 2025
a9eb17e
Make sure horizontally size good
Jack251970 Jun 7, 2025
4436a1e
Support smooth scroll
Jack251970 Jun 7, 2025
94f716f
Code quality
Jack251970 Jun 7, 2025
3444dcd
Code quality
Jack251970 Jun 7, 2025
4c00ff3
Fix height issue
Jack251970 Jun 7, 2025
e08dea9
Adjust margins
Jack251970 Jun 7, 2025
bee2cfa
Added error message
Jack251970 Jun 9, 2025
ad14684
Format xaml file
Jack251970 Jun 9, 2025
d313812
Add legacy message with button
Jack251970 Jun 9, 2025
3d555e7
Add new api function to show message with button
Jack251970 Jun 9, 2025
d787bba
Display message box with button
Jack251970 Jun 9, 2025
77d7b9d
Do not remove action when called
Jack251970 Jun 9, 2025
ad24aef
Use ConcurrentDictionary
Jack251970 Jun 9, 2025
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
13 changes: 13 additions & 0 deletions Flow.Launcher.Infrastructure/Http/Http.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
}

/// <summary>
/// Asynchrously send an HTTP request.

Check warning on line 210 in Flow.Launcher.Infrastructure/Http/Http.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`Asynchrously` is not a recognized word. (unrecognized-spelling)
/// </summary>
public static async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead, CancellationToken token = default)
{
Expand All @@ -220,5 +220,18 @@
return new HttpResponseMessage(HttpStatusCode.InternalServerError);
}
}

public static async Task<string> GetStringAsync(string url, CancellationToken token = default)
{
try
{
Log.Debug(ClassName, $"Url <{url}>");
return await client.GetStringAsync(url, token);
}
catch (System.Exception e)

Check warning on line 231 in Flow.Launcher.Infrastructure/Http/Http.cs

View workflow job for this annotation

GitHub Actions / build

The variable 'e' is declared but never used
{
return string.Empty;
}
}
}
}
3 changes: 2 additions & 1 deletion Flow.Launcher.Infrastructure/UserSettings/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

public void Initialize()
{
_stringMatcher = Ioc.Default.GetRequiredService<StringMatcher>();

Check warning on line 28 in Flow.Launcher.Infrastructure/UserSettings/Settings.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`Ioc` is not a recognized word. (unrecognized-spelling)
}

public void Save()
Expand All @@ -33,7 +33,6 @@
_storage.Save();
}

private string _theme = Constant.DefaultTheme;
public string Hotkey { get; set; } = $"{KeyConstant.Alt} + {KeyConstant.Space}";
public string OpenResultModifiers { get; set; } = KeyConstant.Alt;
public string ColorScheme { get; set; } = "System";
Expand Down Expand Up @@ -64,6 +63,7 @@
OnPropertyChanged();
}
}
private string _theme = Constant.DefaultTheme;
public string Theme
{
get => _theme;
Expand All @@ -79,6 +79,7 @@
}
public bool UseDropShadowEffect { get; set; } = true;
public BackdropTypes BackdropType{ get; set; } = BackdropTypes.None;
public string ReleaseNotesVersion { get; set; } = string.Empty;

/* Appearance Settings. It should be separated from the setting later.*/
public double WindowHeightSize { get; set; } = 42;
Expand Down
30 changes: 30 additions & 0 deletions Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,15 @@
/// <param name="subTitle">Optional message subtitle</param>
void ShowMsgError(string title, string subTitle = "");

/// <summary>
/// Show the error message using Flow's standard error icon.
/// </summary>
/// <param name="title">Message title</param>
/// <param name="buttonText">Message button content</param>
/// <param name="buttonAction">Message button action</param>
/// <param name="subTitle">Optional message subtitle</param>
void ShowMsgErrorWithButton(string title, string buttonText, Action buttonAction, string subTitle = "");

/// <summary>
/// Show the MainWindow when hiding
/// </summary>
Expand Down Expand Up @@ -127,6 +136,27 @@
/// <param name="useMainWindowAsOwner">when true will use main windows as the owner</param>
void ShowMsg(string title, string subTitle, string iconPath, bool useMainWindowAsOwner = true);

/// <summary>
/// Show message box with button
/// </summary>
/// <param name="title">Message title</param>
/// <param name="buttonText">Message button content</param>
/// <param name="buttonAction">Message button action</param>
/// <param name="subTitle">Message subtitle</param>
/// <param name="iconPath">Message icon path (relative path to your plugin folder)</param>
void ShowMsgWithButton(string title, string buttonText, Action buttonAction, string subTitle = "", string iconPath = "");

/// <summary>
/// Show message box with button
/// </summary>
/// <param name="title">Message title</param>
/// <param name="buttonText">Message button content</param>
/// <param name="buttonAction">Message button action</param>
/// <param name="subTitle">Message subtitle</param>
/// <param name="iconPath">Message icon path (relative path to your plugin folder)</param>
/// <param name="useMainWindowAsOwner">when true will use main windows as the owner</param>
void ShowMsgWithButton(string title, string buttonText, Action buttonAction, string subTitle, string iconPath, bool useMainWindowAsOwner = true);

/// <summary>
/// Open setting dialog
/// </summary>
Expand Down Expand Up @@ -207,7 +237,7 @@
Task<string> HttpGetStringAsync(string url, CancellationToken token = default);

/// <summary>
/// Http download the spefic url and return as stream

Check warning on line 240 in Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`spefic` is not a recognized word. (unrecognized-spelling)
/// </summary>
/// <param name="url">URL to call Http Get</param>
/// <param name="token">Cancellation Token</param>
Expand Down Expand Up @@ -348,7 +378,7 @@

/// <summary>
/// Reloads the query.
/// When current results are from context menu or history, it will go back to query results before requerying.

Check warning on line 381 in Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`requerying` is not a recognized word. (unrecognized-spelling)
/// </summary>
/// <param name="reselect">Choose the first result after reload if true; keep the last selected result if false. Default is true.</param>
public void ReQuery(bool reselect = true);
Expand Down
2 changes: 2 additions & 0 deletions Flow.Launcher/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
var storage = new FlowLauncherJsonStorage<Settings>();
_settings = storage.Load();
_settings.SetStorage(storage);
_settings.WMPInstalled = WindowsMediaPlayerHelper.IsWindowsMediaPlayerInstalled();

Check warning on line 63 in Flow.Launcher/App.xaml.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`WMP` is not a recognized word. (unrecognized-spelling)
}
catch (Exception e)
{
Expand Down Expand Up @@ -103,7 +103,7 @@
.AddTransient<SelectBrowserViewModel>()
.AddTransient<SelectFileManagerViewModel>()
).Build();
Ioc.Default.ConfigureServices(host.Services);

Check warning on line 106 in Flow.Launcher/App.xaml.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`Ioc` is not a recognized word. (unrecognized-spelling)
}
catch (Exception e)
{
Expand All @@ -114,9 +114,9 @@
// Initialize the public API and Settings first
try
{
API = Ioc.Default.GetRequiredService<IPublicAPI>();

Check warning on line 117 in Flow.Launcher/App.xaml.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`Ioc` is not a recognized word. (unrecognized-spelling)
_settings.Initialize();
_mainVM = Ioc.Default.GetRequiredService<MainViewModel>();

Check warning on line 119 in Flow.Launcher/App.xaml.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`Ioc` is not a recognized word. (unrecognized-spelling)
}
catch (Exception e)
{
Expand Down Expand Up @@ -171,6 +171,8 @@
Current.Resources["SettingWindowFont"] = new FontFamily(_settings.SettingWindowFont);
Current.Resources["ContentControlThemeFontFamily"] = new FontFamily(_settings.SettingWindowFont);

Notification.Install();

Ioc.Default.GetRequiredService<Portable>().PreStartCleanUpAfterPortabilityUpdate();

API.LogInfo(ClassName, "Begin Flow Launcher startup ----------------------------------------------------");
Expand All @@ -196,7 +198,7 @@
// Change language after all plugins are initialized because we need to update plugin title based on their api
await Ioc.Default.GetRequiredService<Internationalization>().InitializeLanguageAsync();

await imageLoadertask;

Check warning on line 201 in Flow.Launcher/App.xaml.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`Loadertask` is not a recognized word. (unrecognized-spelling)

_mainWindow = new MainWindow();

Expand All @@ -222,7 +224,7 @@
});
}

#pragma warning restore VSTHRD100 // Avoid async void methods

Check warning on line 227 in Flow.Launcher/App.xaml.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`VSTHRD` is not a recognized word. (unrecognized-spelling)

/// <summary>
/// Check startup only for Release
Expand Down
5 changes: 5 additions & 0 deletions Flow.Launcher/Flow.Launcher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="InputSimulator" Version="1.0.4" />
<PackageReference Include="MdXaml" Version="1.27.0" />
<PackageReference Include="MdXaml.AnimatedGif" Version="1.27.0" />
<PackageReference Include="MdXaml.Html" Version="1.27.0" />
<PackageReference Include="MdXaml.Plugins" Version="1.27.0" />
<PackageReference Include="MdXaml.Svg" Version="1.27.0" />
<!-- Do not upgrade Microsoft.Extensions.DependencyInjection and Microsoft.Extensions.Hosting since we are .Net7.0 -->
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
Expand Down
7 changes: 7 additions & 0 deletions Flow.Launcher/Languages/en.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,13 @@
<system:String x:Key="LogLevelINFO">Info</system:String>
<system:String x:Key="settingWindowFontTitle">Setting Window Font</system:String>

<!-- Release Notes Window -->
<system:String x:Key="seeMoreReleaseNotes">See more release notes on GitHub</system:String>
<system:String x:Key="checkNetworkConnectionTitle">Failed to fetch release notes</system:String>
<system:String x:Key="checkNetworkConnectionSubTitle">Please check your network connection or ensure GitHub is accessible</system:String>
<system:String x:Key="appUpdateTitle">Flow Launcher has been updated to {0}</system:String>
<system:String x:Key="appUpdateButtonContent">Click here to view the release notes</system:String>

<!-- FileManager Setting Dialog -->
<system:String x:Key="fileManagerWindow">Select File Manager</system:String>
<system:String x:Key="fileManager_learnMore">Learn more</system:String>
Expand Down
22 changes: 22 additions & 0 deletions Flow.Launcher/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ private void OnLoaded(object sender, RoutedEventArgs _)
// Set First Launch to false
_settings.FirstLaunch = false;

// Update release notes version
_settings.ReleaseNotesVersion = Constant.Version;

// Set Backdrop Type to Acrylic for Windows 11 when First Launch. Default is None
if (Win32Helper.IsBackdropSupported()) _settings.BackdropType = BackdropTypes.Acrylic;

Expand All @@ -132,6 +135,25 @@ private void OnLoaded(object sender, RoutedEventArgs _)
welcomeWindow.Show();
}

if (_settings.ReleaseNotesVersion != Constant.Version)
{
// Update release notes version
_settings.ReleaseNotesVersion = Constant.Version;

// Display message box with button
App.API.ShowMsgWithButton(
string.Format(App.API.GetTranslation("appUpdateTitle"), Constant.Version),
App.API.GetTranslation("appUpdateButtonContent"),
() =>
{
Application.Current.Dispatcher.Invoke(() =>
{
var releaseNotesWindow = new ReleaseNotesWindow();
releaseNotesWindow.Show();
});
});
}

// Initialize place holder
SetupPlaceholderText();
_viewModel.PlaceholderText = _settings.PlaceholderText;
Expand Down
77 changes: 56 additions & 21 deletions Flow.Launcher/Msg.xaml
Original file line number Diff line number Diff line change
@@ -1,41 +1,76 @@
<Window x:Class="Flow.Launcher.Msg"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Background="#ebebeb"
Topmost="True"
SizeToContent="Height"
ResizeMode="NoResize"
WindowStyle="None"
ShowInTaskbar="False"
Title="Msg" Height="60" Width="420">
<Window
x:Class="Flow.Launcher.Msg"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Msg"
Width="420"
Height="60"
Background="#ebebeb"
ResizeMode="NoResize"
ShowInTaskbar="False"
SizeToContent="Height"
Topmost="True"
WindowStyle="None">
<Window.Triggers>
<EventTrigger RoutedEvent="Window.Loaded">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation x:Name="showAnimation" Duration="0:0:0.3" Storyboard.TargetProperty="Top"
AccelerationRatio="0.2" />
<DoubleAnimation
x:Name="showAnimation"
AccelerationRatio="0.2"
Storyboard.TargetProperty="Top"
Duration="0:0:0.3" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>

</Window.Triggers>
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="5">

<Grid
Margin="5"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="32" />
<ColumnDefinition />
<ColumnDefinition Width="2.852" />
<ColumnDefinition Width="13.148"/>
<ColumnDefinition Width="13.148" />
</Grid.ColumnDefinitions>
<Image x:Name="imgIco" Width="32" Height="32" HorizontalAlignment="Left" Margin="0,9" />
<Grid HorizontalAlignment="Stretch" Margin="5 0 0 0" Grid.Column="1" VerticalAlignment="Stretch">
<Image
x:Name="imgIco"
Width="32"
Height="32"
Margin="0 9"
HorizontalAlignment="Left" />
<Grid
Grid.Column="1"
Margin="5 0 0 0"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<TextBlock x:Name="tbTitle" FontSize="16" Foreground="#37392c" FontWeight="Medium">Title</TextBlock>
<TextBlock Grid.Row="1" Foreground="#8e94a4" x:Name="tbSubTitle">sdfdsf</TextBlock>
<TextBlock
x:Name="tbTitle"
FontSize="16"
FontWeight="Medium"
Foreground="#37392c">
Title
</TextBlock>
<TextBlock
x:Name="tbSubTitle"
Grid.Row="1"
Foreground="#8e94a4">
sdfdsf
</TextBlock>
</Grid>
<Image x:Name="imgClose" Grid.Column="2" Cursor="Hand" Width="16" VerticalAlignment="Top"
HorizontalAlignment="Right" Grid.ColumnSpan="2" />
<Image
x:Name="imgClose"
Grid.Column="2"
Grid.ColumnSpan="2"
Width="16"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Cursor="Hand" />
</Grid>
</Window>
84 changes: 84 additions & 0 deletions Flow.Launcher/MsgWithButton.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<Window
x:Class="Flow.Launcher.MsgWithButton"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Msg"
Width="420"
Height="60"
Background="#ebebeb"
ResizeMode="NoResize"
ShowInTaskbar="False"
SizeToContent="Height"
Topmost="True"
WindowStyle="None">
<Window.Triggers>
<EventTrigger RoutedEvent="Window.Loaded">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation
x:Name="showAnimation"
AccelerationRatio="0.2"
Storyboard.TargetProperty="Top"
Duration="0:0:0.3" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Window.Triggers>

<StackPanel Orientation="Vertical">
<Grid
Margin="5"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="32" />
<ColumnDefinition />
<ColumnDefinition Width="2.852" />
<ColumnDefinition Width="13.148" />
</Grid.ColumnDefinitions>
<Image
x:Name="imgIco"
Width="32"
Height="32"
Margin="0 9"
HorizontalAlignment="Left" />
<Grid
Grid.Column="1"
Margin="5 0 0 0"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<TextBlock
x:Name="tbTitle"
FontSize="16"
FontWeight="Medium"
Foreground="#37392c">
Title
</TextBlock>
<TextBlock
x:Name="tbSubTitle"
Grid.Row="1"
Foreground="#8e94a4">
sdfdsf
</TextBlock>
</Grid>
<Image
x:Name="imgClose"
Grid.Column="2"
Grid.ColumnSpan="2"
Width="16"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Cursor="Hand" />
</Grid>
<Button
x:Name="btn"
Margin="5 0 5 5"
HorizontalAlignment="Stretch"
Content="fwafaw"
Foreground="#dcdcdc" />
</StackPanel>
</Window>
Loading
Loading