Skip to content

Commit

Permalink
Added placeholder in AI Page color section (#352)
Browse files Browse the repository at this point in the history
  • Loading branch information
lpeyr committed Dec 10, 2023
1 parent 623be95 commit bd2404b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 7 deletions.
29 changes: 22 additions & 7 deletions ColorPicker/Pages/AiGenPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
Grid.Row="2"
HorizontalAlignment="Center"
VerticalAlignment="Center"
d:Visibility="Visible"
Visibility="Collapsed">
<Border
x:Name="ColorBorder"
Expand All @@ -143,9 +144,20 @@
Margin="10"
VerticalAlignment="Center"
d:Background="#ff0000"
CornerRadius="50" />

<StackPanel Orientation="Horizontal">
CornerRadius="50"
Visibility="Collapsed" />
<StackPanel
x:Name="EmptyPlaceholder"
Grid.Row="2"
Margin="10">
<TextBlock
HorizontalAlignment="Center"
FontFamily="..\Fonts\#FluentSystemIcons-Regular"
FontSize="32"
Text="&#xF2F6;" />
<TextBlock HorizontalAlignment="Center" Text="{x:Static lang:Resources.EmptyAiPlaceholder}" />
</StackPanel>
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
<Border
Width="250"
HorizontalAlignment="Center"
Expand Down Expand Up @@ -360,7 +372,8 @@
<StackPanel
x:Name="ApiPlaceholder"
Grid.Row="2"
VerticalAlignment="Center">
VerticalAlignment="Center"
d:Visibility="Collapsed">
<TextBlock
HorizontalAlignment="Center"
FontFamily="..\Fonts\#FluentSystemIcons-Regular"
Expand Down Expand Up @@ -423,11 +436,12 @@
</Button>
</StackPanel>
</StackPanel>

<StackPanel
x:Name="DetailsHeader"
Grid.Row="3"
Margin="10"
Orientation="Horizontal">
Orientation="Horizontal"
Visibility="Collapsed">
<TextBlock
VerticalAlignment="Center"
FontFamily="../Fonts/#FluentSystemIcons-Regular"
Expand All @@ -446,7 +460,8 @@
x:Name="DetailsWrap"
Grid.Row="4"
Margin="0 0 0 20"
Orientation="Horizontal">
Orientation="Horizontal"
Visibility="Collapsed">
<Border
MinWidth="150"
Margin="5"
Expand Down
5 changes: 5 additions & 0 deletions ColorPicker/Pages/AiGenPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ internal void LoadDetails()
{
ColorBorder.Background = new SolidColorBrush { Color = Color.FromRgb(ColorInfo.RGB.R, ColorInfo.RGB.G, ColorInfo.RGB.B) };
ColorBorder.Effect = new DropShadowEffect() { BlurRadius = 15, ShadowDepth = 0, Color = Color.FromRgb(ColorInfo.RGB.R, ColorInfo.RGB.G, ColorInfo.RGB.B) };
ColorBorder.Visibility = Visibility.Visible;
EmptyPlaceholder.Visibility = Visibility.Collapsed;

// Load the details section
RgbTxt.Text = $"{ColorInfo.RGB.R}; {ColorInfo.RGB.G}; {ColorInfo.RGB.B}";
Expand All @@ -85,6 +87,9 @@ internal void LoadDetails()
// Load the bookmark icon
BookmarkBtn.Content = Global.Bookmarks.ColorBookmarks.Contains(ColorInfo.HEX.Value) ? "\uF1F8" : "\uF1F6";
BookmarkBtn.Visibility = Visibility.Visible;

DetailsHeader.Visibility = Visibility.Visible;
DetailsWrap.Visibility = Visibility.Visible;
}

private void LoadBorders(string[] colors)
Expand Down

0 comments on commit bd2404b

Please sign in to comment.