mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Merge branch 'dev' into rename-file
This commit is contained in:
commit
95fadcbcfa
8 changed files with 77 additions and 33 deletions
|
|
@ -189,31 +189,46 @@ namespace Flow.Launcher
|
|||
var releases = JsonSerializer.Deserialize<List<GitHubReleaseInfo>>(releaseNotesJSON);
|
||||
|
||||
// Get the latest releases
|
||||
var latestReleases = releases.OrderByDescending(release => release.PublishedDate).Take(3);
|
||||
var latestReleases = releases.OrderByDescending(release => release.PublishedDate).Take(3).ToList();
|
||||
|
||||
// Build the release notes in Markdown format
|
||||
var releaseNotesHtmlBuilder = new StringBuilder(string.Empty);
|
||||
foreach (var release in latestReleases)
|
||||
|
||||
for (int i = 0; i < latestReleases.Count; i++)
|
||||
{
|
||||
var release = latestReleases[i];
|
||||
releaseNotesHtmlBuilder.AppendLine("# " + release.Name);
|
||||
|
||||
// Because MdXaml.Html package cannot correctly render images without units,
|
||||
// We need to manually add unit for images
|
||||
// E.g. Replace <img src="..." width="500"> with <img src="..." width="500px">
|
||||
var notes = ImageUnitRegex().Replace(release.ReleaseNotes, m =>
|
||||
{
|
||||
var prefix = m.Groups[1].Value;
|
||||
var widthValue = m.Groups[2].Value;
|
||||
var quote = m.Groups[3].Value;
|
||||
var suffix = m.Groups[4].Value;
|
||||
// Only replace if width is number like 500 without units like 500px
|
||||
if (IsNumber(widthValue))
|
||||
return $"{prefix}{widthValue}px{quote}{suffix}";
|
||||
return m.Value;
|
||||
});
|
||||
{
|
||||
var prefix = m.Groups[1].Value;
|
||||
var widthValue = m.Groups[2].Value;
|
||||
var quote = m.Groups[3].Value;
|
||||
var suffix = m.Groups[4].Value;
|
||||
// Only replace if width is number like 500 without units like 500px
|
||||
if (IsNumber(widthValue))
|
||||
return $"{prefix}{widthValue}px{quote}{suffix}";
|
||||
return m.Value;
|
||||
});
|
||||
|
||||
releaseNotesHtmlBuilder.AppendLine(notes);
|
||||
releaseNotesHtmlBuilder.AppendLine();
|
||||
|
||||
// Add separator if it is not last release note
|
||||
if (i < latestReleases.Count - 1)
|
||||
{
|
||||
releaseNotesHtmlBuilder.Append("<br />");
|
||||
releaseNotesHtmlBuilder.Append("\n\n");
|
||||
|
||||
releaseNotesHtmlBuilder.AppendLine("---");
|
||||
|
||||
releaseNotesHtmlBuilder.Append("\n\n");
|
||||
releaseNotesHtmlBuilder.Append("<br />");
|
||||
releaseNotesHtmlBuilder.Append("\n\n");
|
||||
}
|
||||
}
|
||||
|
||||
return releaseNotesHtmlBuilder.ToString();
|
||||
|
|
|
|||
|
|
@ -38,21 +38,21 @@
|
|||
<Setter Property="Background" Value="Transparent" />
|
||||
</DataTrigger>
|
||||
|
||||
<DataTrigger Binding="{Binding (local:CardGroup.Position), RelativeSource={RelativeSource AncestorType=local:Card}}" Value="First">
|
||||
<DataTrigger Binding="{Binding Type, RelativeSource={RelativeSource AncestorType=local:Card}}" Value="First">
|
||||
<Setter Property="Margin" Value="0" />
|
||||
<Setter Property="CornerRadius" Value="0" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
</DataTrigger>
|
||||
|
||||
<DataTrigger Binding="{Binding (local:CardGroup.Position), RelativeSource={RelativeSource AncestorType=local:Card}}" Value="Middle">
|
||||
<DataTrigger Binding="{Binding Type, RelativeSource={RelativeSource AncestorType=local:Card}}" Value="Middle">
|
||||
<Setter Property="Margin" Value="0" />
|
||||
<Setter Property="CornerRadius" Value="0" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="BorderThickness" Value="0 1 0 0" />
|
||||
</DataTrigger>
|
||||
|
||||
<DataTrigger Binding="{Binding (local:CardGroup.Position), RelativeSource={RelativeSource AncestorType=local:Card}}" Value="Last">
|
||||
<DataTrigger Binding="{Binding Type, RelativeSource={RelativeSource AncestorType=local:Card}}" Value="Last">
|
||||
<Setter Property="Margin" Value="0" />
|
||||
<Setter Property="CornerRadius" Value="0" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
|
|
|
|||
|
|
@ -9,7 +9,10 @@ namespace Flow.Launcher.Resources.Controls
|
|||
{
|
||||
Default,
|
||||
Inside,
|
||||
InsideFit
|
||||
InsideFit,
|
||||
First,
|
||||
Middle,
|
||||
Last
|
||||
}
|
||||
|
||||
public Card()
|
||||
|
|
|
|||
|
|
@ -91,7 +91,10 @@
|
|||
</cc:Card>
|
||||
|
||||
<cc:CardGroup Margin="0 4 0 0">
|
||||
<cc:Card Title="{DynamicResource SearchWindowPosition}" Icon="">
|
||||
<cc:Card
|
||||
Title="{DynamicResource SearchWindowPosition}"
|
||||
Icon=""
|
||||
Type="First">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<ComboBox
|
||||
MinWidth="220"
|
||||
|
|
@ -116,6 +119,7 @@
|
|||
<cc:Card
|
||||
Title="{DynamicResource SearchWindowAlign}"
|
||||
Icon=""
|
||||
Type="Last"
|
||||
Visibility="{ext:CollapsedWhen {Binding Settings.SearchWindowScreen},
|
||||
IsEqualTo={x:Static userSettings:SearchWindowScreens.RememberLastLaunchLocation}}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
|
|
@ -196,7 +200,10 @@
|
|||
</cc:Card>
|
||||
|
||||
<cc:CardGroup Margin="0 14 0 0">
|
||||
<cc:Card Title="{DynamicResource querySearchPrecision}" Sub="{DynamicResource querySearchPrecisionToolTip}">
|
||||
<cc:Card
|
||||
Title="{DynamicResource querySearchPrecision}"
|
||||
Sub="{DynamicResource querySearchPrecisionToolTip}"
|
||||
Type="First">
|
||||
<ComboBox
|
||||
MaxWidth="200"
|
||||
DisplayMemberPath="Display"
|
||||
|
|
@ -205,7 +212,10 @@
|
|||
SelectedValuePath="Value" />
|
||||
</cc:Card>
|
||||
|
||||
<cc:Card Title="{DynamicResource lastQueryMode}" Sub="{DynamicResource lastQueryModeToolTip}">
|
||||
<cc:Card
|
||||
Title="{DynamicResource lastQueryMode}"
|
||||
Sub="{DynamicResource lastQueryModeToolTip}"
|
||||
Type="Last">
|
||||
<ComboBox
|
||||
MinWidth="210"
|
||||
DisplayMemberPath="Display"
|
||||
|
|
@ -375,7 +385,8 @@
|
|||
<cc:Card
|
||||
Title="{DynamicResource KoreanImeRegistry}"
|
||||
Icon=""
|
||||
Sub="{DynamicResource KoreanImeRegistryTooltip}">
|
||||
Sub="{DynamicResource KoreanImeRegistryTooltip}"
|
||||
Type="First">
|
||||
<ui:ToggleSwitch
|
||||
IsOn="{Binding LegacyKoreanIMEEnabled}"
|
||||
OffContent="{DynamicResource disable}"
|
||||
|
|
@ -384,7 +395,8 @@
|
|||
<cc:Card
|
||||
Title="{DynamicResource KoreanImeOpenLink}"
|
||||
Icon=""
|
||||
Sub="{DynamicResource KoreanImeOpenLinkToolTip}">
|
||||
Sub="{DynamicResource KoreanImeOpenLinkToolTip}"
|
||||
Type="Last">
|
||||
<Button Command="{Binding OpenImeSettingsCommand}" Content="{DynamicResource KoreanImeOpenLinkButton}" />
|
||||
</cc:Card>
|
||||
</cc:CardGroup>
|
||||
|
|
|
|||
|
|
@ -51,7 +51,10 @@
|
|||
</cc:Card>
|
||||
|
||||
<cc:CardGroup Margin="0 12 0 0">
|
||||
<cc:Card Title="{DynamicResource openResultModifiers}" Sub="{DynamicResource openResultModifiersToolTip}">
|
||||
<cc:Card
|
||||
Title="{DynamicResource openResultModifiers}"
|
||||
Sub="{DynamicResource openResultModifiersToolTip}"
|
||||
Type="First">
|
||||
<ComboBox
|
||||
Width="120"
|
||||
FontSize="14"
|
||||
|
|
@ -59,7 +62,10 @@
|
|||
SelectedValue="{Binding Settings.OpenResultModifiers}" />
|
||||
</cc:Card>
|
||||
|
||||
<cc:Card Title="{DynamicResource showOpenResultHotkey}" Sub="{DynamicResource showOpenResultHotkeyToolTip}">
|
||||
<cc:Card
|
||||
Title="{DynamicResource showOpenResultHotkey}"
|
||||
Sub="{DynamicResource showOpenResultHotkeyToolTip}"
|
||||
Type="Last">
|
||||
<ui:ToggleSwitch
|
||||
IsOn="{Binding Settings.ShowOpenResultHotkey}"
|
||||
OffContent="{DynamicResource disable}"
|
||||
|
|
|
|||
|
|
@ -32,35 +32,35 @@
|
|||
TextAlignment="left" />
|
||||
|
||||
<cc:CardGroup>
|
||||
<cc:Card Title="{DynamicResource enableProxy}">
|
||||
<cc:Card Title="{DynamicResource enableProxy}" Type="First">
|
||||
<ui:ToggleSwitch
|
||||
IsOn="{Binding Settings.Proxy.Enabled}"
|
||||
OffContent="{DynamicResource disable}"
|
||||
OnContent="{DynamicResource enable}" />
|
||||
</cc:Card>
|
||||
|
||||
<cc:Card Title="{DynamicResource server}">
|
||||
<cc:Card Title="{DynamicResource server}" Type="Middle">
|
||||
<TextBox
|
||||
Width="300"
|
||||
IsEnabled="{Binding Settings.Proxy.Enabled}"
|
||||
Text="{Binding Settings.Proxy.Server}" />
|
||||
</cc:Card>
|
||||
|
||||
<cc:Card Title="{DynamicResource port}">
|
||||
<cc:Card Title="{DynamicResource port}" Type="Middle">
|
||||
<TextBox
|
||||
Width="100"
|
||||
IsEnabled="{Binding Settings.Proxy.Enabled}"
|
||||
Text="{Binding Settings.Proxy.Port, TargetNullValue={x:Static sys:String.Empty}}" />
|
||||
</cc:Card>
|
||||
|
||||
<cc:Card Title="{DynamicResource userName}">
|
||||
<cc:Card Title="{DynamicResource userName}" Type="Middle">
|
||||
<TextBox
|
||||
Width="200"
|
||||
IsEnabled="{Binding Settings.Proxy.Enabled}"
|
||||
Text="{Binding Settings.Proxy.UserName}" />
|
||||
</cc:Card>
|
||||
|
||||
<cc:Card Title="{DynamicResource password}">
|
||||
<cc:Card Title="{DynamicResource password}" Type="Last">
|
||||
<TextBox
|
||||
Width="200"
|
||||
IsEnabled="{Binding Settings.Proxy.Enabled}"
|
||||
|
|
|
|||
|
|
@ -489,7 +489,8 @@
|
|||
Title="{DynamicResource BackdropType}"
|
||||
Margin="0 0 0 0"
|
||||
Icon=""
|
||||
Sub="{Binding BackdropSubText}">
|
||||
Sub="{Binding BackdropSubText}"
|
||||
Type="First">
|
||||
<ComboBox
|
||||
MinWidth="160"
|
||||
VerticalAlignment="Center"
|
||||
|
|
@ -505,7 +506,8 @@
|
|||
<cc:Card
|
||||
Title="{DynamicResource queryWindowShadowEffect}"
|
||||
Margin="0 0 0 0"
|
||||
Icon="">
|
||||
Icon=""
|
||||
Type="Last">
|
||||
<ui:ToggleSwitch
|
||||
IsEnabled="{Binding IsDropShadowEnabled}"
|
||||
IsOn="{Binding DropShadowEffect}"
|
||||
|
|
@ -546,7 +548,10 @@
|
|||
|
||||
<!-- Time and date -->
|
||||
<cc:CardGroup Margin="0 14 0 0">
|
||||
<cc:Card Title="{DynamicResource Clock}" Icon="">
|
||||
<cc:Card
|
||||
Title="{DynamicResource Clock}"
|
||||
Icon=""
|
||||
Type="First">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
|
|
@ -567,7 +572,10 @@
|
|||
</StackPanel>
|
||||
</cc:Card>
|
||||
|
||||
<cc:Card Title="{DynamicResource Date}" Icon="">
|
||||
<cc:Card
|
||||
Title="{DynamicResource Date}"
|
||||
Icon=""
|
||||
Type="Last">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ namespace Flow.Launcher.Plugin.Calculator
|
|||
@"bin2dec|hex2dec|oct2dec|" +
|
||||
@"factorial|sign|isprime|isinfty|" +
|
||||
@"==|~=|&&|\|\||(?:\<|\>)=?|" +
|
||||
@"[ei]|[0-9]|[\+\%\-\*\/\^\., ""]|[\(\)\|\!\[\]]" +
|
||||
@"[ei]|[0-9]|0x[\da-fA-F]+|[\+\%\-\*\/\^\., ""]|[\(\)\|\!\[\]]" +
|
||||
@")+$", RegexOptions.Compiled);
|
||||
private static readonly Regex RegBrackets = new Regex(@"[\(\)\[\]]", RegexOptions.Compiled);
|
||||
private static Engine MagesEngine;
|
||||
|
|
|
|||
Loading…
Reference in a new issue