-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3c3ba69
commit 1207864
Showing
21 changed files
with
704 additions
and
406 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// BooleanToClassConverter.cs | ||
using Avalonia.Data.Converters; | ||
using System; | ||
using System.Globalization; | ||
|
||
namespace ChatAAC.Converters | ||
{ | ||
public class BooleanToClassConverter : IValueConverter | ||
{ | ||
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture) | ||
{ | ||
return value != null ? "symbol action" : "symbol"; | ||
} | ||
|
||
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using System.Globalization; | ||
using System.Linq; | ||
using Avalonia.Data.Converters; | ||
using Avalonia.Media; | ||
|
||
namespace ChatAAC.Converters; | ||
|
||
public class ColorConverter : IValueConverter | ||
{ | ||
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture) | ||
{ | ||
if (value is not string colorString) return Colors.Transparent; | ||
var rgb = colorString.Split(['(', ',', ')'], StringSplitOptions.RemoveEmptyEntries) | ||
.Skip(1) // Skip "rgb" | ||
.Select(int.Parse).ToList(); | ||
return Color.FromArgb(255, (byte)rgb[0], (byte)rgb[1], (byte)rgb[2]); | ||
} | ||
|
||
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
using Avalonia; | ||
using Avalonia.Controls; | ||
using System; | ||
|
||
namespace ChatAAC.Helpers | ||
{ | ||
public static class ButtonStyleHelper | ||
{ | ||
public static readonly AttachedProperty<object> ActionProperty = | ||
AvaloniaProperty.RegisterAttached<Button, object>("LoadBoard", typeof(ButtonStyleHelper)); | ||
|
||
public static object GetAction(Button button) | ||
{ | ||
return button.GetValue(ActionProperty); | ||
} | ||
|
||
public static void SetAction(Button button, object? value) | ||
{ | ||
button.SetValue(ActionProperty!, value); | ||
UpdateButtonClasses(button, value); | ||
} | ||
|
||
private static void UpdateButtonClasses(Button button, object? actionValue) | ||
{ | ||
if (actionValue is not null) | ||
{ | ||
button.Classes.Add("action"); | ||
} | ||
else | ||
{ | ||
button.Classes.Remove("action"); | ||
} | ||
|
||
if (!button.Classes.Contains("symbol")) | ||
{ | ||
button.Classes.Add("symbol"); | ||
} | ||
} | ||
|
||
static ButtonStyleHelper() | ||
{ | ||
ActionProperty.Changed.Subscribe(new AnonymousObserver<AvaloniaPropertyChangedEventArgs<object>>( | ||
e => | ||
{ | ||
if (e.Sender is Button button) | ||
{ | ||
UpdateButtonClasses(button, e.NewValue.Value); | ||
} | ||
})); | ||
} | ||
} | ||
|
||
internal class AnonymousObserver<T>(Action<T> onNext) : IObserver<T> | ||
{ | ||
public void OnCompleted() { } | ||
public void OnError(Exception error) { } | ||
public void OnNext(T value) => onNext(value); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace ChatAAC.Models.Obf; | ||
|
||
public class ExtCoughDropSettings | ||
{ | ||
[JsonPropertyName("private")] | ||
public bool Private { get; set; } | ||
|
||
[JsonPropertyName("key")] public string Key { get; set; } = string.Empty; | ||
|
||
[JsonPropertyName("word_suggestions")] | ||
public bool WordSuggestions { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,26 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace ChatAAC.Models.Obf; | ||
|
||
// Class for Image | ||
public class Image | ||
{ | ||
[JsonPropertyName("id")] public string Id { get; set; } = string.Empty; | ||
|
||
[JsonPropertyName("url")] public string Url { get; set; } = string.Empty; | ||
|
||
[JsonPropertyName("data_url")] public string DataUrl { get; set; } = string.Empty; | ||
[JsonPropertyName("data")] public string Data { get; set; } = string.Empty; | ||
|
||
[JsonPropertyName("content_type")] public string ContentType { get; set; } = string.Empty; | ||
|
||
[JsonPropertyName("width")] public int Width { get; set; } | ||
|
||
[JsonPropertyName("height")] public int Height { get; set; } | ||
|
||
[JsonPropertyName("license")] public License License { get; set; } = new(); | ||
|
||
[JsonPropertyName("path")] public string Path { get; set; } = string.Empty; | ||
|
||
[JsonIgnore] public string ImagePath { get; set; } = string.Empty; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace ChatAAC.Models.Obf; | ||
|
||
public class License | ||
{ | ||
[JsonPropertyName("type")] public string Type { get; set; } = string.Empty; | ||
|
||
[JsonPropertyName("copyright_notice_url")] public string CopyrightNoticeUrl { get; set; } = string.Empty; | ||
|
||
[JsonPropertyName("author_name")] public string AuthorName { get; set; } = string.Empty; | ||
|
||
[JsonPropertyName("author_url")] public string AuthorUrl { get; set; } = string.Empty; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace ChatAAC.Models.Obf; | ||
|
||
public class Manifest | ||
{ | ||
[JsonPropertyName("format")] public string Format { get; set; } = string.Empty; | ||
|
||
[JsonPropertyName("root")] public string Root { get; set; } = string.Empty; | ||
|
||
[JsonPropertyName("paths")] public Paths Paths { get; set; } = new(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.