food-market/src/food-market.pos/Views/Brand.cs
nns d0d6ebcea1 rebrand: касса ALL MARKET (лого, иконка, заголовок, чек)
- Верхняя полоса и экран входа: логотип-изображение ALL MARKET из ресурсов
  (avares Assets/), color на светлой теме и white на тёмной (Brand.ApplyLogo).
- Заголовок окна «ALL MARKET · Касса»; иконка окна и ApplicationIcon = allmarket.ico
  (собрана из фирменных PNG 32/180/192).
- Чек: в шапке — название точки/магазина (резолвится из RetailPoint, PosSession.StoreName),
  внизу мелко «ALL MARKET — система учёта торговли» (был хардкод «Food Market» в шапке).
- AppImage .desktop: Name «ALL MARKET Касса» + фирменная иконка.
- Эталон-макет pos-mockup.html — логотип «all market».
- AssemblyName/exe (foodmarket.Pos) и имена артефактов не менялись (инфраструктура).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 17:35:05 +05:00

43 lines
1.5 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Media.Imaging;
using Avalonia.Platform;
using Avalonia.Styling;
namespace foodmarket.Pos.Views;
/// <summary>Логотип и иконка ALL MARKET из ресурсов (avares). Логотип подбирается
/// под тему: color на светлой, white на тёмной. Файлы готовые — не перерисовывать.</summary>
public static class Brand
{
private const string Pkg = "avares://foodmarket.Pos/Assets/";
private static bool IsDark =>
Application.Current?.ActualThemeVariant == ThemeVariant.Dark;
/// <summary>Загрузить логотип (под текущую тему) в переданный Image.</summary>
public static void ApplyLogo(Image? target)
{
if (target is null) return;
var file = IsDark ? "allmarket-logo-white.png" : "allmarket-logo-color.png";
try
{
using var s = AssetLoader.Open(new Uri(Pkg + file));
target.Source = new Bitmap(s);
}
catch { /* ресурс недоступен — оставить пустым */ }
}
/// <summary>Поставить иконку окна/приложения.</summary>
public static void ApplyWindowIcon(Window window)
{
try
{
using var s = AssetLoader.Open(new Uri(Pkg + "allmarket.ico"));
window.Icon = new WindowIcon(s);
}
catch { /* ресурс недоступен */ }
}
}