From f7566c97ef5777a97318ead1f8e60b55592ae199 Mon Sep 17 00:00:00 2001 From: galadril Date: Tue, 4 Sep 2018 13:31:40 +0200 Subject: [PATCH 1/2] Fixes for tablet ui --- src/ColorPickerDialog.cs | 16 ++++-- src/ColorPickerMixer.xaml | 106 ++++++++++++++++++----------------- src/ColorPickerMixer.xaml.cs | 20 ++----- 3 files changed, 70 insertions(+), 72 deletions(-) diff --git a/src/ColorPickerDialog.cs b/src/ColorPickerDialog.cs index d1b3869..047dfcd 100644 --- a/src/ColorPickerDialog.cs +++ b/src/ColorPickerDialog.cs @@ -66,9 +66,6 @@ protected async override Task BuildContent() TextColor = settings.TextColor, EditorsColor = settings.EditorsColor, ColorPreviewBorderColor = settings.ColorPreviewBorderColor, - SliderWidth = settings.SliderWidth, - ARGBEditorsWidth = settings.ARGBEditorsWidth, - ColorEditorWidth = settings.ColorEditorWidth, EditAlpha = settings.EditAlfa, }; colorEditor.Color = originalColor; @@ -96,9 +93,6 @@ public class ColorDialogSettings : DialogSettings { public Color EditorsColor { get; set; } = Color.White; public Color ColorPreviewBorderColor { get; set; } - public double SliderWidth { get; set; } = 256; - public double ARGBEditorsWidth { get; set; } = 65; - public double ColorEditorWidth { get; set; } = 120; public bool EditAlfa { get; set; } = true; } @@ -185,6 +179,16 @@ protected async Task Initialize() Padding = new Thickness(16), HasShadow = true, }; + + switch(Device.Idiom) + { + case TargetIdiom.Tablet: + case TargetIdiom.Desktop: + MainFrame.WidthRequest = 300; + break; + } + + Children.Add(MainFrame); MainConteiner = new StackLayout() { Orientation = StackOrientation.Vertical }; diff --git a/src/ColorPickerMixer.xaml b/src/ColorPickerMixer.xaml index a2a66d7..6c81896 100644 --- a/src/ColorPickerMixer.xaml +++ b/src/ColorPickerMixer.xaml @@ -3,10 +3,13 @@ x:Class="Amporis.Xamarin.Forms.ColorPicker.ColorPickerMixer" xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" - xmlns:local="clr-namespace:Amporis.Xamarin.Forms.ColorPicker"> + xmlns:local="clr-namespace:Amporis.Xamarin.Forms.ColorPicker" + x:Name="pContent"> - - + @@ -28,21 +31,21 @@ - + + - - - - - + - - - - - - - - - diff --git a/src/ColorPickerMixer.xaml.cs b/src/ColorPickerMixer.xaml.cs index 73f3843..0010ed7 100644 --- a/src/ColorPickerMixer.xaml.cs +++ b/src/ColorPickerMixer.xaml.cs @@ -1,12 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Text; -using System.Threading.Tasks; - -using XF = Xamarin.Forms; +using System.Runtime.CompilerServices; using Xamarin.Forms; using Xamarin.Forms.Xaml; @@ -23,6 +15,7 @@ public ColorPickerMixer() InitializeComponent(); eColor.Keyboard = Keyboard.Create(KeyboardFlags.CapitalizeSentence); gMain.BindingContext = this; + ColorVal.PropertyChanged += (s, e) => { switch (e.PropertyName) @@ -40,9 +33,9 @@ public ColorPickerMixer() #region Settings - private Color textColor = XF.Color.Black; - private Color editorsColor = XF.Color.White; - private Color colorPreviewBorderColor = XF.Color.Black; + private Color textColor = Color.Black; + private Color editorsColor = Color.White; + private Color colorPreviewBorderColor = Color.Black; private double sliderWidth = 256; private double aRGBEditorsWidth = 65; private double colorEditorWidth = 120; @@ -50,9 +43,6 @@ public ColorPickerMixer() public Color TextColor { get => textColor; set { textColor = value; ValueChanged(); } } public Color EditorsColor { get => editorsColor; set { editorsColor = value; ValueChanged(); } } public Color ColorPreviewBorderColor { get => colorPreviewBorderColor; set { colorPreviewBorderColor = value; ValueChanged(); } } - public double SliderWidth { get => sliderWidth; set { sliderWidth = value; ValueChanged(); } } - public double ARGBEditorsWidth { get => aRGBEditorsWidth; set { aRGBEditorsWidth = value; ValueChanged(); } } - public double ColorEditorWidth { get => colorEditorWidth; set { colorEditorWidth = value; ValueChanged(); } } public bool EditAlpha { get => ColorVal.EditAlpha; set { ColorVal.EditAlpha = value; ColorVal.EditAlpha = value; ValueChanged(); } } #endregion From b6c183b1806bdfa1a9d3a63f17c9c352e7bb524b Mon Sep 17 00:00:00 2001 From: galadril Date: Tue, 4 Sep 2018 13:34:40 +0200 Subject: [PATCH 2/2] Add myget solution file --- MyGet.sln | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 MyGet.sln diff --git a/MyGet.sln b/MyGet.sln new file mode 100644 index 0000000..747cfce --- /dev/null +++ b/MyGet.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27428.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ColorPicker.NS", "src\ColorPicker.NS.csproj", "{A0B72722-3B20-4970-BFE6-0E8B02DF0DF7}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A0B72722-3B20-4970-BFE6-0E8B02DF0DF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A0B72722-3B20-4970-BFE6-0E8B02DF0DF7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A0B72722-3B20-4970-BFE6-0E8B02DF0DF7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A0B72722-3B20-4970-BFE6-0E8B02DF0DF7}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {D45162BA-C5BD-4AC7-A194-6C289E48177B} + EndGlobalSection +EndGlobal