Skip to content

Commit dad8f3e

Browse files
authored
Merge branch 'dev' into Theme_Enhancement
2 parents 6566871 + 7a46fac commit dad8f3e

45 files changed

Lines changed: 205 additions & 115 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Flow.Launcher.Core/Resource/Theme.cs

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -673,13 +673,13 @@ private void SetBlurForWindow(string theme, BackdropTypes backdropType)
673673
// If the BackdropType is Mica or MicaAlt, set the windowborderstyle's background to transparent
674674
if (backdropType is BackdropTypes.Mica or BackdropTypes.MicaAlt)
675675
{
676-
windowBorderStyle.Setters.Remove(windowBorderStyle.Setters.OfType<Setter>().FirstOrDefault(x => x.Property.Name == "Background"));
677-
windowBorderStyle.Setters.Add(new Setter(Border.BackgroundProperty, new SolidColorBrush(Color.FromArgb(1, 0, 0, 0))));
676+
windowBorderStyle.Setters.Remove(windowBorderStyle.Setters.OfType<Setter>().FirstOrDefault(x => x.Property == Control.BackgroundProperty));
677+
windowBorderStyle.Setters.Add(new Setter(Border.BackgroundProperty, ThemeHelper.GetFrozenSolidColorBrush(Color.FromArgb(1, 0, 0, 0))));
678678
}
679679
else if (backdropType == BackdropTypes.Acrylic)
680680
{
681-
windowBorderStyle.Setters.Remove(windowBorderStyle.Setters.OfType<Setter>().FirstOrDefault(x => x.Property.Name == "Background"));
682-
windowBorderStyle.Setters.Add(new Setter(Border.BackgroundProperty, new SolidColorBrush(Colors.Transparent)));
681+
windowBorderStyle.Setters.Remove(windowBorderStyle.Setters.OfType<Setter>().FirstOrDefault(x => x.Property == Control.BackgroundProperty));
682+
windowBorderStyle.Setters.Add(new Setter(Border.BackgroundProperty, Brushes.Transparent));
683683
}
684684

685685
// For themes with blur enabled, the window border is rendered by the system, so it's treated as a simple rectangle regardless of thickness.
@@ -798,12 +798,12 @@ private void ApplyPreviewBackground(Color? bgColor = null)
798798
Application.Current.Resources["WindowBorderStyle"] is Style originalStyle)
799799
{
800800
// Copy the original style, including the base style if it exists
801-
CopyStyle(originalStyle, previewStyle);
801+
ThemeHelper.CopyStyle(originalStyle, previewStyle);
802802
}
803803

804804
// Apply background color (remove transparency in color)
805805
var backgroundColor = Color.FromRgb(bgColor.Value.R, bgColor.Value.G, bgColor.Value.B);
806-
previewStyle.Setters.Add(new Setter(Border.BackgroundProperty, new SolidColorBrush(backgroundColor)));
806+
previewStyle.Setters.Add(new Setter(Border.BackgroundProperty, ThemeHelper.GetFrozenSolidColorBrush(backgroundColor)));
807807

808808
// The blur theme keeps the corner round fixed (applying DWM code to modify it causes rendering issues).
809809
// The non-blur theme retains the previously set WindowBorderStyle.
@@ -817,21 +817,6 @@ private void ApplyPreviewBackground(Color? bgColor = null)
817817
Application.Current.Resources["PreviewWindowBorderStyle"] = previewStyle;
818818
}
819819

820-
private void CopyStyle(Style originalStyle, Style targetStyle)
821-
{
822-
// If the style is based on another style, copy the base style first
823-
if (originalStyle.BasedOn != null)
824-
{
825-
CopyStyle(originalStyle.BasedOn, targetStyle);
826-
}
827-
828-
// Copy the setters from the original style
829-
foreach (var setter in originalStyle.Setters.OfType<Setter>())
830-
{
831-
targetStyle.Setters.Add(new Setter(setter.Property, setter.Value));
832-
}
833-
}
834-
835820
private void ColorizeWindow(string theme, BackdropTypes backdropType)
836821
{
837822
var dict = GetThemeResourceDictionary(theme);
@@ -922,11 +907,11 @@ private void ColorizeWindow(string theme, BackdropTypes backdropType)
922907
// Only set the background to transparent if the theme supports blur
923908
if (backdropType is BackdropTypes.Mica or BackdropTypes.MicaAlt)
924909
{
925-
mainWindow.Background = new SolidColorBrush(Color.FromArgb(1, 0, 0, 0));
910+
mainWindow.Background = ThemeHelper.GetFrozenSolidColorBrush(Color.FromArgb(1, 0, 0, 0));
926911
}
927912
else
928913
{
929-
mainWindow.Background = new SolidColorBrush(selectedBG);
914+
mainWindow.Background = ThemeHelper.GetFrozenSolidColorBrush(selectedBG);
930915
}
931916
}
932917
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using System.Linq;
2+
using System.Windows;
3+
using System.Windows.Media;
4+
5+
namespace Flow.Launcher.Core.Resource;
6+
7+
public static class ThemeHelper
8+
{
9+
public static void CopyStyle(Style originalStyle, Style targetStyle)
10+
{
11+
// If the style is based on another style, copy the base style first
12+
if (originalStyle.BasedOn != null)
13+
{
14+
CopyStyle(originalStyle.BasedOn, targetStyle);
15+
}
16+
17+
// Copy the setters from the original style
18+
foreach (var setter in originalStyle.Setters.OfType<Setter>())
19+
{
20+
targetStyle.Setters.Add(new Setter(setter.Property, setter.Value));
21+
}
22+
}
23+
24+
public static SolidColorBrush GetFrozenSolidColorBrush(Color color)
25+
{
26+
var brush = new SolidColorBrush(color);
27+
brush.Freeze();
28+
return brush;
29+
}
30+
}

Flow.Launcher/Languages/ar.xaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,9 @@
237237
<system:String x:Key="fileNotFoundMessage">Unable to find plugin.json from the extracted zip file, or this path {0} does not exist</system:String>
238238
<system:String x:Key="pluginExistAlreadyMessage">A plugin with the same ID and version already exists, or the version is greater than this downloaded plugin</system:String>
239239
<system:String x:Key="errorCreatingSettingPanel">Error creating setting panel for plugin {0}:{1}{2}</system:String>
240+
<system:String x:Key="pluginMinimumAppVersionUnsatisfiedTitle">{0} requires Flow version {1} to run</system:String>
241+
<system:String x:Key="pluginMinimumAppVersionUnsatisfiedMessage">Flow does not meet the minimum version requirements for {0} to run. Do you want to continue installing it?{1}{1}We recommend updating Flow to the latest version to ensure that {0} works without issues.</system:String>
242+
<system:String x:Key="pluginJsonInvalidOrCorrupted">Failed to install plugin because plugin.json is invalid or corrupted</system:String>
240243

241244
<!-- Setting Plugin Store -->
242245
<system:String x:Key="pluginStore">متجر الإضافات</system:String>

Flow.Launcher/Languages/cs.xaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,9 @@
237237
<system:String x:Key="fileNotFoundMessage">Unable to find plugin.json from the extracted zip file, or this path {0} does not exist</system:String>
238238
<system:String x:Key="pluginExistAlreadyMessage">A plugin with the same ID and version already exists, or the version is greater than this downloaded plugin</system:String>
239239
<system:String x:Key="errorCreatingSettingPanel">Error creating setting panel for plugin {0}:{1}{2}</system:String>
240+
<system:String x:Key="pluginMinimumAppVersionUnsatisfiedTitle">{0} requires Flow version {1} to run</system:String>
241+
<system:String x:Key="pluginMinimumAppVersionUnsatisfiedMessage">Flow does not meet the minimum version requirements for {0} to run. Do you want to continue installing it?{1}{1}We recommend updating Flow to the latest version to ensure that {0} works without issues.</system:String>
242+
<system:String x:Key="pluginJsonInvalidOrCorrupted">Failed to install plugin because plugin.json is invalid or corrupted</system:String>
240243

241244
<!-- Setting Plugin Store -->
242245
<system:String x:Key="pluginStore">Obchod s pluginy</system:String>

Flow.Launcher/Languages/da.xaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,9 @@
237237
<system:String x:Key="fileNotFoundMessage">Unable to find plugin.json from the extracted zip file, or this path {0} does not exist</system:String>
238238
<system:String x:Key="pluginExistAlreadyMessage">A plugin with the same ID and version already exists, or the version is greater than this downloaded plugin</system:String>
239239
<system:String x:Key="errorCreatingSettingPanel">Error creating setting panel for plugin {0}:{1}{2}</system:String>
240+
<system:String x:Key="pluginMinimumAppVersionUnsatisfiedTitle">{0} requires Flow version {1} to run</system:String>
241+
<system:String x:Key="pluginMinimumAppVersionUnsatisfiedMessage">Flow does not meet the minimum version requirements for {0} to run. Do you want to continue installing it?{1}{1}We recommend updating Flow to the latest version to ensure that {0} works without issues.</system:String>
242+
<system:String x:Key="pluginJsonInvalidOrCorrupted">Failed to install plugin because plugin.json is invalid or corrupted</system:String>
240243

241244
<!-- Setting Plugin Store -->
242245
<system:String x:Key="pluginStore">Plugin-butik</system:String>

Flow.Launcher/Languages/de.xaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,9 @@
237237
<system:String x:Key="fileNotFoundMessage">Unable to find plugin.json from the extracted zip file, or this path {0} does not exist</system:String>
238238
<system:String x:Key="pluginExistAlreadyMessage">A plugin with the same ID and version already exists, or the version is greater than this downloaded plugin</system:String>
239239
<system:String x:Key="errorCreatingSettingPanel">Error creating setting panel for plugin {0}:{1}{2}</system:String>
240+
<system:String x:Key="pluginMinimumAppVersionUnsatisfiedTitle">{0} requires Flow version {1} to run</system:String>
241+
<system:String x:Key="pluginMinimumAppVersionUnsatisfiedMessage">Flow does not meet the minimum version requirements for {0} to run. Do you want to continue installing it?{1}{1}We recommend updating Flow to the latest version to ensure that {0} works without issues.</system:String>
242+
<system:String x:Key="pluginJsonInvalidOrCorrupted">Failed to install plugin because plugin.json is invalid or corrupted</system:String>
240243

241244
<!-- Setting Plugin Store -->
242245
<system:String x:Key="pluginStore">Plug-in-Store</system:String>

Flow.Launcher/Languages/es-419.xaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,9 @@
237237
<system:String x:Key="fileNotFoundMessage">Unable to find plugin.json from the extracted zip file, or this path {0} does not exist</system:String>
238238
<system:String x:Key="pluginExistAlreadyMessage">A plugin with the same ID and version already exists, or the version is greater than this downloaded plugin</system:String>
239239
<system:String x:Key="errorCreatingSettingPanel">Error creating setting panel for plugin {0}:{1}{2}</system:String>
240+
<system:String x:Key="pluginMinimumAppVersionUnsatisfiedTitle">{0} requires Flow version {1} to run</system:String>
241+
<system:String x:Key="pluginMinimumAppVersionUnsatisfiedMessage">Flow does not meet the minimum version requirements for {0} to run. Do you want to continue installing it?{1}{1}We recommend updating Flow to the latest version to ensure that {0} works without issues.</system:String>
242+
<system:String x:Key="pluginJsonInvalidOrCorrupted">Failed to install plugin because plugin.json is invalid or corrupted</system:String>
240243

241244
<!-- Setting Plugin Store -->
242245
<system:String x:Key="pluginStore">Tienda de Plugins</system:String>

Flow.Launcher/Languages/es.xaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@
7979
<system:String x:Key="useLogonTaskForStartupTooltip">Después de la desinstalación, es necesario eliminar manualmente la tarea (Flow.Launcher Startup) mediante el Programador de Tareas</system:String>
8080
<system:String x:Key="setAutoStartFailed">Error de configuración de arranque al iniciar</system:String>
8181
<system:String x:Key="hideFlowLauncherWhenLoseFocus">Ocultar Flow Launcher cuando se pierde el foco</system:String>
82-
<system:String x:Key="showTaskbarWhenOpened">Show taskbar when Flow Launcher is opened</system:String>
83-
<system:String x:Key="showTaskbarWhenOpenedToolTip">Temporarily show the taskbar when Flow Launcher is opened, useful for auto-hidden taskbars.</system:String>
82+
<system:String x:Key="showTaskbarWhenOpened">Mostrar la barra de tareas cuando Flow Launcher está abierto</system:String>
83+
<system:String x:Key="showTaskbarWhenOpenedToolTip">Muestra temporalmente la barra de tareas cuando Flow Launcher está abierto, útil para barras de tareas que se ocultan automáticamente.</system:String>
8484
<system:String x:Key="dontPromptUpdateMsg">No mostrar notificaciones de nuevas versiones</system:String>
8585
<system:String x:Key="SearchWindowPosition">Ubicación de la ventana de búsqueda</system:String>
8686
<system:String x:Key="SearchWindowScreenRememberLastLaunchLocation">Recordar última ubicación</system:String>
@@ -237,6 +237,9 @@
237237
<system:String x:Key="fileNotFoundMessage">No se puede encontrar plugin.json en el archivo zip extraído, o esta ruta {0} no existe</system:String>
238238
<system:String x:Key="pluginExistAlreadyMessage">Ya existe un complemento con el mismo ID y versión, o la versión es superior a la de este complemento descargado</system:String>
239239
<system:String x:Key="errorCreatingSettingPanel">Error al crear el panel de configuración para el complemento {0}:{1}{2}</system:String>
240+
<system:String x:Key="pluginMinimumAppVersionUnsatisfiedTitle">{0} requiere la versión {1} de Flow para ejecutarse</system:String>
241+
<system:String x:Key="pluginMinimumAppVersionUnsatisfiedMessage">Flow no cumple los requisitos mínimos de versión para ejecutar {0}. ¿Desea continuar con la instalación?{1}{1}Recomendamos actualizar Flow a la última versión para garantizar que {0} funcione sin problemas.</system:String>
242+
<system:String x:Key="pluginJsonInvalidOrCorrupted">No se pudo instalar el plugin porque plugin.json no es válido o está dañado</system:String>
240243

241244
<!-- Setting Plugin Store -->
242245
<system:String x:Key="pluginStore">Tienda complementos</system:String>

Flow.Launcher/Languages/fr.xaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,9 @@
237237
<system:String x:Key="fileNotFoundMessage">Impossible de trouver le fichier plugin.json dans le fichier zip extrait, ou ce chemin {0} n'existe pas</system:String>
238238
<system:String x:Key="pluginExistAlreadyMessage">Un plugin avec le même ID et la même version existe déjà, ou la version est supérieure à ce plugin téléchargé</system:String>
239239
<system:String x:Key="errorCreatingSettingPanel">Erreur lors de la création du panneau de configuration pour le plugin {0}:{1}{2}</system:String>
240+
<system:String x:Key="pluginMinimumAppVersionUnsatisfiedTitle">{0} nécessite la version {1} de Flow pour fonctionner</system:String>
241+
<system:String x:Key="pluginMinimumAppVersionUnsatisfiedMessage">Flow ne répond pas aux exigences de version minimale pour que {0} puisse fonctionner. Voulez-vous continuer l'installation ?{1}{1}Nous vous recommandons de mettre à jour Flow vers la dernière version pour vous assurer que {0} fonctionne sans problème.</system:String>
242+
<system:String x:Key="pluginJsonInvalidOrCorrupted">Impossible d'installer le plugin car plugin.json est invalide ou corrompu</system:String>
240243

241244
<!-- Setting Plugin Store -->
242245
<system:String x:Key="pluginStore">Magasin des Plugins</system:String>

Flow.Launcher/Languages/he.xaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,9 @@
236236
<system:String x:Key="fileNotFoundMessage">Unable to find plugin.json from the extracted zip file, or this path {0} does not exist</system:String>
237237
<system:String x:Key="pluginExistAlreadyMessage">A plugin with the same ID and version already exists, or the version is greater than this downloaded plugin</system:String>
238238
<system:String x:Key="errorCreatingSettingPanel">Error creating setting panel for plugin {0}:{1}{2}</system:String>
239+
<system:String x:Key="pluginMinimumAppVersionUnsatisfiedTitle">{0} requires Flow version {1} to run</system:String>
240+
<system:String x:Key="pluginMinimumAppVersionUnsatisfiedMessage">Flow does not meet the minimum version requirements for {0} to run. Do you want to continue installing it?{1}{1}We recommend updating Flow to the latest version to ensure that {0} works without issues.</system:String>
241+
<system:String x:Key="pluginJsonInvalidOrCorrupted">Failed to install plugin because plugin.json is invalid or corrupted</system:String>
239242

240243
<!-- Setting Plugin Store -->
241244
<system:String x:Key="pluginStore">חנות תוספים</system:String>

0 commit comments

Comments
 (0)