Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ColorPicker): Add ColorPicker, ColorPickerSlider & ColorSpectrum #3955

Merged
merged 45 commits into from
Sep 28, 2020
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
53be6d0
chore: Add ResourceAccessor.ResourceKeys.cs
robloo Sep 3, 2020
ade4231
chore: Add DownlevelHelper stub
robloo Sep 3, 2020
95a4bd1
feat(ColorPicker): Add ColorConversion, Hsv & Rgb structs
robloo Sep 3, 2020
65c714f
chore: Add additional GetTemplateChild() helper to Control
robloo Sep 3, 2020
bb2d504
feat(ColorPicker): Add ColorSpectrum control
robloo Sep 3, 2020
16fc608
feat(ColorPicker): Add ColorPicker control including ColorPickerSlider
robloo Sep 3, 2020
1bf1d38
chore(ColorPicker): Add string resources
robloo Sep 3, 2020
57603c1
chore(ColorPicker): Various improvements
robloo Sep 3, 2020
938e886
chore: Change to interal set for ColorChangedEventArgs props
robloo Sep 4, 2020
dda9adc
fix: Use MathEx.Clamp() to support .net standard 2.0
robloo Sep 4, 2020
40bc0c1
fix: Remove Math.Clamp() to support .net standard 2.0
robloo Sep 4, 2020
7a5d0e0
chore: Use InvalidOperationException instead of Exception
robloo Sep 4, 2020
96a3217
fix: Remove changes to Uno.UI project file
robloo Sep 4, 2020
3c37888
chore: Switch to unmodified WinUI Xaml
robloo Sep 4, 2020
8d9e90a
chore: Standardize usage of 'this.'
robloo Sep 4, 2020
c53316a
chore: Use more standard uint type
robloo Sep 4, 2020
308ef6c
fix: Fully qualify Window for iOS/macOS
robloo Sep 4, 2020
1db40b1
fix: Disable currently unsupported code
robloo Sep 7, 2020
0d926ce
chore: Complete porting the last C++ code to C#
robloo Sep 7, 2020
39cc63c
chore: Import UI test from WinUI
robloo Sep 7, 2020
7b89fc4
chore: Add simple sample app test page
robloo Sep 7, 2020
03b0c03
chore: Update the SimpleTest
robloo Sep 8, 2020
edb5e68
fix: Use Task.Run() instead of ThreadPool.RunAsync()
robloo Sep 8, 2020
808c149
chore: Implement more ThreadPool-related code
robloo Sep 8, 2020
745a898
fix: Check for ValuePatternIdentifiers existence before usage
robloo Sep 9, 2020
6a54235
chore: Ensure template events are disposed
robloo Sep 9, 2020
f97af39
perf: Add new ArrayList to avoid extra copy creating bitmaps
robloo Sep 9, 2020
daad101
fix: Support Add() in ArrayList when Capacity is not set before
robloo Sep 14, 2020
249c130
chore: Make more fields private
robloo Sep 14, 2020
2344ad4
chore: Remove code that accidentally slipped in
robloo Sep 14, 2020
81c7631
Merge branch 'master' into robloo/colorpicker
robloo Sep 18, 2020
217649f
chore: Fix merge conflicts
robloo Sep 18, 2020
a91dd36
chore: Rename ColorPicker sample app pages
robloo Sep 22, 2020
c208c90
fix(ColorPicker): Fully qualify ToolTip for macOS
robloo Sep 22, 2020
9563227
fix(ColorPicker): Corrections in System.Threading
robloo Sep 22, 2020
3dfc1ae
fix(ColorPicker): Add partial modifier to ColorChangedEventArgs
robloo Sep 22, 2020
f779a9e
chore(ColorPicker): Remove xamarin namespace usage in samples
robloo Sep 23, 2020
6dfc73f
chore(ColorPicker): Implement the ColorHelper.ToDisplayName() method …
robloo Sep 23, 2020
82addc0
Merge branch 'master' into robloo/colorpicker
robloo Sep 23, 2020
3b910ea
chore(ColorPicker): Remove #if directive usage from sample
robloo Sep 23, 2020
4f13da1
Merge branch 'master' into robloo/colorpicker
robloo Sep 24, 2020
ea2c0d4
chore(ColorPicker): Fully qualify System namespace and add Capacity f…
robloo Sep 26, 2020
d66d2b2
chore: Make generic GetTemplateChild internal
davidjohnoliver Sep 28, 2020
65b0a1b
chore(ColorPicker): Update to WinUI at f4c811b92ae90ac74635c0523aa4c9…
robloo Sep 28, 2020
62bffea
Merge branch 'robloo/colorpicker' of https://github.com/robloo/uno in…
robloo Sep 28, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/Uno.UI/Helpers/WinUI/DownlevelHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace Uno.UI.Helpers.WinUI
{
// Uno Docs: This is implemented completely differently from the WinUI source which is generated.
// Several properties/methods are also omitted.
// See: https://github.com/microsoft/microsoft-ui-xaml/blob/master/dev/inc/DownlevelHelper.h
internal class DownlevelHelper
{
public static bool ToDisplayNameExists()
{
return false;
}
}
}
52 changes: 52 additions & 0 deletions src/Uno.UI/Helpers/WinUI/ResourceAccessor.ResourceKeys.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
namespace Uno.UI.Helpers.WinUI
{
internal partial class ResourceAccessor
{
// ColorPicker, ColorPickerSlider, ColorSpectrum
public const string SR_TextAlphaLabel = "TextAlphaLabel";
public const string SR_AutomationNameAlphaSlider = "AutomationNameAlphaSlider";
public const string SR_AutomationNameAlphaTextBox = "AutomationNameAlphaTextBox";
public const string SR_AutomationNameHueSlider = "AutomationNameHueSlider";
public const string SR_AutomationNameSaturationSlider = "AutomationNameSaturationSlider";
public const string SR_AutomationNameValueSlider = "AutomationNameValueSlider";
public const string SR_TextBlueLabel = "TextBlueLabel";
public const string SR_AutomationNameBlueTextBox = "AutomationNameBlueTextBox";
public const string SR_AutomationNameColorModelComboBox = "AutomationNameColorModelComboBox";
public const string SR_AutomationNameColorSpectrum = "AutomationNameColorSpectrum";
public const string SR_TextGreenLabel = "TextGreenLabel";
public const string SR_AutomationNameGreenTextBox = "AutomationNameGreenTextBox";
public const string SR_HelpTextColorSpectrum = "HelpTextColorSpectrum";
public const string SR_AutomationNameHexTextBox = "AutomationNameHexTextBox";
public const string SR_ContentHSVComboBoxItem = "ContentHSVComboBoxItem";
public const string SR_TextHueLabel = "TextHueLabel";
public const string SR_AutomationNameHueTextBox = "AutomationNameHueTextBox";
public const string SR_LocalizedControlTypeColorSpectrum = "LocalizedControlTypeColorSpectrum";
public const string SR_TextRedLabel = "TextRedLabel";
public const string SR_AutomationNameRedTextBox = "AutomationNameRedTextBox";
public const string SR_ContentRGBComboBoxItem = "ContentRGBComboBoxItem";
public const string SR_TextSaturationLabel = "TextSaturationLabel";
public const string SR_AutomationNameSaturationTextBox = "AutomationNameSaturationTextBox";
public const string SR_TextValueLabel = "TextValueLabel";
public const string SR_ValueStringColorSpectrumWithColorName = "ValueStringColorSpectrumWithColorName";
public const string SR_ValueStringColorSpectrumWithoutColorName = "ValueStringColorSpectrumWithoutColorName";
public const string SR_ValueStringHueSliderWithColorName = "ValueStringHueSliderWithColorName";
public const string SR_ValueStringHueSliderWithoutColorName = "ValueStringHueSliderWithoutColorName";
public const string SR_ValueStringSaturationSliderWithColorName = "ValueStringSaturationSliderWithColorName";
public const string SR_ValueStringSaturationSliderWithoutColorName = "ValueStringSaturationSliderWithoutColorName";
public const string SR_ValueStringValueSliderWithColorName = "ValueStringValueSliderWithColorName";
public const string SR_ValueStringValueSliderWithoutColorName = "ValueStringValueSliderWithoutColorName";
public const string SR_AutomationNameValueTextBox = "AutomationNameValueTextBox";
public const string SR_ToolTipStringAlphaSlider = "ToolTipStringAlphaSlider";
public const string SR_ToolTipStringHueSliderWithColorName = "ToolTipStringHueSliderWithColorName";
public const string SR_ToolTipStringHueSliderWithoutColorName = "ToolTipStringHueSliderWithoutColorName";
public const string SR_ToolTipStringSaturationSliderWithColorName = "ToolTipStringSaturationSliderWithColorName";
public const string SR_ToolTipStringSaturationSliderWithoutColorName = "ToolTipStringSaturationSliderWithoutColorName";
public const string SR_ToolTipStringValueSliderWithColorName = "ToolTipStringValueSliderWithColorName";
public const string SR_ToolTipStringValueSliderWithoutColorName = "ToolTipStringValueSliderWithoutColorName";
public const string SR_AutomationNameMoreButtonCollapsed = "AutomationNameMoreButtonCollapsed";
public const string SR_AutomationNameMoreButtonExpanded = "AutomationNameMoreButtonExpanded";
public const string SR_HelpTextMoreButton = "HelpTextMoreButton";
public const string SR_TextMoreButtonLabelCollapsed = "TextMoreButtonLabelCollapsed";
public const string SR_TextMoreButtonLabelExpanded = "TextMoreButtonLabelExpanded";
}
}
2 changes: 1 addition & 1 deletion src/Uno.UI/Helpers/WinUI/ResourceAccessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

namespace Uno.UI.Helpers.WinUI
{
internal class ResourceAccessor
internal partial class ResourceAccessor
{
public const string MUXCONTROLS_PACKAGE_NAME = "Microsoft.UI.Xaml.3.0";
private const string c_resourceLoc = "Microsoft.UI.Xaml/Resources";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using Windows.UI;

namespace Microsoft.UI.Xaml.Controls
{
public class ColorChangedEventArgs : IColorChangedEventArgs
{
private Color m_oldColor;
private Color m_newColor;

public Color OldColor
{
get => m_oldColor;
internal set => m_oldColor = value;
}

public Color NewColor
{
get => m_newColor;
internal set => m_newColor = value;
}
}
}
Loading