feat(GlobalConfig): 添加抖音和美团平台的Logo图片资源在GlobalConfig类中新增了dyLogo和mtLogo两个Image类型的静态常量,用于存储抖音和美团平台的Logo图片资源,并在静态代码块中进行初始化。同时更新了PlatformSelectionView页面中的平台选项图片引用方式,
将原先使用的占位图URL替换为从GlobalConfig加载的实际Logo图片,并相应地修改了createPlatformMtOption与createPlatformDyOption方法签名, 使其接收Image对象而非字符串URL。
This commit is contained in:
@@ -57,11 +57,15 @@ public class GlobalConfig {
|
||||
|
||||
public static final Image icon16;
|
||||
public static final Image icon32;
|
||||
public static final Image dyLogo;
|
||||
public static final Image mtLogo;
|
||||
|
||||
static {
|
||||
try {
|
||||
icon16 = new Image(new FileInputStream(ResourceUtils.getFile("classpath:icon16.png")));
|
||||
icon32 = new Image(new FileInputStream(ResourceUtils.getFile("classpath:icon32.png")));
|
||||
dyLogo = new Image(new FileInputStream(ResourceUtils.getFile("classpath:dylogo.png")));
|
||||
mtLogo = new Image(new FileInputStream(ResourceUtils.getFile("classpath:mtlogo.png")));
|
||||
} catch (FileNotFoundException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
@@ -50,14 +50,14 @@ public class PlatformSelectionView {
|
||||
// 美团开店宝选项
|
||||
VBox meituanOption = createPlatformMtOption(
|
||||
"美团开店宝",
|
||||
"https://placehold.co/64x64?text=MT&bg=FFD700&fg=333",
|
||||
GlobalConfig.mtLogo,
|
||||
"#FFD700"
|
||||
);
|
||||
|
||||
// 抖音来客选项
|
||||
VBox douyinOption = createPlatformDyOption(
|
||||
"抖音来客",
|
||||
"https://placehold.co/64x64?text=DY&bg=4A90E2&fg=FFF",
|
||||
GlobalConfig.dyLogo,
|
||||
"#4A90E2"
|
||||
);
|
||||
|
||||
@@ -72,14 +72,14 @@ public class PlatformSelectionView {
|
||||
primaryStage.show();
|
||||
}
|
||||
|
||||
private VBox createPlatformMtOption(String title, String imageUrl, String buttonColor) {
|
||||
private VBox createPlatformMtOption(String title, Image imageUrl, String buttonColor) {
|
||||
VBox option = new VBox();
|
||||
option.setAlignment(Pos.CENTER);
|
||||
option.setSpacing(10);
|
||||
option.setPadding(new Insets(20));
|
||||
option.setStyle("-fx-background-color: white; -fx-border-radius: 8px; -fx-padding: 20px;");
|
||||
|
||||
ImageView imageView = new ImageView(new Image(imageUrl));
|
||||
ImageView imageView = new ImageView(imageUrl);
|
||||
imageView.setFitWidth(64);
|
||||
imageView.setFitHeight(64);
|
||||
|
||||
@@ -102,14 +102,14 @@ public class PlatformSelectionView {
|
||||
return option;
|
||||
}
|
||||
|
||||
private VBox createPlatformDyOption(String title, String imageUrl, String buttonColor) {
|
||||
private VBox createPlatformDyOption(String title, Image imageUrl, String buttonColor) {
|
||||
VBox option = new VBox();
|
||||
option.setAlignment(Pos.CENTER);
|
||||
option.setSpacing(10);
|
||||
option.setPadding(new Insets(20));
|
||||
option.setStyle("-fx-background-color: white; -fx-border-radius: 8px; -fx-padding: 20px;");
|
||||
|
||||
ImageView imageView = new ImageView(new Image(imageUrl));
|
||||
ImageView imageView = new ImageView(imageUrl);
|
||||
imageView.setFitWidth(64);
|
||||
imageView.setFitHeight(64);
|
||||
|
||||
|
||||
BIN
src/main/resources/dylogo.png
Normal file
BIN
src/main/resources/dylogo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
BIN
src/main/resources/mtlogo.png
Normal file
BIN
src/main/resources/mtlogo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.6 KiB |
Reference in New Issue
Block a user