alt: make scrollbar in logwindow more obvous

This commit is contained in:
huanghongxun 2020-04-15 13:30:17 +08:00
parent 6ca7a86189
commit 1c865e3d8d
3 changed files with 16 additions and 11 deletions

View File

@ -150,6 +150,8 @@ public final class LogWindow extends Stage {
private JFXComboBox<String> cboLines = new JFXComboBox<>();
LogWindowImpl() {
getStyleClass().add("log-window");
boolean flag = false;
cboLines.getItems().setAll("500", "2000", "5000");
for (String i : cboLines.getItems())
@ -280,7 +282,6 @@ public final class LogWindow extends Stage {
prefWidthProperty().bind(clippedContainer.widthProperty());
}
setPadding(new Insets(2));
getStyleClass().add("log");
setWrapText(true);
setGraphic(null);
}

View File

@ -146,13 +146,13 @@ public class FloatScrollBarSkin implements Skin<ScrollBar> {
if (scrollBar.getOrientation() == Orientation.HORIZONTAL) {
thumb.relocate(0, -5);
thumb.widthProperty().bind(Bindings.max(5, scrollBar.visibleAmountProperty().divide(range).multiply(scrollBar.widthProperty())));
thumb.widthProperty().bind(Bindings.max(20, scrollBar.visibleAmountProperty().divide(range).multiply(scrollBar.widthProperty())));
thumb.setHeight(5);
thumb.xProperty().bind(Bindings.subtract(scrollBar.widthProperty(), thumb.widthProperty()).multiply(position));
} else {
thumb.relocate(-5, 0);
thumb.setWidth(5);
thumb.heightProperty().bind(Bindings.max(5, scrollBar.visibleAmountProperty().divide(range).multiply(scrollBar.heightProperty())));
thumb.heightProperty().bind(Bindings.max(20, scrollBar.visibleAmountProperty().divide(range).multiply(scrollBar.heightProperty())));
thumb.yProperty().bind(Bindings.subtract(scrollBar.heightProperty(), thumb.heightProperty()).multiply(position));
}
}

View File

@ -951,37 +951,41 @@
-fx-text-fill: gray;
}
.log {
.log-window .scroll-bar .thumb {
-fx-fill: rgba(0, 0, 0, 0.5);
}
.log-window .list-cell {
-fx-text-fill: black;
-fx-border-width: 0 0 1 0;
-fx-border-color: #dddddd;
}
.log:empty {
.log-window .list-cell:empty {
-fx-border-width: 0;
}
.log:fatal {
.log-window .list-cell:fatal {
-fx-background-color: #F7A699;
}
.log:error {
.log-window .list-cell:error {
-fx-background-color: #FFCCBB;
}
.log:warn {
.log-window .list-cell:warn {
-fx-background-color: #FFEECC;
}
.log:info {
.log-window .list-cell:info {
-fx-background-color: #FFFFFF;
}
.log:debug {
.log-window .list-cell:debug {
-fx-background-color: #EEE9E0;
}
.log:trace {
.log-window .list-cell:trace {
-fx-background-color: #EEE9E0;
}