Add warning Style

This commit is contained in:
DB p 2024-04-20 05:45:29 +09:00
parent 8e6c06d87c
commit e1defb55bd
5 changed files with 51 additions and 16 deletions

View file

@ -19,7 +19,7 @@
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
<RowDefinition Height="100" />
<RowDefinition Height="80" />
</Grid.RowDefinitions>
@ -49,7 +49,8 @@
Grid.Column="0"
Grid.ColumnSpan="2"
Width="450"
Height="250"
Height="100"
Margin="0,100,0,0"
Padding="26,12,26,0">
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<ItemsControl ItemsSource="{Binding KeysToDisplay}">
@ -86,14 +87,38 @@
<!-- Action buttons to the right of the title and keys -->
<Border Grid.Row="1">
<StackPanel>
<TextBlock
x:Name="tbMsg"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="14"
FontWeight="SemiBold" />
</StackPanel>
<Border
x:Name="Alert"
Width="420"
Height="50"
HorizontalAlignment="Center"
Background="{DynamicResource InfoBarWarningBG}"
BorderBrush="{DynamicResource InfoBarBD}"
BorderThickness="1"
CornerRadius="5"
Visibility="Collapsed">
<Grid VerticalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<ui:FontIcon
FontSize="13"
Foreground="{DynamicResource InfoBarWarningIcon}"
Glyph="&#xeb90;" />
<TextBlock
x:Name="tbMsg"
Grid.Column="1"
HorizontalAlignment="Left"
VerticalAlignment="Top"
FontSize="14"
FontWeight="SemiBold"
Foreground="{DynamicResource PopupTextColor}"
TextWrapping="Wrap" />
</Grid>
</Border>
</Border>
<!-- Action buttons at the bottom of the dialog -->
@ -110,6 +135,7 @@
HorizontalAlignment="Center"
Orientation="Horizontal">
<Button
x:Name="SaveBtn"
Height="30"
MinWidth="100"
Margin="0,0,4,0"

View file

@ -102,12 +102,14 @@ public partial class HotkeyControl2Dialog : ContentDialog
if (!CheckHotkeyAvailability(hotkey.Value, true))
{
tbMsg.Text = InternationalizationManager.Instance.GetTranslation("registerHotkeyFailed");
tbMsg.Visibility = Visibility.Visible;
tbMsg.Text = InternationalizationManager.Instance.GetTranslation("hotkeyUnavailable");
Alert.Visibility = Visibility.Visible;
SaveBtn.IsEnabled = false;
}
else
{
tbMsg.Visibility = Visibility.Collapsed;
Alert.Visibility = Visibility.Collapsed;
SaveBtn.IsEnabled = true;
}
}

View file

@ -309,7 +309,7 @@
<system:String x:Key="hotkeyIsNotUnavailable">Hotkey is unavailable, please select a new hotkey</system:String>
<system:String x:Key="invalidPluginHotkey">Invalid plugin hotkey</system:String>
<system:String x:Key="update">Update</system:String>
<system:String x:Key="hotkeyUnavailable">Hotkey Unavailable</system:String>
<system:String x:Key="hotkeyUnavailable">It's unavailable hotkey.</system:String>
<system:String x:Key="hotkeyRegGuide">Press the keys you want to use for this function.</system:String>
<!-- Custom Query Shortcut Dialog -->
@ -320,7 +320,7 @@
<system:String x:Key="duplicateShortcut">Shortcut already exists, please enter a new Shortcut or edit the existing one.</system:String>
<system:String x:Key="emptyShortcut">Shortcut and/or its expansion is empty.</system:String>
<!-- Common Action-->
<!-- Common Action -->
<system:String x:Key="commonSave">Save</system:String>
<system:String x:Key="commonCancel">Cancel</system:String>
<system:String x:Key="commonReset">Reset</system:String>

View file

@ -110,6 +110,10 @@
<SolidColorBrush x:Key="CustomExpanderHover" Color="#323232" />
<!-- Resource for ContentDialog -->
<SolidColorBrush x:Key="ContentDialogOverlayBG" Color="#4D000000" />
<!-- Infobar Warning -->
<SolidColorBrush x:Key="InfoBarWarningIcon" Color="#FCE100" />
<SolidColorBrush x:Key="InfoBarWarningBG" Color="#433519" />
<SolidColorBrush x:Key="InfoBarBD" Color="#19000000" />
<SolidColorBrush x:Key="ButtonOutBorder" Color="Transparent" />
<SolidColorBrush x:Key="ButtonInsideBorder" Color="#3f3f3f" />

View file

@ -101,7 +101,10 @@
<SolidColorBrush x:Key="CustomExpanderHover" Color="#f6f6f6" />
<!-- Resource for ContentDialog -->
<SolidColorBrush x:Key="ContentDialogOverlayBG" Color="#4D000000" />
<!-- Infobar Warning -->
<SolidColorBrush x:Key="InfoBarWarningIcon" Color="#9D5D00" />
<SolidColorBrush x:Key="InfoBarWarningBG" Color="#FFF4CE" />
<SolidColorBrush x:Key="InfoBarBD" Color="#0F000000" />
<SolidColorBrush x:Key="ButtonOutBorder" Color="#e5e5e5" />