fix: fix course color pick
This commit is contained in:
@ -25,7 +25,7 @@
|
||||
<TextBox Text="{Binding Name, Mode=TwoWay}" Width="200" HorizontalAlignment="Left" Padding="5" Margin="0,5,0,0"/>
|
||||
|
||||
<TextBlock Text="课程颜色" FontWeight="Bold" Padding="5" Margin="0,10,0,0"/>
|
||||
<Border ToolTip="单击改变颜色" Width="200" HorizontalAlignment="Left" BorderBrush="Black" BorderThickness="1" Cursor="Hand" Margin="0,5,0,0">
|
||||
<Border x:Name="uiColorPicker" ToolTip="左键单击改变背景色,右键单击改变前景色" Width="200" HorizontalAlignment="Left" BorderBrush="Black" BorderThickness="1" Cursor="Hand" Margin="0,5,0,0" MouseLeftButtonDown="uiColorPicker_MouseLeftButtonDown" MouseRightButtonDown="uiColorPicker_MouseRightButtonDown">
|
||||
<Border.Background>
|
||||
<SolidColorBrush Color="{Binding Color.Background, Mode=TwoWay}"/>
|
||||
</Border.Background>
|
||||
|
@ -85,6 +85,17 @@ namespace HFUTCourseSimulation.Dialog {
|
||||
CurrentCourse.Schedules.Clear();
|
||||
}
|
||||
|
||||
private void uiColorPicker_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) {
|
||||
var color = Util.Win32Dialog.PickColor();
|
||||
if (color is null) return;
|
||||
else CurrentCourse.Color.Background = color.Value;
|
||||
}
|
||||
|
||||
private void uiColorPicker_MouseRightButtonDown(object sender, MouseButtonEventArgs e) {
|
||||
var color = Util.Win32Dialog.PickColor();
|
||||
if (color is null) return;
|
||||
else CurrentCourse.Color.Foreground = color.Value;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -23,7 +23,7 @@
|
||||
</MenuItem>
|
||||
<Separator/>
|
||||
<MenuItem x:Name="uiMenuSave" Header="保存" Click="uiMenuSave_Click"/>
|
||||
<MenuItem x:Name="uiMenuSaveAs" Header="另存为" Click="uiMenuSave_Click"/>
|
||||
<MenuItem x:Name="uiMenuSaveAs" Header="另存为" Click="uiMenuSaveAs_Click"/>
|
||||
<Separator/>
|
||||
<MenuItem x:Name="uiMenuClose" Header="关闭" Click="uiMenuClose_Click"/>
|
||||
<MenuItem x:Name="uiMenuQuit" Header="退出" Click="uiMenuQuit_Click"/>
|
||||
|
Reference in New Issue
Block a user