New theme service that supports window backdrop.

This commit is contained in:
Burak Kaan Köse
2025-10-03 21:04:23 +02:00
parent 15b6f5f6fb
commit 229006c51d
24 changed files with 1337 additions and 18 deletions
@@ -0,0 +1,11 @@
namespace Wino.Core.Domain.Enums;
public enum WindowBackdropType
{
None,
Mica,
MicaAlt,
DesktopAcrylic,
AcrylicBase,
AcrylicThin
}
@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Wino.Core.Domain.Enums;
using Wino.Core.Domain.Models.Personalization;
namespace Wino.Core.Domain.Interfaces;
public interface INewThemeService : IInitializeAsync
{
event EventHandler<ApplicationElementTheme> ElementThemeChanged;
event EventHandler<string> AccentColorChanged;
event EventHandler<WindowBackdropType> BackdropChanged;
Task<List<AppThemeBase>> GetAvailableThemesAsync();
Task<CustomThemeMetadata> CreateNewCustomThemeAsync(string themeName, string accentColor, byte[] wallpaperData);
Task<List<CustomThemeMetadata>> GetCurrentCustomThemesAsync();
List<string> GetAvailableAccountColors();
Task ApplyCustomThemeAsync(bool isInitializing);
// Window Backdrop Management
WindowBackdropType CurrentBackdropType { get; set; }
void ApplyBackdrop(WindowBackdropType backdropType);
// Settings
ApplicationElementTheme RootTheme { get; set; }
Guid? CurrentApplicationThemeId { get; set; }
string AccentColor { get; set; }
string GetSystemAccentColorHex();
bool IsCustomTheme { get; }
// Improved accent color management
Task SetAccentColorAsync(string hexColor, bool preserveTheme = true);
// Backdrop management
List<BackdropTypeWrapper> GetAvailableBackdropTypes();
}
@@ -0,0 +1,20 @@
using Wino.Core.Domain.Enums;
namespace Wino.Core.Domain.Models.Personalization;
public class BackdropTypeWrapper
{
public WindowBackdropType BackdropType { get; set; }
public string DisplayName { get; set; }
public BackdropTypeWrapper(WindowBackdropType backdropType, string displayName)
{
BackdropType = backdropType;
DisplayName = displayName;
}
public override string ToString()
{
return DisplayName;
}
}