feat: classic background.

This commit is contained in:
huanghongxun 2021-09-20 03:09:55 +08:00
parent ca3bc69a61
commit cfe801f280
2 changed files with 5 additions and 2 deletions

View File

@ -139,7 +139,9 @@ public class DecoratorController {
.orElse(null); .orElse(null);
} }
if (config().getBackgroundImageType() == EnumBackgroundImage.NETWORK) { if (config().getBackgroundImageType() == EnumBackgroundImage.NETWORK) {
image = new Image(config().getBackgroundImageUrl(), true);
} else if (config().getBackgroundImageType() == EnumBackgroundImage.CLASSIC) {
image = newImage("/assets/img/background-classic.jpg");
} }
if (image == null) { if (image == null) {
image = loadDefaultBackgroundImage(); image = loadDefaultBackgroundImage();
@ -147,7 +149,8 @@ public class DecoratorController {
return new Background(new BackgroundImage(image, BackgroundRepeat.NO_REPEAT, BackgroundRepeat.NO_REPEAT, BackgroundPosition.DEFAULT, new BackgroundSize(800, 480, false, false, true, true))); return new Background(new BackgroundImage(image, BackgroundRepeat.NO_REPEAT, BackgroundRepeat.NO_REPEAT, BackgroundPosition.DEFAULT, new BackgroundSize(800, 480, false, false, true, true)));
}, },
config().backgroundImageTypeProperty(), config().backgroundImageTypeProperty(),
config().backgroundImageProperty())); config().backgroundImageProperty(),
config().backgroundImageUrlProperty()));
} }
private Image defaultBackground = newImage("/assets/img/background.jpg"); private Image defaultBackground = newImage("/assets/img/background.jpg");

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB