Added Acrylic Sample
This commit is contained in:
Родитель
5afbc90e06
Коммит
d2d3ba6b29
|
@ -15,6 +15,7 @@ namespace FluentEditor.ControlPalette
|
||||||
|
|
||||||
public class ColorMapping
|
public class ColorMapping
|
||||||
{
|
{
|
||||||
|
private bool initialized = false;
|
||||||
public static ColorMapping Parse(JsonObject data, IColorPaletteEntry lightRegion, IColorPaletteEntry darkRegion, ColorPalette lightBase, ColorPalette darkBase, ColorPalette lightPrimary, ColorPalette darkPrimary, IColorPaletteEntry white, IColorPaletteEntry black)
|
public static ColorMapping Parse(JsonObject data, IColorPaletteEntry lightRegion, IColorPaletteEntry darkRegion, ColorPalette lightBase, ColorPalette darkBase, ColorPalette lightPrimary, ColorPalette darkPrimary, IColorPaletteEntry white, IColorPaletteEntry black)
|
||||||
{
|
{
|
||||||
var target = data["Target"].GetEnum<ColorTarget>();
|
var target = data["Target"].GetEnum<ColorTarget>();
|
||||||
|
@ -205,6 +206,37 @@ namespace FluentEditor.ControlPalette
|
||||||
ForceThemeUpdateInLinkedElement();
|
ForceThemeUpdateInLinkedElement();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void UpdateAcrylicSurfaceVisual()
|
||||||
|
{
|
||||||
|
if (_targetResources == null || _targetResources.BaseLow == null || _targetResources.ChromeMediumLow == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
App.Current.Resources["SystemAccentColor"] = _targetResources.Accent;
|
||||||
|
|
||||||
|
if (IsSettingDarkColors(_source.Title, "Light Base"))
|
||||||
|
{
|
||||||
|
App.Current.Resources["SystemChromeAltHighColor"] = _targetResources.BaseLow;
|
||||||
|
App.Current.Resources["SystemChromeMediumColor"] = _targetResources.BaseLow;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (IsSettingDarkColors(_source.Title, "Dark Base"))
|
||||||
|
{
|
||||||
|
App.Current.Resources["SystemChromeAltHighColor_Dark"] = _targetResources.ChromeMediumLow;
|
||||||
|
App.Current.Resources["SystemChromeMediumColor_Dark"] = _targetResources.ChromeMediumLow;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool IsSettingDarkColors(string title, string themeType)
|
||||||
|
{
|
||||||
|
string[] splitTitle = title.Split(new string[] { themeType }, StringSplitOptions.None);
|
||||||
|
|
||||||
|
if (splitTitle[0] == "")
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
_source.ActiveColorChanged -= Source_ActiveColorChanged;
|
_source.ActiveColorChanged -= Source_ActiveColorChanged;
|
||||||
|
@ -231,7 +263,7 @@ namespace FluentEditor.ControlPalette
|
||||||
_targetResources.AltLow = _source.ActiveColor;
|
_targetResources.AltLow = _source.ActiveColor;
|
||||||
break;
|
break;
|
||||||
case ColorTarget.AltMedium:
|
case ColorTarget.AltMedium:
|
||||||
_targetResources.AltMedium = _source.ActiveColor;
|
_targetResources.AltMedium = _source.ActiveColor;
|
||||||
break;
|
break;
|
||||||
case ColorTarget.AltMediumHigh:
|
case ColorTarget.AltMediumHigh:
|
||||||
_targetResources.AltMediumHigh = _source.ActiveColor;
|
_targetResources.AltMediumHigh = _source.ActiveColor;
|
||||||
|
@ -300,6 +332,8 @@ namespace FluentEditor.ControlPalette
|
||||||
_targetResources.ListMedium = _source.ActiveColor;
|
_targetResources.ListMedium = _source.ActiveColor;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UpdateAcrylicSurfaceVisual();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -168,6 +168,12 @@
|
||||||
x:Uid="TestContentCalendarViewBlock"
|
x:Uid="TestContentCalendarViewBlock"
|
||||||
Margin="0,0,0,16"
|
Margin="0,0,0,16"
|
||||||
Style="{StaticResource BaseTextBlockStyle}" />
|
Style="{StaticResource BaseTextBlockStyle}" />
|
||||||
|
<Grid HorizontalAlignment="Stretch" Height="120" Background="{ThemeResource SystemControlAcrylicWindowBrush}" Margin="0, 0, 0, 16">
|
||||||
|
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Text="Base Acrylic" FontStyle="Italic" Margin="5"/>
|
||||||
|
</Grid>
|
||||||
|
<Grid HorizontalAlignment="Stretch" Height="120" Background="{ThemeResource SystemControlAccentAcrylicWindowAccentMediumHighBrush}" Margin="0, 0, 0, 16">
|
||||||
|
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Text="Primary Acrylic" FontStyle="Italic" Margin="5" RequestedTheme="Dark"/>
|
||||||
|
</Grid>
|
||||||
<CalendarView Margin="0,0,0,28" HorizontalAlignment="Stretch" BorderThickness="{ThemeResource DatePickerBorderThemeThickness}"/>
|
<CalendarView Margin="0,0,0,28" HorizontalAlignment="Stretch" BorderThickness="{ThemeResource DatePickerBorderThemeThickness}"/>
|
||||||
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
|
@ -214,7 +214,8 @@
|
||||||
<TextBlock
|
<TextBlock
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
Text="Font Here"/>
|
Text="Coming Soon!"
|
||||||
|
Margin="0, 10, 0, 0"/>
|
||||||
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel
|
<StackPanel
|
||||||
|
@ -226,178 +227,186 @@
|
||||||
Orientation="Vertical">
|
Orientation="Vertical">
|
||||||
|
|
||||||
<ComboBox
|
<ComboBox
|
||||||
Header="Presets"
|
Header="Shape Presets"
|
||||||
BorderThickness="1"
|
BorderThickness="1"
|
||||||
Margin="0, 10, 0, 0"
|
Margin="0, 10, 0, 0"
|
||||||
CornerRadius="2"
|
CornerRadius="2"
|
||||||
SelectedIndex="1"
|
SelectedIndex="0"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
VerticalAlignment="Top">
|
VerticalAlignment="Top"
|
||||||
<ComboBoxItem>No Rounding, Thicker Borders</ComboBoxItem>
|
SelectionChanged="ComboBox_SelectionChanged">
|
||||||
<ComboBoxItem>Default</ComboBoxItem>
|
<ComboBoxItem>Default</ComboBoxItem>
|
||||||
|
<ComboBoxItem>No Rounding, Thicker Borders</ComboBoxItem>
|
||||||
</ComboBox>
|
</ComboBox>
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="0, 25, 0, 0"
|
Margin="0, 25, 0, 0"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
Text="Control Corner Radius"
|
Text="Corner Radius"
|
||||||
FontWeight="SemiBold"
|
FontWeight="SemiBold"
|
||||||
LineHeight="20"/>
|
LineHeight="20"/>
|
||||||
<Slider x:Name="ControlRoundSlider" ValueChanged="ControlRoundSlider_ValueChanged" Maximum="20" Minimum="0" Value="2" HorizontalAlignment="Stretch"/>
|
<!-- START -->
|
||||||
<StackPanel Orientation="Horizontal" Spacing="13">
|
<StackPanel
|
||||||
<StackPanel>
|
BorderThickness="1"
|
||||||
<FontIcon Glyph="" FontSize="28"/>
|
BorderBrush="{ThemeResource ButtonBackgroundThemeBrush}"
|
||||||
<TextBox CornerRadius="2" BorderThickness="1"
|
Padding="5"
|
||||||
x:Name="TopLeftTB"
|
CornerRadius="2" >
|
||||||
Text="{Binding Value, ElementName=ControlRoundSlider, Mode=OneWay}"
|
<TextBlock
|
||||||
MaxLength="2"
|
Margin="0, 5, 0, 0"
|
||||||
Width="54"
|
VerticalAlignment="Top"
|
||||||
GotFocus="TextBox_GotFocus"
|
HorizontalAlignment="Stretch"
|
||||||
LostFocus="TextBox_LostFocus"
|
Text="Controls"
|
||||||
KeyDown="TextBox_KeyDown"/>
|
FontSize="12"/>
|
||||||
|
<Slider x:Name="ControlRoundSlider" Maximum="20" Minimum="0" Value="2" HorizontalAlignment="Stretch"/>
|
||||||
|
<StackPanel Orientation="Horizontal" Spacing="9">
|
||||||
|
<StackPanel>
|
||||||
|
<FontIcon Glyph="" FontSize="28"/>
|
||||||
|
<TextBox CornerRadius="2" BorderThickness="1"
|
||||||
|
x:Name="TopLeftTB"
|
||||||
|
Text="{Binding Value, ElementName=ControlRoundSlider, Mode=OneWay}"
|
||||||
|
MaxLength="2"
|
||||||
|
Width="54"
|
||||||
|
GotFocus="TextBox_GotFocus"
|
||||||
|
KeyDown="TextBox_KeyDown"/>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel>
|
||||||
|
<FontIcon Glyph="" FontSize="28"/>
|
||||||
|
<TextBox CornerRadius="2" BorderThickness="1"
|
||||||
|
x:Name="TopRightTB"
|
||||||
|
Text="{Binding Value, ElementName=ControlRoundSlider, Mode=OneWay}"
|
||||||
|
MaxLength="2"
|
||||||
|
Width="54"
|
||||||
|
GotFocus="TextBox_GotFocus"
|
||||||
|
KeyDown="TextBox_KeyDown"/>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel>
|
||||||
|
<FontIcon Glyph="" FontSize="28"/>
|
||||||
|
<TextBox CornerRadius="2" BorderThickness="1"
|
||||||
|
x:Name="BottomRightTB"
|
||||||
|
Text="{Binding Value, ElementName=ControlRoundSlider, Mode=OneWay}"
|
||||||
|
MaxLength="2"
|
||||||
|
Width="54"
|
||||||
|
GotFocus="TextBox_GotFocus"
|
||||||
|
KeyDown="TextBox_KeyDown"/>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel>
|
||||||
|
<FontIcon Glyph="" FontSize="28"/>
|
||||||
|
<TextBox CornerRadius="2" BorderThickness="1"
|
||||||
|
x:Name="BottomLeftTB"
|
||||||
|
Text="{Binding Value, ElementName=ControlRoundSlider, Mode=OneWay}"
|
||||||
|
MaxLength="2"
|
||||||
|
Width="54"
|
||||||
|
GotFocus="TextBox_GotFocus"
|
||||||
|
KeyDown="TextBox_KeyDown"/>
|
||||||
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel>
|
|
||||||
<FontIcon Glyph="" FontSize="28"/>
|
<TextBlock
|
||||||
<TextBox CornerRadius="2" BorderThickness="1"
|
Margin="0, 15, 0, 0"
|
||||||
x:Name="TopRightTB"
|
VerticalAlignment="Top"
|
||||||
Text="{Binding Value, ElementName=ControlRoundSlider, Mode=OneWay}"
|
HorizontalAlignment="Stretch"
|
||||||
MaxLength="2"
|
Text="Overlays"
|
||||||
Width="54"
|
FontSize="12"/>
|
||||||
GotFocus="TextBox_GotFocus"
|
<Slider x:Name="ControlRoundSliderOverlay"
|
||||||
LostFocus="TextBox_LostFocus"
|
ValueChanged="ControlRoundSliderOverlay_ValueChanged"
|
||||||
KeyDown="TextBox_KeyDown"/>
|
Maximum="20" Minimum="0" Value="4" HorizontalAlignment="Stretch"/>
|
||||||
</StackPanel>
|
<StackPanel Orientation="Horizontal" Spacing="9">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<FontIcon Glyph="" FontSize="28"/>
|
<TextBox CornerRadius="2" BorderThickness="1"
|
||||||
<TextBox CornerRadius="2" BorderThickness="1"
|
x:Name="TopLeftTBOverlay"
|
||||||
x:Name="BottomRightTB"
|
Text="{Binding Value, ElementName=ControlRoundSliderOverlay, Mode=OneWay}"
|
||||||
Text="{Binding Value, ElementName=ControlRoundSlider, Mode=OneWay}"
|
MaxLength="2"
|
||||||
MaxLength="2"
|
Width="54"
|
||||||
Width="54"
|
GotFocus="TextBox_GotFocus"/>
|
||||||
GotFocus="TextBox_GotFocus"
|
</StackPanel>
|
||||||
LostFocus="TextBox_LostFocus"
|
<StackPanel>
|
||||||
KeyDown="TextBox_KeyDown"/>
|
<TextBox CornerRadius="2" BorderThickness="1"
|
||||||
</StackPanel>
|
x:Name="TopRightTBOverlay"
|
||||||
<StackPanel>
|
Text="{Binding Value, ElementName=ControlRoundSliderOverlay, Mode=OneWay}"
|
||||||
<FontIcon Glyph="" FontSize="28"/>
|
MaxLength="2"
|
||||||
<TextBox CornerRadius="2" BorderThickness="1"
|
Width="54"
|
||||||
x:Name="BottomLeftTB"
|
GotFocus="TextBox_GotFocus"/>
|
||||||
Text="{Binding Value, ElementName=ControlRoundSlider, Mode=OneWay}"
|
</StackPanel>
|
||||||
MaxLength="2"
|
<StackPanel>
|
||||||
Width="54"
|
<TextBox CornerRadius="2" BorderThickness="1"
|
||||||
GotFocus="TextBox_GotFocus"
|
x:Name="BottomRightTBOverlay"
|
||||||
LostFocus="TextBox_LostFocus"
|
Text="{Binding Value, ElementName=ControlRoundSliderOverlay, Mode=OneWay}"
|
||||||
KeyDown="TextBox_KeyDown"/>
|
MaxLength="2"
|
||||||
|
Width="54"
|
||||||
|
GotFocus="TextBox_GotFocus"/>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel>
|
||||||
|
<TextBox CornerRadius="2" BorderThickness="1"
|
||||||
|
x:Name="BottomLeftTBOverlay"
|
||||||
|
Text="{Binding Value, ElementName=ControlRoundSliderOverlay, Mode=OneWay}"
|
||||||
|
MaxLength="2"
|
||||||
|
Width="54"
|
||||||
|
GotFocus="TextBox_GotFocus"/>
|
||||||
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
<!-- END -->
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="0, 25, 0, 0"
|
Margin="0, 25, 0, 0"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
Text="Overlay Corner Radius"
|
Text="Border Thickness"
|
||||||
FontWeight="SemiBold"
|
FontWeight="SemiBold"
|
||||||
LineHeight="20"/>
|
LineHeight="20"/>
|
||||||
<Slider x:Name="ControlRoundSliderOverlay"
|
|
||||||
ValueChanged="ControlRoundSliderOverlay_ValueChanged"
|
<!-- START 2 -->
|
||||||
Maximum="20" Minimum="0" Value="4" HorizontalAlignment="Stretch"/>
|
<StackPanel BorderBrush="{ThemeResource ButtonBackgroundThemeBrush}"
|
||||||
<StackPanel Orientation="Horizontal" Spacing="13">
|
BorderThickness="1"
|
||||||
<StackPanel>
|
CornerRadius="2"
|
||||||
<FontIcon Glyph="" FontSize="28" Margin="0, 0, 0, 3"/>
|
Padding="5">
|
||||||
<TextBox CornerRadius="2" BorderThickness="1"
|
<Slider x:Name="ControlBorderThicknessSlider"
|
||||||
x:Name="TopLeftTBOverlay"
|
Maximum="5" Minimum="0" Value="1" HorizontalAlignment="Stretch"/>
|
||||||
Text="{Binding Value, ElementName=ControlRoundSliderOverlay, Mode=OneWay}"
|
<StackPanel Orientation="Horizontal" Spacing="9">
|
||||||
MaxLength="2"
|
<StackPanel>
|
||||||
Width="54"
|
<FontIcon Glyph="" FontSize="28"/>
|
||||||
GotFocus="TextBox_GotFocus"
|
<TextBox CornerRadius="2" BorderThickness="1"
|
||||||
LostFocus="TextBoxOverlay_LostFocus"
|
x:Name="LeftBorderTB"
|
||||||
KeyDown="TextBoxOverlay_KeyDown"/>
|
Text="{Binding Value, ElementName=ControlBorderThicknessSlider, Mode=OneWay}"
|
||||||
</StackPanel>
|
MaxLength="2"
|
||||||
<StackPanel>
|
Width="54"
|
||||||
<FontIcon Glyph="" FontSize="28" Margin="0, 0, 0, 3"/>
|
GotFocus="TextBox_GotFocus"
|
||||||
<TextBox CornerRadius="2" BorderThickness="1"
|
KeyDown="TextBoxBorder_KeyDown"/>
|
||||||
x:Name="TopRightTBOverlay"
|
</StackPanel>
|
||||||
Text="{Binding Value, ElementName=ControlRoundSliderOverlay, Mode=OneWay}"
|
<StackPanel>
|
||||||
MaxLength="2"
|
<FontIcon Glyph="" FontSize="28"/>
|
||||||
Width="54"
|
<TextBox CornerRadius="2" BorderThickness="1"
|
||||||
GotFocus="TextBox_GotFocus"
|
x:Name="TopBorderTB"
|
||||||
LostFocus="TextBoxOverlay_LostFocus"/>
|
Text="{Binding Value, ElementName=ControlBorderThicknessSlider, Mode=OneWay}"
|
||||||
</StackPanel>
|
MaxLength="2"
|
||||||
<StackPanel>
|
Width="54"
|
||||||
<FontIcon Glyph="" FontSize="28" Margin="0, 0, 0, 3"/>
|
GotFocus="TextBox_GotFocus"
|
||||||
<TextBox CornerRadius="2" BorderThickness="1"
|
KeyDown="TextBoxBorder_KeyDown"/>
|
||||||
x:Name="BottomRightTBOverlay"
|
</StackPanel>
|
||||||
Text="{Binding Value, ElementName=ControlRoundSliderOverlay, Mode=OneWay}"
|
<StackPanel>
|
||||||
MaxLength="2"
|
<FontIcon Glyph="" FontSize="28"/>
|
||||||
Width="54"
|
<TextBox CornerRadius="2" BorderThickness="1"
|
||||||
GotFocus="TextBox_GotFocus"
|
x:Name="RightBorderTB"
|
||||||
LostFocus="TextBoxOverlay_LostFocus"/>
|
Text="{Binding Value, ElementName=ControlBorderThicknessSlider, Mode=OneWay}"
|
||||||
</StackPanel>
|
MaxLength="2"
|
||||||
<StackPanel>
|
Width="54"
|
||||||
<FontIcon Glyph="" FontSize="28" Margin="0, 0, 0, 3"/>
|
GotFocus="TextBox_GotFocus"
|
||||||
<TextBox CornerRadius="2" BorderThickness="1"
|
KeyDown="TextBoxBorder_KeyDown"/>
|
||||||
x:Name="BottomLeftTBOverlay"
|
</StackPanel>
|
||||||
Text="{Binding Value, ElementName=ControlRoundSliderOverlay, Mode=OneWay}"
|
<StackPanel>
|
||||||
MaxLength="2"
|
<FontIcon Glyph="" FontSize="28"/>
|
||||||
Width="54"
|
<TextBox CornerRadius="2" BorderThickness="1"
|
||||||
GotFocus="TextBox_GotFocus"
|
x:Name="BottomBorderTB"
|
||||||
LostFocus="TextBoxOverlay_LostFocus"/>
|
Text="{Binding Value, ElementName=ControlBorderThicknessSlider, Mode=OneWay}"
|
||||||
</StackPanel>
|
MaxLength="2"
|
||||||
</StackPanel>
|
Width="54"
|
||||||
|
GotFocus="TextBox_GotFocus"
|
||||||
<TextBlock
|
KeyDown="TextBoxBorder_KeyDown"/>
|
||||||
Margin="0, 25, 0, 0"
|
</StackPanel>
|
||||||
VerticalAlignment="Top"
|
|
||||||
HorizontalAlignment="Stretch"
|
|
||||||
Text="Control Border Thickness"
|
|
||||||
FontWeight="SemiBold"
|
|
||||||
LineHeight="20"/>
|
|
||||||
<Slider x:Name="ControlBorderThicknessSlider"
|
|
||||||
ValueChanged="ControlBorderThicknessSlider_ValueChanged"
|
|
||||||
Maximum="5" Minimum="0" Value="1" HorizontalAlignment="Stretch"/>
|
|
||||||
<StackPanel Orientation="Horizontal" Spacing="13">
|
|
||||||
<StackPanel>
|
|
||||||
<FontIcon Glyph="" FontSize="28"/>
|
|
||||||
<TextBox CornerRadius="2" BorderThickness="1"
|
|
||||||
x:Name="LeftBorderTB"
|
|
||||||
Text="{Binding Value, ElementName=ControlBorderThicknessSlider, Mode=OneWay}"
|
|
||||||
MaxLength="2"
|
|
||||||
Width="54"
|
|
||||||
GotFocus="TextBox_GotFocus"
|
|
||||||
LostFocus="TextBoxBorder_LostFocus"/>
|
|
||||||
</StackPanel>
|
|
||||||
<StackPanel>
|
|
||||||
<FontIcon Glyph="" FontSize="28"/>
|
|
||||||
<TextBox CornerRadius="2" BorderThickness="1"
|
|
||||||
x:Name="TopBorderTB"
|
|
||||||
Text="{Binding Value, ElementName=ControlBorderThicknessSlider, Mode=OneWay}"
|
|
||||||
MaxLength="2"
|
|
||||||
Width="54"
|
|
||||||
GotFocus="TextBox_GotFocus"
|
|
||||||
LostFocus="TextBoxBorder_LostFocus"/>
|
|
||||||
</StackPanel>
|
|
||||||
<StackPanel>
|
|
||||||
<FontIcon Glyph="" FontSize="28"/>
|
|
||||||
<TextBox CornerRadius="2" BorderThickness="1"
|
|
||||||
x:Name="RightBorderTB"
|
|
||||||
Text="{Binding Value, ElementName=ControlBorderThicknessSlider, Mode=OneWay}"
|
|
||||||
MaxLength="2"
|
|
||||||
Width="54"
|
|
||||||
GotFocus="TextBox_GotFocus"
|
|
||||||
LostFocus="TextBoxBorder_LostFocus"/>
|
|
||||||
</StackPanel>
|
|
||||||
<StackPanel>
|
|
||||||
<FontIcon Glyph="" FontSize="28"/>
|
|
||||||
<TextBox CornerRadius="2" BorderThickness="1"
|
|
||||||
x:Name="BottomBorderTB"
|
|
||||||
Text="{Binding Value, ElementName=ControlBorderThicknessSlider, Mode=OneWay}"
|
|
||||||
MaxLength="2"
|
|
||||||
Width="54"
|
|
||||||
GotFocus="TextBox_GotFocus"
|
|
||||||
LostFocus="TextBoxBorder_LostFocus"/>
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
<Button Content="Apply" HorizontalAlignment="Stretch" Margin="0, 25, 0, 0" Click="Button_Click"/>
|
||||||
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel
|
<StackPanel
|
||||||
|
@ -473,7 +482,9 @@
|
||||||
Style="{StaticResource CaptionTextBlockStyle}" />
|
Style="{StaticResource CaptionTextBlockStyle}" />
|
||||||
<Border Grid.Row="1"
|
<Border Grid.Row="1"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Margin="0,0,6,0" HorizontalAlignment="Left"
|
Margin="0,0,6,0"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
Padding="5, 0, 0, 0"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
BorderThickness="1"
|
BorderThickness="1"
|
||||||
BorderBrush="{ThemeResource ButtonBackgroundThemeBrush}"
|
BorderBrush="{ThemeResource ButtonBackgroundThemeBrush}"
|
||||||
|
@ -489,6 +500,7 @@
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Margin="6,0,0,0"
|
Margin="6,0,0,0"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
|
Padding="5, 0, 0, 0"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
BorderThickness="1"
|
BorderThickness="1"
|
||||||
BorderBrush="{ThemeResource ButtonBackgroundThemeBrush}"
|
BorderBrush="{ThemeResource ButtonBackgroundThemeBrush}"
|
||||||
|
@ -553,6 +565,7 @@
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Margin="0,0,6,0"
|
Margin="0,0,6,0"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
|
Padding="5, 0, 0, 0"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
BorderThickness="1"
|
BorderThickness="1"
|
||||||
BorderBrush="{ThemeResource ButtonBackgroundThemeBrush}"
|
BorderBrush="{ThemeResource ButtonBackgroundThemeBrush}"
|
||||||
|
@ -566,6 +579,7 @@
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Margin="6,0,0,0"
|
Margin="6,0,0,0"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
|
Padding="5, 0, 0, 0"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
BorderThickness="1"
|
BorderThickness="1"
|
||||||
BorderBrush="{ThemeResource ButtonBackgroundThemeBrush}"
|
BorderBrush="{ThemeResource ButtonBackgroundThemeBrush}"
|
||||||
|
@ -629,6 +643,7 @@
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Margin="0,0,6,0"
|
Margin="0,0,6,0"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
|
Padding="5, 0, 0, 0"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
BorderThickness="1"
|
BorderThickness="1"
|
||||||
BorderBrush="{ThemeResource ButtonBackgroundThemeBrush}"
|
BorderBrush="{ThemeResource ButtonBackgroundThemeBrush}"
|
||||||
|
@ -642,6 +657,7 @@
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Margin="6,0,0,0"
|
Margin="6,0,0,0"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
|
Padding="5, 0, 0, 0"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
BorderThickness="1"
|
BorderThickness="1"
|
||||||
BorderBrush="{ThemeResource ButtonBackgroundThemeBrush}"
|
BorderBrush="{ThemeResource ButtonBackgroundThemeBrush}"
|
||||||
|
|
|
@ -90,7 +90,6 @@ namespace FluentEditor.ControlPalette
|
||||||
|
|
||||||
private void ControlRoundSliderOverlay_ValueChanged(object sender, Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs e)
|
private void ControlRoundSliderOverlay_ValueChanged(object sender, Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs e)
|
||||||
{
|
{
|
||||||
CornerRadius cornerRadius = (CornerRadius)App.Current.Resources["OverlayCornerRadius"];
|
|
||||||
App.Current.Resources["OverlayCornerRadius"] = new CornerRadius(ControlRoundSliderOverlay.Value);
|
App.Current.Resources["OverlayCornerRadius"] = new CornerRadius(ControlRoundSliderOverlay.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,11 +108,6 @@ namespace FluentEditor.ControlPalette
|
||||||
textBox.SelectAll();
|
textBox.SelectAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TextBox_LostFocus(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
UpdateCorners();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void UpdateCorners()
|
private void UpdateCorners()
|
||||||
{
|
{
|
||||||
App.Current.Resources["ControlCornerRadius"] =
|
App.Current.Resources["ControlCornerRadius"] =
|
||||||
|
@ -130,26 +124,27 @@ namespace FluentEditor.ControlPalette
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ControlBorderThicknessSlider_ValueChanged(object sender, Windows.UI.Xaml.Controls.Primitives.RangeBaseValueChangedEventArgs e)
|
|
||||||
{
|
|
||||||
UpdateBorderThickness(new Thickness(ControlBorderThicknessSlider.Value));
|
|
||||||
RefreshControls();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void UpdateBorderThickness(Thickness value)
|
private void UpdateBorderThickness(Thickness value)
|
||||||
{
|
{
|
||||||
App.Current.Resources["ComboBoxBorderThemeThickness"] = value;
|
App.Current.Resources["ComboBoxBorderThemeThickness"] = value;
|
||||||
App.Current.Resources["DatePickerBorderThemeThickness"] = value;
|
App.Current.Resources["DatePickerBorderThemeThickness"] = value;
|
||||||
App.Current.Resources["TimePickerBorderThemeThickness"] = value;
|
App.Current.Resources["TimePickerBorderThemeThickness"] = value;
|
||||||
App.Current.Resources["TextControlBorderThemeThickness"] = value;
|
App.Current.Resources["TextControlBorderThemeThickness"] = value;
|
||||||
App.Current.Resources["CheckBoxBorderThemeThickness"] = value;
|
|
||||||
App.Current.Resources["ToggleSwitchOuterBorderStrokeThickness"] = value;
|
App.Current.Resources["ToggleSwitchOuterBorderStrokeThickness"] = EqualizeThicknessValue(value);
|
||||||
App.Current.Resources["RadioButtonBorderThemeThickness"] = value;
|
App.Current.Resources["CheckBoxBorderThemeThickness"] = EqualizeThicknessValue(value);
|
||||||
|
App.Current.Resources["RadioButtonBorderThemeThickness"] = EqualizeThicknessValue(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TextBoxOverlay_LostFocus(object sender, RoutedEventArgs e)
|
private Thickness EqualizeThicknessValue(Thickness before)
|
||||||
{
|
{
|
||||||
UpdateOverlayCorners();
|
Thickness after = new Thickness(1);
|
||||||
|
double finalEqualValue = Math.Max(Math.Max(Math.Max(before.Left, before.Right), before.Top), before.Bottom);
|
||||||
|
|
||||||
|
if (finalEqualValue > 0)
|
||||||
|
after = new Thickness(finalEqualValue);
|
||||||
|
|
||||||
|
return after;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateOverlayCorners()
|
private void UpdateOverlayCorners()
|
||||||
|
@ -167,12 +162,53 @@ namespace FluentEditor.ControlPalette
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TextBoxBorder_LostFocus(object sender, RoutedEventArgs e)
|
private void TextBoxBorder_KeyDown(object sender, Windows.UI.Xaml.Input.KeyRoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.Key == Windows.System.VirtualKey.Enter)
|
||||||
|
{
|
||||||
|
UpdateBorderThickness(new Thickness(Double.Parse(LeftBorderTB.Text), Double.Parse(TopBorderTB.Text),
|
||||||
|
Double.Parse(RightBorderTB.Text), Double.Parse(BottomBorderTB.Text)));
|
||||||
|
|
||||||
|
RefreshControls();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Button_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
UpdateBorderThickness(new Thickness(Double.Parse(LeftBorderTB.Text), Double.Parse(TopBorderTB.Text),
|
UpdateBorderThickness(new Thickness(Double.Parse(LeftBorderTB.Text), Double.Parse(TopBorderTB.Text),
|
||||||
Double.Parse(RightBorderTB.Text), Double.Parse(BottomBorderTB.Text)));
|
Double.Parse(RightBorderTB.Text), Double.Parse(BottomBorderTB.Text)));
|
||||||
|
UpdateCorners();
|
||||||
|
UpdateOverlayCorners();
|
||||||
|
|
||||||
RefreshControls();
|
RefreshControls();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
ComboBox comboBox = sender as ComboBox;
|
||||||
|
|
||||||
|
if (ControlBorderThicknessSlider == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (comboBox.SelectedIndex == 1)
|
||||||
|
{
|
||||||
|
ControlBorderThicknessSlider.Value = 2;
|
||||||
|
ControlRoundSlider.Value = 0;
|
||||||
|
ControlRoundSliderOverlay.Value = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ControlBorderThicknessSlider.Value = 1;
|
||||||
|
ControlRoundSlider.Value = 2;
|
||||||
|
ControlRoundSliderOverlay.Value = 4;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
UpdateBorderThickness(new Thickness(Double.Parse(LeftBorderTB.Text), Double.Parse(TopBorderTB.Text),
|
||||||
|
Double.Parse(RightBorderTB.Text), Double.Parse(BottomBorderTB.Text)));
|
||||||
|
UpdateCorners();
|
||||||
|
UpdateOverlayCorners();
|
||||||
|
RefreshControls();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@ using Windows.Data.Json;
|
||||||
using Windows.Storage;
|
using Windows.Storage;
|
||||||
using Windows.UI;
|
using Windows.UI;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using Windows.UI.Xaml.Media;
|
||||||
|
|
||||||
namespace FluentEditor.ControlPalette.Model
|
namespace FluentEditor.ControlPalette.Model
|
||||||
{
|
{
|
||||||
|
@ -242,6 +243,7 @@ namespace FluentEditor.ControlPalette.Model
|
||||||
|
|
||||||
_lightRegion.ActiveColor = preset.LightRegionColor;
|
_lightRegion.ActiveColor = preset.LightRegionColor;
|
||||||
_darkRegion.ActiveColor = preset.DarkRegionColor;
|
_darkRegion.ActiveColor = preset.DarkRegionColor;
|
||||||
|
|
||||||
_lightBase.BaseColor.ActiveColor = preset.LightBaseColor;
|
_lightBase.BaseColor.ActiveColor = preset.LightBaseColor;
|
||||||
_darkBase.BaseColor.ActiveColor = preset.DarkBaseColor;
|
_darkBase.BaseColor.ActiveColor = preset.DarkBaseColor;
|
||||||
_lightPrimary.BaseColor.ActiveColor = preset.LightPrimaryColor;
|
_lightPrimary.BaseColor.ActiveColor = preset.LightPrimaryColor;
|
||||||
|
|
|
@ -163,7 +163,7 @@
|
||||||
<value>Unable to load</value>
|
<value>Unable to load</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ControlPalettePresetCombo.Header" xml:space="preserve">
|
<data name="ControlPalettePresetCombo.Header" xml:space="preserve">
|
||||||
<value>Presets</value>
|
<value>Color Presets</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ControlPalettePresetCombo.PlaceholderText" xml:space="preserve">
|
<data name="ControlPalettePresetCombo.PlaceholderText" xml:space="preserve">
|
||||||
<value>Custom</value>
|
<value>Custom</value>
|
||||||
|
|
|
@ -9,9 +9,12 @@ namespace FluentEditorShared.ColorPalette
|
||||||
{
|
{
|
||||||
public class ColorPaletteEditor : Control
|
public class ColorPaletteEditor : Control
|
||||||
{
|
{
|
||||||
|
private double collapsedHeight = 56;
|
||||||
|
private double expandedHeight = 465;
|
||||||
public ColorPaletteEditor()
|
public ColorPaletteEditor()
|
||||||
{
|
{
|
||||||
this.DefaultStyleKey = typeof(ColorPaletteEditor);
|
this.DefaultStyleKey = typeof(ColorPaletteEditor);
|
||||||
|
this.Height = collapsedHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region ColorPaletteProperty
|
#region ColorPaletteProperty
|
||||||
|
@ -63,8 +66,23 @@ namespace FluentEditorShared.ColorPalette
|
||||||
|
|
||||||
public bool IsExpanded
|
public bool IsExpanded
|
||||||
{
|
{
|
||||||
get { return (bool)GetValue(IsExpandedProperty); }
|
get
|
||||||
set { SetValue(IsExpandedProperty, value); }
|
{
|
||||||
|
return (bool)GetValue(IsExpandedProperty);
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
AdjustHeight(value);
|
||||||
|
SetValue(IsExpandedProperty, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AdjustHeight(bool isExpanded)
|
||||||
|
{
|
||||||
|
if (isExpanded)
|
||||||
|
this.Height = expandedHeight;
|
||||||
|
else
|
||||||
|
this.Height = collapsedHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
|
@ -107,7 +107,7 @@
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
Margin="0,12,12,12"
|
Margin="0,12,12,12"
|
||||||
ColorChanged="ColorPicker_ColorChanged"
|
ColorChanged="ColorPicker_ColorChanged"
|
||||||
Color="{x:Bind Path=ColorPaletteEntry.ActiveColor, Mode=OneWay}" />
|
Color="{x:Bind Path=ColorPaletteEntry.ActiveColor, Mode=OneWay}"/>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
x:Name="RevertButton"
|
x:Name="RevertButton"
|
||||||
|
|
|
@ -14,7 +14,11 @@ namespace FluentEditorShared.ColorPalette
|
||||||
string Title { get; }
|
string Title { get; }
|
||||||
string Description { get; }
|
string Description { get; }
|
||||||
|
|
||||||
Color ActiveColor { get; set; }
|
Color ActiveColor
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
}
|
||||||
string ActiveColorString { get; }
|
string ActiveColorString { get; }
|
||||||
FluentEditorShared.Utils.ColorStringFormat ActiveColorStringFormat { get; }
|
FluentEditorShared.Utils.ColorStringFormat ActiveColorStringFormat { get; }
|
||||||
|
|
||||||
|
|
|
@ -14,11 +14,15 @@
|
||||||
<SolidColorBrush x:Key="PaletteEditorDividerBrush" Color="#FF424242" />
|
<SolidColorBrush x:Key="PaletteEditorDividerBrush" Color="#FF424242" />
|
||||||
<SolidColorBrush x:Key="PaletteEntryEditorBorderBrush" Color="Transparent" />
|
<SolidColorBrush x:Key="PaletteEntryEditorBorderBrush" Color="Transparent" />
|
||||||
<Thickness x:Key="PaletteEntryEditorBorderThickness">0 0 0 0</Thickness>
|
<Thickness x:Key="PaletteEntryEditorBorderThickness">0 0 0 0</Thickness>
|
||||||
|
|
||||||
|
<AcrylicBrush x:Key="SystemControlAcrylicWindowBrush" BackgroundSource="HostBackdrop" TintColor="{ThemeResource SystemChromeAltHighColor_Dark}" TintOpacity="0.8" FallbackColor="{ThemeResource SystemChromeMediumColor_Dark}" />
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
<ResourceDictionary x:Key="Light">
|
<ResourceDictionary x:Key="Light">
|
||||||
<SolidColorBrush x:Key="PaletteEditorDividerBrush" Color="#FF424242" />
|
<SolidColorBrush x:Key="PaletteEditorDividerBrush" Color="#FF424242" />
|
||||||
<SolidColorBrush x:Key="PaletteEntryEditorBorderBrush" Color="Transparent" />
|
<SolidColorBrush x:Key="PaletteEntryEditorBorderBrush" Color="Transparent" />
|
||||||
<Thickness x:Key="PaletteEntryEditorBorderThickness">0 0 0 0</Thickness>
|
<Thickness x:Key="PaletteEntryEditorBorderThickness">0 0 0 0</Thickness>
|
||||||
|
|
||||||
|
<AcrylicBrush x:Key="SystemControlAcrylicWindowBrush" BackgroundSource="HostBackdrop" TintColor="{ThemeResource SystemChromeAltHighColor}" TintOpacity="0.8" FallbackColor="{ThemeResource SystemChromeMediumColor}" />
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
<ResourceDictionary x:Key="HighContrast">
|
<ResourceDictionary x:Key="HighContrast">
|
||||||
<SolidColorBrush x:Key="PaletteEditorDividerBrush" Color="#FF000000" />
|
<SolidColorBrush x:Key="PaletteEditorDividerBrush" Color="#FF000000" />
|
||||||
|
@ -30,16 +34,25 @@
|
||||||
<local:ColorToStringConverter x:Key="ColorToStringConverter" />
|
<local:ColorToStringConverter x:Key="ColorToStringConverter" />
|
||||||
<local:NullableColorToStringConverter x:Key="NullableColorToStringConverter" />
|
<local:NullableColorToStringConverter x:Key="NullableColorToStringConverter" />
|
||||||
|
|
||||||
|
<Color x:Key="SystemAccentColor">#ff0073CF</Color>
|
||||||
|
<Color x:Key="SystemChromeAltHighColor">#FF32a852</Color>
|
||||||
|
<Color x:Key="SystemChromeMediumColor">#FF32a852</Color>
|
||||||
|
|
||||||
|
<Color x:Key="SystemChromeAltHighColor_Dark">#FF2B2B2B</Color>
|
||||||
|
<Color x:Key="SystemChromeMediumColor_Dark">#FF2B2B2B</Color>
|
||||||
|
|
||||||
|
<AcrylicBrush x:Key="SystemControlAccentAcrylicWindowAccentMediumHighBrush" BackgroundSource="HostBackdrop" TintColor="{ThemeResource SystemAccentColor}" TintOpacity="0.8" FallbackColor="{ThemeResource SystemAccentColor}" />
|
||||||
|
|
||||||
<CornerRadius x:Key="ControlCornerRadius">2</CornerRadius>
|
<CornerRadius x:Key="ControlCornerRadius">2</CornerRadius>
|
||||||
<CornerRadius x:Key="OverlayCornerRadius">4</CornerRadius>
|
<CornerRadius x:Key="OverlayCornerRadius">4</CornerRadius>
|
||||||
|
|
||||||
<Thickness x:Key="ComboBoxBorderThemeThickness">5</Thickness>
|
<Thickness x:Key="ComboBoxBorderThemeThickness">1</Thickness>
|
||||||
<Thickness x:Key="DatePickerBorderThemeThickness">5</Thickness>
|
<Thickness x:Key="DatePickerBorderThemeThickness">1</Thickness>
|
||||||
<Thickness x:Key="TimePickerBorderThemeThickness">5</Thickness>
|
<Thickness x:Key="TimePickerBorderThemeThickness">1</Thickness>
|
||||||
<Thickness x:Key="TextControlBorderThemeThickness">5</Thickness>
|
<Thickness x:Key="TextControlBorderThemeThickness">1</Thickness>
|
||||||
<Thickness x:Key="CheckBoxBorderThemeThickness">5</Thickness>
|
<Thickness x:Key="CheckBoxBorderThemeThickness">1</Thickness>
|
||||||
<Thickness x:Key="ToggleSwitchOuterBorderStrokeThickness">5</Thickness>
|
<Thickness x:Key="ToggleSwitchOuterBorderStrokeThickness">1</Thickness>
|
||||||
<Thickness x:Key="RadioButtonBorderThemeThickness">5</Thickness>
|
<Thickness x:Key="RadioButtonBorderThemeThickness">1</Thickness>
|
||||||
|
|
||||||
<Style x:Key="HitboxButton" TargetType="Button">
|
<Style x:Key="HitboxButton" TargetType="Button">
|
||||||
<Setter Property="Background" Value="Transparent" />
|
<Setter Property="Background" Value="Transparent" />
|
||||||
|
|
Загрузка…
Ссылка в новой задаче