forked from dotnet/maui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update ImageSourceService (dotnet#454)
- Loading branch information
Showing
18 changed files
with
174 additions
and
93 deletions.
There are no files selected for viewing
33 changes: 32 additions & 1 deletion
33
src/Controls/src/Core/Platform/Tizen/Extensions/ButtonExtensions.cs
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,13 +1,44 @@ | ||
using System; | ||
using Microsoft.Maui.Controls.Internals; | ||
using static Microsoft.Maui.Controls.Button; | ||
using TButton = Tizen.UIExtensions.NUI.Button; | ||
|
||
namespace Microsoft.Maui.Controls.Platform | ||
{ | ||
public static class ButtonExtensions | ||
{ | ||
public static void UpdateText(this TButton platformButton, Button button) | ||
{ | ||
var text = TextTransformUtilites.GetTransformedText(button.Text, button.TextTransform); | ||
platformButton.Text = text; | ||
} | ||
|
||
public static void UpdateContentLayout(this TButton nativeButton, Button button) | ||
{ | ||
//TODO : Need to impl | ||
if (button.ImageSource != null) | ||
{ | ||
var contentLayout = button.ContentLayout; | ||
nativeButton.IconPadding = (ushort)Math.Max(contentLayout.Spacing.ToScaledPixel(), 0); | ||
switch (contentLayout.Position) | ||
{ | ||
case ButtonContentLayout.ImagePosition.Top: | ||
nativeButton.IconRelativeOrientation = TButton.IconOrientation.Top; | ||
break; | ||
case ButtonContentLayout.ImagePosition.Bottom: | ||
nativeButton.IconRelativeOrientation = TButton.IconOrientation.Bottom; | ||
break; | ||
case ButtonContentLayout.ImagePosition.Left: | ||
nativeButton.IconRelativeOrientation = TButton.IconOrientation.Left; | ||
break; | ||
case ButtonContentLayout.ImagePosition.Right: | ||
nativeButton.IconRelativeOrientation = TButton.IconOrientation.Right; | ||
break; | ||
} | ||
} | ||
else | ||
{ | ||
nativeButton.IconPadding = 0; | ||
} | ||
} | ||
} | ||
} |
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
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
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
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
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
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
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
Oops, something went wrong.