@@ -77,53 +77,41 @@ public void EditTheme(Theming.Theme theme)
7777 while they are cool... there'll also be very confusing to the average user*/
7878 private void ProcessColourPicker ( )
7979 {
80- clpPicker . FindControl < ComboBox > ( "ColorSpaceComboBox" ) . SelectedIndex = 1 ;
81- clpPicker . FindControl < IControl > ( "PaletteSelector" ) . IsVisible = false ;
82-
8380 var grid = ( Grid ) ( ( Grid ) clpPicker . Content ) . Children [ 0 ] ;
84- grid . Children [ 2 ] . IsVisible = false ;
85- grid . Children [ 6 ] . IsVisible = false ;
86-
87- var zeroL = GridLength . Parse ( "0" ) ;
88- grid . ColumnDefinitions [ 3 ] . Width = GridLength . Auto ;
89- grid . ColumnDefinitions [ 4 ] . Width = zeroL ;
90- grid . ColumnDefinitions [ ^ 1 ] . Width = GridLength . Auto ;
91- grid . ColumnDefinitions [ ^ 2 ] . Width = zeroL ;
92-
93- var hsvControls = ( ( Grid ) grid . Children [ 4 ] ) . Children ;
94- for ( int i = 7 ; i < hsvControls . Count ; i ++ )
95- {
96- hsvControls [ i ] . IsVisible = false ;
97- }
9881 var clabControls = ( ( Grid ) grid . Children [ 5 ] ) . Children ;
99- for ( int i = 0 ; i < 10 ; i ++ )
100- {
101- clabControls [ i ] . IsVisible = false ;
102- }
103-
104- /*Move the hex controls to the next grid controls,
105- we're have more space that way*/
106- var hexHeader = ( Control ) clabControls [ 10 ] ;
107- Grid . SetRow ( hexHeader , 4 ) ;
108- clabControls . RemoveAt ( 10 ) ;
82+ var hexTextBox = clpPicker . Find < TextBox > ( "Hex_Box" ) ;
83+
84+ Grid . SetRow ( hexTextBox , 5 ) ;
85+ clabControls . Remove ( hexTextBox ) ;
10986
11087 var hexHashText = ( Control ) clabControls [ 10 ] ;
11188 Grid . SetRow ( hexHashText , 5 ) ;
112- clabControls . RemoveAt ( 10 ) ;
113-
114- var hexTextBox = ( TextBox ) clabControls [ 10 ] ;
115- Grid . SetRow ( hexTextBox , 5 ) ;
116- clabControls . RemoveAt ( 10 ) ;
89+ clabControls . Remove ( hexHashText ) ;
90+
91+ var hexHeader = ( Control ) clabControls [ 10 ] ;
92+ Grid . SetRow ( hexHeader , 4 ) ;
93+ clabControls . Remove ( hexHeader ) ;
11794
95+ var hsvControls = ( ( Grid ) grid . Children [ 4 ] ) . Children ;
11896 hsvControls . Add ( hexHeader ) ;
11997 hsvControls . Add ( hexHashText ) ;
12098 hsvControls . Add ( hexTextBox ) ;
121-
99+
122100 hexTextBox . GetObservable ( TextBox . TextProperty ) . Subscribe ( x =>
123101 {
124102 _colourButton . BtnColor = new ImmutableSolidColorBrush ( clpPicker . Color ) ;
125103 UpdateTheme ( _colourButton . Name , clpPicker . Color ) ;
126104 } ) ;
105+
106+ clpPicker . IsPaletteVisible = false ;
107+ clpPicker . IsHSBVisible = false ;
108+ clpPicker . IsAlphaVisible = false ;
109+ clpPicker . IsColourBlindnessSelectorVisible = false ;
110+ clpPicker . IsCIELABVisible = false ;
111+
112+ var zeroL = GridLength . Parse ( "0" ) ;
113+ grid . ColumnDefinitions [ ^ 1 ] . Width = GridLength . Auto ;
114+ grid . ColumnDefinitions [ ^ 2 ] . Width = zeroL ;
127115 }
128116
129117 private void UpdateTheme ( string name , Color color )
0 commit comments