mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
Add RTL support for WinForms dialogs
This commit is contained in:
parent
b3a8691b29
commit
2ddc5efbef
@ -8,6 +8,8 @@ namespace Bloxstrap
|
|||||||
{
|
{
|
||||||
public static CultureInfo CurrentCulture = CultureInfo.InvariantCulture;
|
public static CultureInfo CurrentCulture = CultureInfo.InvariantCulture;
|
||||||
|
|
||||||
|
public static bool RightToLeft { get; private set; } = false;
|
||||||
|
|
||||||
public static readonly Dictionary<string, string> SupportedLocales = new()
|
public static readonly Dictionary<string, string> SupportedLocales = new()
|
||||||
{
|
{
|
||||||
{ "nil", Strings.Enums_Theme_Default }, // /shrug
|
{ "nil", Strings.Enums_Theme_Default }, // /shrug
|
||||||
@ -83,6 +85,8 @@ namespace Bloxstrap
|
|||||||
|
|
||||||
if (identifier == "ar" || identifier == "he")
|
if (identifier == "ar" || identifier == "he")
|
||||||
{
|
{
|
||||||
|
RightToLeft = true;
|
||||||
|
|
||||||
handler = new((sender, _) =>
|
handler = new((sender, _) =>
|
||||||
{
|
{
|
||||||
var window = (Window)sender;
|
var window = (Window)sender;
|
||||||
|
@ -94,6 +94,17 @@ namespace Bloxstrap.UI.Elements.Bootstrapper.Base
|
|||||||
{
|
{
|
||||||
Text = App.Settings.Prop.BootstrapperTitle;
|
Text = App.Settings.Prop.BootstrapperTitle;
|
||||||
Icon = App.Settings.Prop.BootstrapperIcon.GetIcon();
|
Icon = App.Settings.Prop.BootstrapperIcon.GetIcon();
|
||||||
|
|
||||||
|
if (Locale.RightToLeft)
|
||||||
|
{
|
||||||
|
this.RightToLeft = RightToLeft.Yes;
|
||||||
|
this.RightToLeftLayout = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.RightToLeft = RightToLeft.No;
|
||||||
|
this.RightToLeftLayout = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#region WinForms event handlers
|
#region WinForms event handlers
|
||||||
|
@ -75,6 +75,7 @@ namespace Bloxstrap.UI.Elements.Bootstrapper
|
|||||||
{
|
{
|
||||||
Icon = new TaskDialogIcon(App.Settings.Prop.BootstrapperIcon.GetIcon()),
|
Icon = new TaskDialogIcon(App.Settings.Prop.BootstrapperIcon.GetIcon()),
|
||||||
Caption = App.Settings.Prop.BootstrapperTitle,
|
Caption = App.Settings.Prop.BootstrapperTitle,
|
||||||
|
RightToLeftLayout = Locale.RightToLeft,
|
||||||
|
|
||||||
Buttons = { TaskDialogButton.Cancel },
|
Buttons = { TaskDialogButton.Cancel },
|
||||||
ProgressBar = new TaskDialogProgressBar()
|
ProgressBar = new TaskDialogProgressBar()
|
||||||
|
Loading…
Reference in New Issue
Block a user