Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
a9476b1
Adjust Plugin List template
onesounds Oct 7, 2021
04aea73
- Fix ProgressBar (Finally!)
onesounds Oct 7, 2021
3bc09ef
Merge branch 'ModernTheme' of https://github.com/onesounds/Flow.Launc…
onesounds Oct 8, 2021
a4d929b
Merge branch 'ModernTheme' of https://github.com/onesounds/Flow.Launc…
onesounds Oct 8, 2021
165cbb7
Adjust Plugin List template
onesounds Oct 7, 2021
1a43f59
Adjust Plugin page (move expander button to right position)
onesounds Oct 8, 2021
2ca3c6f
- win 10 Mouse over Blue Fix
onesounds Oct 8, 2021
71c7ad5
Setting Window (WIP) before adjust expander control (for fix unknown …
onesounds Oct 8, 2021
096d142
- Add expander style to resource dictionary
onesounds Oct 9, 2021
4bed121
- Merge Local
onesounds Oct 9, 2021
592ea8c
Use Binding From item
taooceros Oct 9, 2021
254a906
- Change Prriority text to button
onesounds Oct 9, 2021
bec7d62
- Remove Expander Button's Circle and adjust arrow size
onesounds Oct 9, 2021
762df7f
- Remove colon Action keyword String
onesounds Oct 9, 2021
4a4f0bb
- Add plugin page title
onesounds Oct 9, 2021
0d11b79
- Adjust Shell, Calc, WebSearch Setting Margin
onesounds Oct 9, 2021
2dc8bb3
- Add Automatically Hide Plugin Info Border by SettingControl Height
onesounds Oct 9, 2021
234816d
- Add Automatically Hide Plugin Info Border by SettingControl Height
onesounds Oct 9, 2021
5ff1e73
- Adjust Content Control Margin
onesounds Oct 9, 2021
e6c4ca1
- Adjust Content Control Margin
onesounds Oct 9, 2021
e48761a
- Adjust Content Control Margin
onesounds Oct 9, 2021
2d98dcb
- Add Author name in plugin list
onesounds Oct 9, 2021
579f8c8
- Add Author name in plugin list
onesounds Oct 9, 2021
c5f1b28
Add plugin list last item bottom margin
onesounds Oct 9, 2021
d87d95e
Add plugin list last item bottom margin
onesounds Oct 9, 2021
1ca3c6e
remove commment
onesounds Oct 9, 2021
8174d54
Fix PriorityClick Logic
taooceros Oct 9, 2021
e5d3424
Merge branch 'PluginStore' of github.com:onesounds/Flow.Launcher into…
taooceros Oct 9, 2021
1e479ed
- Add plugin store tab (WIP)
onesounds Oct 10, 2021
876d477
- Add install button with hover
onesounds Oct 10, 2021
4164b46
Add author and version in hover menu.
onesounds Oct 10, 2021
ccb565e
Responsive Width in Plugin Store List (WIP
onesounds Oct 10, 2021
3d06404
Move PluginsManifest to Flow.Launcher.Core & Change PluginStore Bindi…
taooceros Oct 10, 2021
c4f9dcb
Merge Dev (Conflict PluginsManifest Move)
taooceros Oct 10, 2021
0fc1d15
Add Responsive Width to TabHeader
onesounds Oct 10, 2021
dc6babe
Adjust the alignment of the right margin of the entire page.
onesounds Oct 10, 2021
4aae101
Merge Binding
onesounds Oct 10, 2021
757d995
- Fix Default Font size (Tab control was the cause.)
onesounds Oct 10, 2021
240dd92
- Fix Default Font size (Tab control was the cause.)
onesounds Oct 10, 2021
736de20
Merge branch 'PluginStore' of https://github.com/onesounds/Flow.Launc…
onesounds Oct 11, 2021
c1b4f32
add website link in plugin information area
onesounds Oct 11, 2021
d47cb78
add website link in plugin information area
onesounds Oct 11, 2021
ec2db30
Merge branch 'PluginStore' of https://github.com/onesounds/Flow.Launc…
onesounds Oct 11, 2021
5d67019
Add delay
onesounds Oct 12, 2021
abf91dc
add Opacity value
onesounds Oct 12, 2021
7369625
add Opacity value
onesounds Oct 12, 2021
6d20db4
Merge branch 'FixEmptyQuery' of https://github.com/onesounds/Flow.Lau…
onesounds Oct 13, 2021
4a37900
On Load Animation (WIP)
onesounds Oct 13, 2021
ad186a3
On Load Animation (WIP)
onesounds Oct 13, 2021
5102846
Merge branch 'FixEmptyQuery' of https://github.com/onesounds/Flow.Lau…
onesounds Oct 13, 2021
60064ea
Merge branch 'FixEmptyQuery' of https://github.com/onesounds/Flow.Lau…
onesounds Oct 13, 2021
c3353b3
Merge branch 'FixEmptyQuery' of https://github.com/onesounds/Flow.Lau…
onesounds Oct 13, 2021
b96cac4
Merge branch 'FixEmptyQuery' of https://github.com/onesounds/Flow.Lau…
onesounds Oct 13, 2021
c6e2dc8
Merge branch 'FixEmptyQuery' of https://github.com/onesounds/Flow.Lau…
onesounds Oct 13, 2021
8326ba9
- change visibility call structure (like powertoy)
onesounds Oct 14, 2021
f77d450
- change visibility call structure (like powertoy)
onesounds Oct 14, 2021
2cc3a79
Merge
onesounds Oct 14, 2021
c0a94e5
Merge
onesounds Oct 14, 2021
5aa86f3
merge
onesounds Oct 14, 2021
a7ed678
- Remove duplicate method.
onesounds Oct 14, 2021
e225c2b
- Remove duplicate method.
onesounds Oct 14, 2021
364845a
Merge branch 'FixEmptyQuery' of https://github.com/onesounds/Flow.Lau…
onesounds Oct 14, 2021
08f50ea
- Add Website hyperlink to author
onesounds Oct 15, 2021
80a76b0
- Add Refresh Button (it need function binding)
onesounds Oct 15, 2021
47749df
change string "plugin" to "plugins" in tab menu
onesounds Oct 15, 2021
e784ea6
- Change store Item to toggle mode. when it one more click, it desele…
onesounds Oct 16, 2021
1ce3150
Merge remote-tracking branch 'upstream/dev' into PluginStore
taooceros Oct 17, 2021
52b3579
Implement Install & Refresh Button
taooceros Oct 17, 2021
229c664
Add style for toggle button
onesounds Oct 17, 2021
ada53ed
Merge branch 'FixEmptyQuery' into ContextStyle
onesounds Oct 18, 2021
dd15cf4
- Change Contextmenustrip to contextmenu
onesounds Oct 19, 2021
fd06081
- Fix UpdateNotifyIconText for changing language
onesounds Oct 19, 2021
e5e729a
Remove Comment
onesounds Oct 19, 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
57 changes: 57 additions & 0 deletions Flow.Launcher.Core/ExternalPlugins/PluginsManifest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
using Flow.Launcher.Infrastructure.Http;
using Flow.Launcher.Infrastructure.Logger;
using System;
using System.Collections.Generic;
using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;

namespace Flow.Launcher.Core.ExternalPlugins
{
public static class PluginsManifest
{
static PluginsManifest()
{
UpdateTask = UpdateManifestAsync();
}

public static List<UserPlugin> UserPlugins { get; private set; } = new List<UserPlugin>();

public static Task UpdateTask { get; private set; }

private static readonly SemaphoreSlim manifestUpdateLock = new(1);

public static Task UpdateManifestAsync()
{
if (manifestUpdateLock.CurrentCount == 0)
{
return UpdateTask;
}

return UpdateTask = DownloadManifestAsync();
}

private async static Task DownloadManifestAsync()
{
try
{
await manifestUpdateLock.WaitAsync().ConfigureAwait(false);

await using var jsonStream = await Http.GetStreamAsync("https://raw.githubusercontent.com/Flow-Launcher/Flow.Launcher.PluginsManifest/plugin_api_v2/plugins.json")
.ConfigureAwait(false);

UserPlugins = await JsonSerializer.DeserializeAsync<List<UserPlugin>>(jsonStream).ConfigureAwait(false);
}
catch (Exception e)
{
Log.Exception("|PluginManagement.GetManifest|Encountered error trying to download plugins manifest", e);

UserPlugins = new List<UserPlugin>();
}
finally
{
manifestUpdateLock.Release();
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

namespace Flow.Launcher.Plugin.PluginsManager.Models
namespace Flow.Launcher.Core.ExternalPlugins
{
public class UserPlugin
public record UserPlugin
{
public string ID { get; set; }
public string Name { get; set; }
Expand All @@ -12,5 +11,6 @@ public class UserPlugin
public string Website { get; set; }
public string UrlDownload { get; set; }
public string UrlSourceCode { get; set; }
public string IcoPath { get; set; }
}
}
5 changes: 5 additions & 0 deletions Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ public interface IPublicAPI
/// <param name="subTitle">Optional message subtitle</param>
void ShowMsgError(string title, string subTitle = "");

/// <summary>
/// Show the MainWindow when hiding
/// </summary>
void ShowMainWindow();

/// <summary>
/// Show message box
/// </summary>
Expand Down
221 changes: 221 additions & 0 deletions Flow.Launcher/App.xaml

Large diffs are not rendered by default.

44 changes: 4 additions & 40 deletions Flow.Launcher/Helper/HotKeyMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
using Flow.Launcher.Core.Resource;
using System.Windows;
using Flow.Launcher.ViewModel;
using System.Threading.Tasks;
using System.Threading;

namespace Flow.Launcher.Helper
{
Expand All @@ -19,7 +21,7 @@ internal static void Initialize(MainViewModel mainVM)
mainViewModel = mainVM;
settings = mainViewModel._settings;

SetHotkey(settings.Hotkey, OnHotkey);
SetHotkey(settings.Hotkey, mainViewModel.OnHotkey);
LoadCustomPluginHotkey();
}

Expand Down Expand Up @@ -53,44 +55,6 @@ internal static void RemoveHotkey(string hotkeyStr)
}
}

internal static void OnHotkey(object sender, HotkeyEventArgs e)
{
if (!ShouldIgnoreHotkeys())
{
UpdateLastQUeryMode();

mainViewModel.ToggleFlowLauncher();
e.Handled = true;
}
}

/// <summary>
/// Checks if Flow Launcher should ignore any hotkeys
/// </summary>
private static bool ShouldIgnoreHotkeys()
{
return settings.IgnoreHotkeysOnFullscreen && WindowsInteropHelper.IsWindowFullscreen();
}

private static void UpdateLastQUeryMode()
{
switch(settings.LastQueryMode)
{
case LastQueryMode.Empty:
mainViewModel.ChangeQueryText(string.Empty);
break;
case LastQueryMode.Preserved:
mainViewModel.LastQuerySelected = true;
break;
case LastQueryMode.Selected:
mainViewModel.LastQuerySelected = false;
break;
default:
throw new ArgumentException($"wrong LastQueryMode: <{settings.LastQueryMode}>");

}
}

internal static void LoadCustomPluginHotkey()
{
if (settings.CustomPluginHotkeys == null)
Expand All @@ -106,7 +70,7 @@ internal static void SetCustomQueryHotkey(CustomPluginHotkey hotkey)
{
SetHotkey(hotkey.Hotkey, (s, e) =>
{
if (ShouldIgnoreHotkeys())
if (mainViewModel.ShouldIgnoreHotkeys())
return;

mainViewModel.MainWindowVisibility = Visibility.Visible;
Expand Down
12 changes: 6 additions & 6 deletions Flow.Launcher/Languages/en.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,18 @@
<system:String x:Key="shadowEffectNotAllowed">Shadow effect is not allowed while current theme has blur effect enabled</system:String>

<!--Setting Plugin-->
<system:String x:Key="plugin">Plugin</system:String>
<system:String x:Key="plugin">Plugins</system:String>
<system:String x:Key="browserMorePlugins">Find more plugins</system:String>
<system:String x:Key="enable">Enable</system:String>
<system:String x:Key="disable">Disable</system:String>
<system:String x:Key="actionKeywords">Action keyword:</system:String>
<system:String x:Key="enable">On</system:String>
<system:String x:Key="disable">Off</system:String>
<system:String x:Key="actionKeywords">Action keyword</system:String>
<system:String x:Key="currentActionKeywords">Current action keyword:</system:String>
<system:String x:Key="newActionKeyword">New action keyword:</system:String>
<system:String x:Key="currentPriority">Current Priority:</system:String>
<system:String x:Key="newPriority">New Priority:</system:String>
<system:String x:Key="priority">Priority:</system:String>
<system:String x:Key="priority">Priority</system:String>
<system:String x:Key="pluginDirectory">Plugin Directory</system:String>
<system:String x:Key="author">Author</system:String>
<system:String x:Key="author">Author:</system:String>
<system:String x:Key="plugin_init_time">Init time:</system:String>
<system:String x:Key="plugin_query_time">Query time:</system:String>

Expand Down
62 changes: 37 additions & 25 deletions Flow.Launcher/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ public partial class MainWindow
private bool isProgressBarStoryboardPaused;
private Settings _settings;
private NotifyIcon _notifyIcon;
private ContextMenu contextMenu;
private MainViewModel _viewModel;


#endregion

Expand Down Expand Up @@ -159,14 +161,19 @@ private void InitializePosition()

private void UpdateNotifyIconText()
{
var menu = _notifyIcon.ContextMenuStrip;
var open = menu.Items[0];
var setting = menu.Items[1];
var exit = menu.Items[2];

open.Text = InternationalizationManager.Instance.GetTranslation("iconTrayOpen");
setting.Text = InternationalizationManager.Instance.GetTranslation("iconTraySettings");
exit.Text = InternationalizationManager.Instance.GetTranslation("iconTrayExit");
var menu = contextMenu;

var header = new MenuItem() { Header = "Flow Launcher", IsEnabled = false };
var open = new MenuItem() { Header = InternationalizationManager.Instance.GetTranslation("iconTrayOpen") };
var settings = new MenuItem() { Header = InternationalizationManager.Instance.GetTranslation("iconTraySettings") };
var exit = new MenuItem() { Header = InternationalizationManager.Instance.GetTranslation("iconTrayExit") };
menu.Items[0] = header;
menu.Items[1] = open;
menu.Items[2] = settings;
menu.Items[3] = exit;
open.Click += (o, e) => Visibility = Visibility.Visible;
settings.Click += (o, e) => App.API.OpenSettingDialog();
exit.Click += (o, e) => Close();
}

private void InitializeNotifyIcon()
Expand All @@ -178,33 +185,38 @@ private void InitializeNotifyIcon()
Visible = !_settings.HideNotifyIcon
};
var menu = new ContextMenuStrip();
var items = menu.Items;
contextMenu = new ContextMenu();

MenuItem header = new MenuItem() { Header = "Flow Launcher", IsEnabled = false };
MenuItem open = new MenuItem() { Header = InternationalizationManager.Instance.GetTranslation("iconTrayOpen") };
MenuItem settings = new MenuItem() { Header = InternationalizationManager.Instance.GetTranslation("iconTraySettings") };
MenuItem exit = new MenuItem() { Header = InternationalizationManager.Instance.GetTranslation("iconTrayExit") };

var open = items.Add(InternationalizationManager.Instance.GetTranslation("iconTrayOpen"));
open.Click += (o, e) => Visibility = Visibility.Visible;
var setting = items.Add(InternationalizationManager.Instance.GetTranslation("iconTraySettings"));
setting.Click += (o, e) => App.API.OpenSettingDialog();
var exit = items.Add(InternationalizationManager.Instance.GetTranslation("iconTrayExit"));
settings.Click += (o, e) => App.API.OpenSettingDialog();
exit.Click += (o, e) => Close();
contextMenu.Items.Add(header);
contextMenu.Items.Add(open);
contextMenu.Items.Add(settings);
contextMenu.Items.Add(exit);

_notifyIcon.ContextMenuStrip = menu;
_notifyIcon.ContextMenuStrip = menu; /*it need for close the context menu. if not, context menu can't close. */
_notifyIcon.MouseClick += (o, e) =>
{
if (e.Button == MouseButtons.Left)
switch (e.Button)
{
if (menu.Visible)
{
menu.Close();
}
else
{
var p = System.Windows.Forms.Cursor.Position;
menu.Show(p);
}
case MouseButtons.Left:
_viewModel.ToggleFlowLauncher();
break;

case MouseButtons.Right:
contextMenu.IsOpen = true;
break;
}
};
}


private void InitProgressbarAnimation()
{
var da = new DoubleAnimation(ProgressBar.X2, ActualWidth + 150,
Expand Down Expand Up @@ -262,7 +274,7 @@ private void OnDeactivated(object sender, EventArgs e)
{
if (_settings.HideWhenDeactive)
{
Hide();
_viewModel.Hide();
}
}

Expand Down
2 changes: 2 additions & 0 deletions Flow.Launcher/PublicAPIInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ public void RestartApp()

public void RestarApp() => RestartApp();

public void ShowMainWindow() => _mainVM.MainWindowVisibility = Visibility.Visible;

public void CheckForNewUpdate() => _settingsVM.UpdateApp();

public void SaveAppAllSettings()
Expand Down
Loading