Skip to content

Commit

Permalink
Added Decimal color type in AI Page (#311)
Browse files Browse the repository at this point in the history
  • Loading branch information
lpeyr committed Sep 2, 2023
1 parent 43b073c commit 5c3a37e
Show file tree
Hide file tree
Showing 7 changed files with 102 additions and 0 deletions.
57 changes: 57 additions & 0 deletions ColorPicker/Pages/AiGenPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,63 @@
</Grid>
</Border>

<Border
MinWidth="150"
Margin="5"
Padding="5"
HorizontalAlignment="Left"
Background="{Binding Source={StaticResource CardBackground}}"
CornerRadius="5">
<Border.Effect>
<DropShadowEffect
BlurRadius="15"
Direction="135"
Opacity="0.2"
ShadowDepth="0"
Color="#000" />
</Border.Effect>

<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>

<TextBlock
FontWeight="ExtraBold"
Foreground="{Binding Source={StaticResource DarkGray}}"
Text="{x:Static lang:Resources.DEC}" />
<StackPanel Grid.Row="1" Orientation="Horizontal">
<Button
x:Name="CopyDecBtn"
Grid.Column="2"
Margin="0 3 3 3"
Padding="5"
VerticalAlignment="Top"
Background="{Binding Source={StaticResource Background3}}"
Click="CopyDecBtn_Click"
Content="&#xF32C;"
FontFamily="..\Fonts\#FluentSystemIcons-Regular"
Foreground="{Binding Source={StaticResource Foreground1}}"
Style="{DynamicResource DefaultButton}">
<Button.ToolTip>
<ToolTip
Background="{Binding Source={StaticResource Background1}}"
Content="{x:Static lang:Resources.CopyDEC}"
Foreground="{Binding Source={StaticResource Foreground1}}" />
</Button.ToolTip>
</Button>

<TextBlock
x:Name="DecTxt"
VerticalAlignment="Center"
FontSize="18"
FontWeight="ExtraBold"
Text="N/A" />
</StackPanel>
</Grid>
</Border>

<Border
MinWidth="150"
Margin="5"
Expand Down
6 changes: 6 additions & 0 deletions ColorPicker/Pages/AiGenPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ internal void LoadDetails()
XyzTxt.Text = $"{ColorInfo.XYZ.X:0.00}..; {ColorInfo.XYZ.Y:0.00}..; {ColorInfo.XYZ.Z:0.00}..";
YiqTxt.Text = $"{ColorInfo.YIQ.Y:0.00}..; {ColorInfo.YIQ.I:0.00}..; {ColorInfo.YIQ.Q:0.00}..";
YuvTxt.Text = $"{ColorInfo.YUV.Y:0.00}..; {ColorInfo.YUV.U:0.00}..; {ColorInfo.YUV.V:0.00}..";
DecTxt.Text = ColorInfo.DEC.Value.ToString();
}

private void LoadBorders(string[] colors)
Expand Down Expand Up @@ -267,4 +268,9 @@ private void ApiApplyBtn_Click(object sender, RoutedEventArgs e)
XmlSerializerManager.SaveToXml(Global.Settings, Global.SettingsPath);
InitUI();
}

private void CopyDecBtn_Click(object sender, RoutedEventArgs e)
{
Clipboard.SetText(DecTxt.Text);
}
}
27 changes: 27 additions & 0 deletions ColorPicker/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions ColorPicker/Properties/Resources.en-US.resx
Original file line number Diff line number Diff line change
Expand Up @@ -594,4 +594,7 @@
<data name="DEC" xml:space="preserve">
<value>DEC</value>
</data>
<data name="CopyDEC" xml:space="preserve">
<value>Copy Decimal</value>
</data>
</root>
3 changes: 3 additions & 0 deletions ColorPicker/Properties/Resources.fr-FR.resx
Original file line number Diff line number Diff line change
Expand Up @@ -598,4 +598,7 @@
<data name="DEC" xml:space="preserve">
<value>DEC</value>
</data>
<data name="CopyDEC" xml:space="preserve">
<value>Copier en Décimal</value>
</data>
</root>
3 changes: 3 additions & 0 deletions ColorPicker/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -574,4 +574,7 @@
<data name="DEC" xml:space="preserve">
<value>DEC</value>
</data>
<data name="CopyDEC" xml:space="preserve">
<value>Copy Decimal</value>
</data>
</root>
3 changes: 3 additions & 0 deletions ColorPicker/Properties/Resources.zh-CN.resx
Original file line number Diff line number Diff line change
Expand Up @@ -602,4 +602,7 @@
<data name="DEC" xml:space="preserve">
<value>DEC</value>
</data>
<data name="CopyDEC" xml:space="preserve">
<value>复制十进制</value>
</data>
</root>

0 comments on commit 5c3a37e

Please sign in to comment.