fix book hgight
Browse files- src/WpfEditor/MainWindow.xaml.cs +29 -11
src/WpfEditor/MainWindow.xaml.cs
CHANGED
|
@@ -1084,13 +1084,7 @@ namespace WpfEditor
|
|
| 1084 |
"《红楼梦》- 曹雪芹",
|
| 1085 |
"《西游记》- 吴承恩",
|
| 1086 |
"《水浒传》- 施耐庵",
|
| 1087 |
-
"《三国演义》- 罗贯中"
|
| 1088 |
-
"《围城》- 钱钟书",
|
| 1089 |
-
"《活着》- 余华",
|
| 1090 |
-
"《平凡的世界》- 路遥",
|
| 1091 |
-
"《白夜行》- 东野圭吾",
|
| 1092 |
-
"《解忧杂货店》- 东野圭吾",
|
| 1093 |
-
"《百年孤独》- 加西亚·马尔克斯"
|
| 1094 |
};
|
| 1095 |
|
| 1096 |
// 初始化书籍列表
|
|
@@ -1186,7 +1180,7 @@ namespace WpfEditor
|
|
| 1186 |
{
|
| 1187 |
Title = "添加书籍",
|
| 1188 |
Width = 300,
|
| 1189 |
-
Height =
|
| 1190 |
WindowStartupLocation = WindowStartupLocation.CenterOwner,
|
| 1191 |
Owner = bookManagementWindow,
|
| 1192 |
ResizeMode = ResizeMode.NoResize
|
|
@@ -1195,10 +1189,30 @@ namespace WpfEditor
|
|
| 1195 |
var inputPanel = new StackPanel { Margin = new Thickness(20) };
|
| 1196 |
var inputLabel = new TextBlock { Text = "请输入书籍名称:", Margin = new Thickness(0, 0, 0, 10) };
|
| 1197 |
var inputTextBox = new TextBox { Height = 25, Margin = new Thickness(0, 0, 0, 15) };
|
| 1198 |
-
var inputButtonPanel = new StackPanel {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1199 |
|
| 1200 |
-
var confirmButton = new Button {
|
| 1201 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1202 |
|
| 1203 |
confirmButton.Click += (ss, ee) =>
|
| 1204 |
{
|
|
@@ -1209,6 +1223,10 @@ namespace WpfEditor
|
|
| 1209 |
bookListBox.Items.Add(newBook);
|
| 1210 |
inputDialog.Close();
|
| 1211 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1212 |
};
|
| 1213 |
cancelButton.Click += (ss, ee) => inputDialog.Close();
|
| 1214 |
|
|
|
|
| 1084 |
"《红楼梦》- 曹雪芹",
|
| 1085 |
"《西游记》- 吴承恩",
|
| 1086 |
"《水浒传》- 施耐庵",
|
| 1087 |
+
"《三国演义》- 罗贯中"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1088 |
};
|
| 1089 |
|
| 1090 |
// 初始化书籍列表
|
|
|
|
| 1180 |
{
|
| 1181 |
Title = "添加书籍",
|
| 1182 |
Width = 300,
|
| 1183 |
+
Height = 180, // 增加高度以确保按钮显示
|
| 1184 |
WindowStartupLocation = WindowStartupLocation.CenterOwner,
|
| 1185 |
Owner = bookManagementWindow,
|
| 1186 |
ResizeMode = ResizeMode.NoResize
|
|
|
|
| 1189 |
var inputPanel = new StackPanel { Margin = new Thickness(20) };
|
| 1190 |
var inputLabel = new TextBlock { Text = "请输入书籍名称:", Margin = new Thickness(0, 0, 0, 10) };
|
| 1191 |
var inputTextBox = new TextBox { Height = 25, Margin = new Thickness(0, 0, 0, 15) };
|
| 1192 |
+
var inputButtonPanel = new StackPanel {
|
| 1193 |
+
Orientation = Orientation.Horizontal,
|
| 1194 |
+
HorizontalAlignment = HorizontalAlignment.Center,
|
| 1195 |
+
Margin = new Thickness(0, 10, 0, 0) // 添加上边距
|
| 1196 |
+
};
|
| 1197 |
|
| 1198 |
+
var confirmButton = new Button {
|
| 1199 |
+
Content = "确定",
|
| 1200 |
+
Width = 60,
|
| 1201 |
+
Height = 25,
|
| 1202 |
+
Margin = new Thickness(5),
|
| 1203 |
+
Background = new SolidColorBrush(System.Windows.Media.Color.FromRgb(0x4C, 0xAF, 0x50)),
|
| 1204 |
+
//Foreground = Brushes.White,
|
| 1205 |
+
BorderThickness = new Thickness(0)
|
| 1206 |
+
};
|
| 1207 |
+
var cancelButton = new Button {
|
| 1208 |
+
Content = "取消",
|
| 1209 |
+
Width = 60,
|
| 1210 |
+
Height = 25,
|
| 1211 |
+
Margin = new Thickness(5),
|
| 1212 |
+
Background = new SolidColorBrush(System.Windows.Media.Color.FromRgb(0x95, 0x95, 0x95)),
|
| 1213 |
+
//Foreground = Brushes.White,
|
| 1214 |
+
BorderThickness = new Thickness(0)
|
| 1215 |
+
};
|
| 1216 |
|
| 1217 |
confirmButton.Click += (ss, ee) =>
|
| 1218 |
{
|
|
|
|
| 1223 |
bookListBox.Items.Add(newBook);
|
| 1224 |
inputDialog.Close();
|
| 1225 |
}
|
| 1226 |
+
else
|
| 1227 |
+
{
|
| 1228 |
+
MessageBox.Show("请输入书籍名称", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
|
| 1229 |
+
}
|
| 1230 |
};
|
| 1231 |
cancelButton.Click += (ss, ee) => inputDialog.Close();
|
| 1232 |
|