mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-08-21 04:29:47 +00:00
* misc: Move Ryujinx project to Ryujinx.Gtk3 This breaks release CI for now but that's fine. Signed-off-by: Mary Guillemard <mary@mary.zone> * misc: Move Ryujinx.Ava project to Ryujinx This breaks CI for now, but it's fine. Signed-off-by: Mary Guillemard <mary@mary.zone> * infra: Make Avalonia the default UI Should fix CI after the previous changes. GTK3 isn't build by the release job anymore, only by PR CI. This also ensure that the test-ava update package is still generated to allow update from the old testing channel. Signed-off-by: Mary Guillemard <mary@mary.zone> * Fix missing copy in create_app_bundle.sh Signed-off-by: Mary Guillemard <mary@mary.zone> * Fix syntax error Signed-off-by: Mary Guillemard <mary@mary.zone> --------- Signed-off-by: Mary Guillemard <mary@mary.zone>
42 lines
1.6 KiB
C#
42 lines
1.6 KiB
C#
using Avalonia.Media;
|
|
using Ryujinx.Ava.UI.Windows;
|
|
using Ryujinx.HLE.UI;
|
|
using System;
|
|
|
|
namespace Ryujinx.Ava.UI.Applet
|
|
{
|
|
class AvaloniaHostUITheme : IHostUITheme
|
|
{
|
|
public AvaloniaHostUITheme(MainWindow parent)
|
|
{
|
|
FontFamily = OperatingSystem.IsWindows() && OperatingSystem.IsWindowsVersionAtLeast(10, 0, 22000) ? "Segoe UI Variable" : parent.FontFamily.Name;
|
|
DefaultBackgroundColor = BrushToThemeColor(parent.Background);
|
|
DefaultForegroundColor = BrushToThemeColor(parent.Foreground);
|
|
DefaultBorderColor = BrushToThemeColor(parent.BorderBrush);
|
|
SelectionBackgroundColor = BrushToThemeColor(parent.ViewControls.SearchBox.SelectionBrush);
|
|
SelectionForegroundColor = BrushToThemeColor(parent.ViewControls.SearchBox.SelectionForegroundBrush);
|
|
}
|
|
|
|
public string FontFamily { get; }
|
|
|
|
public ThemeColor DefaultBackgroundColor { get; }
|
|
public ThemeColor DefaultForegroundColor { get; }
|
|
public ThemeColor DefaultBorderColor { get; }
|
|
public ThemeColor SelectionBackgroundColor { get; }
|
|
public ThemeColor SelectionForegroundColor { get; }
|
|
|
|
private static ThemeColor BrushToThemeColor(IBrush brush)
|
|
{
|
|
if (brush is SolidColorBrush solidColor)
|
|
{
|
|
return new ThemeColor((float)solidColor.Color.A / 255,
|
|
(float)solidColor.Color.R / 255,
|
|
(float)solidColor.Color.G / 255,
|
|
(float)solidColor.Color.B / 255);
|
|
}
|
|
|
|
return new ThemeColor();
|
|
}
|
|
}
|
|
}
|