using System;
namespace Flow.Launcher.Plugin.SharedModels;
///
/// Theme data model
///
public class ThemeData
{
///
/// Theme file name without extension
///
public string FileNameWithoutExtension { get; private init; }
///
/// Theme name
///
public string Name { get; private init; }
///
/// Indicates whether the theme supports dark mode
///
public bool? IsDark { get; private init; }
///
/// Indicates whether the theme supports blur effects
///
public bool? HasBlur { get; private init; }
///
/// Theme data constructor
///
public ThemeData(string fileNameWithoutExtension, string name, bool? isDark = null, bool? hasBlur = null)
{
FileNameWithoutExtension = fileNameWithoutExtension;
Name = name;
IsDark = isDark;
HasBlur = hasBlur;
}
///
public static bool operator ==(ThemeData left, ThemeData right)
{
if (left is null && right is null)
return true;
if (left is null || right is null)
return false;
return left.Equals(right);
}
///
public static bool operator !=(ThemeData left, ThemeData right)
{
return !(left == right);
}
///
public override bool Equals(object obj)
{
if (obj is not ThemeData other)
return false;
return FileNameWithoutExtension == other.FileNameWithoutExtension &&
Name == other.Name;
}
///
public override int GetHashCode()
{
return HashCode.Combine(FileNameWithoutExtension, Name);
}
///
public override string ToString()
{
return Name;
}
}