Fixed darker color of title bar

This commit is contained in:
huangyuhui
2018-02-14 00:34:50 +08:00
parent f850c2461a
commit a237ca799f
2 changed files with 8 additions and 0 deletions

View File

@@ -24,6 +24,7 @@ import com.jfoenix.controls.JFXHamburger;
import com.jfoenix.effects.JFXDepthManager; import com.jfoenix.effects.JFXDepthManager;
import com.jfoenix.svg.SVGGlyph; import com.jfoenix.svg.SVGGlyph;
import javafx.application.Platform; import javafx.application.Platform;
import javafx.beans.binding.Bindings;
import javafx.beans.property.BooleanProperty; import javafx.beans.property.BooleanProperty;
import javafx.beans.property.ObjectProperty; import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleBooleanProperty; import javafx.beans.property.SimpleBooleanProperty;
@@ -41,6 +42,7 @@ import javafx.scene.image.Image;
import javafx.scene.input.MouseEvent; import javafx.scene.input.MouseEvent;
import javafx.scene.layout.*; import javafx.scene.layout.*;
import javafx.scene.paint.Color; import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.stage.Screen; import javafx.stage.Screen;
import javafx.stage.Stage; import javafx.stage.Stage;
import javafx.stage.StageStyle; import javafx.stage.StageStyle;
@@ -171,6 +173,10 @@ public final class Decorator extends StackPane implements TaskExecutorDialogWiza
titleContainer.addEventHandler(MouseEvent.MOUSE_EXITED, e -> { titleContainer.addEventHandler(MouseEvent.MOUSE_EXITED, e -> {
if (!isDragging) allowMove = false; if (!isDragging) allowMove = false;
}); });
Rectangle rectangle = new Rectangle(0, 0, 0, 0);
rectangle.widthProperty().bind(titleContainer.widthProperty());
rectangle.heightProperty().bind(Bindings.createDoubleBinding(() -> titleContainer.getHeight() + 100, titleContainer.heightProperty()));
titleContainer.setClip(rectangle);
animationHandler = new TransitionHandler(contentPlaceHolder); animationHandler = new TransitionHandler(contentPlaceHolder);

View File

@@ -139,6 +139,7 @@ public final class SettingsPage extends StackPane implements DecoratorPage {
FXUtils.installTooltip(btnUpdate, 0, 5000, 0, new Tooltip(Main.i18n("update.tooltip"))); FXUtils.installTooltip(btnUpdate, 0, 5000, 0, new Tooltip(Main.i18n("update.tooltip")));
checkUpdate(); checkUpdate();
// background
backgroundItem.loadChildren(Collections.singletonList( backgroundItem.loadChildren(Collections.singletonList(
backgroundItem.createChildren(Main.i18n("launcher.background.default"), EnumBackgroundImage.DEFAULT) backgroundItem.createChildren(Main.i18n("launcher.background.default"), EnumBackgroundImage.DEFAULT)
)); ));
@@ -156,6 +157,7 @@ public final class SettingsPage extends StackPane implements DecoratorPage {
Settings.INSTANCE.setBackgroundImageType((EnumBackgroundImage) newValue.getUserData()); Settings.INSTANCE.setBackgroundImageType((EnumBackgroundImage) newValue.getUserData());
}); });
// theme
themeItem.loadChildren(Arrays.asList( themeItem.loadChildren(Arrays.asList(
themeItem.createChildren(Main.i18n("color.blue"), Theme.BLUE), themeItem.createChildren(Main.i18n("color.blue"), Theme.BLUE),
themeItem.createChildren(Main.i18n("color.dark_blue"), Theme.DARK_BLUE), themeItem.createChildren(Main.i18n("color.dark_blue"), Theme.DARK_BLUE),