mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-19 08:46:09 -04:00
alt: make scrollbar in logwindow more obvous
This commit is contained in:
parent
6ca7a86189
commit
1c865e3d8d
@ -150,6 +150,8 @@ public final class LogWindow extends Stage {
|
|||||||
private JFXComboBox<String> cboLines = new JFXComboBox<>();
|
private JFXComboBox<String> cboLines = new JFXComboBox<>();
|
||||||
|
|
||||||
LogWindowImpl() {
|
LogWindowImpl() {
|
||||||
|
getStyleClass().add("log-window");
|
||||||
|
|
||||||
boolean flag = false;
|
boolean flag = false;
|
||||||
cboLines.getItems().setAll("500", "2000", "5000");
|
cboLines.getItems().setAll("500", "2000", "5000");
|
||||||
for (String i : cboLines.getItems())
|
for (String i : cboLines.getItems())
|
||||||
@ -280,7 +282,6 @@ public final class LogWindow extends Stage {
|
|||||||
prefWidthProperty().bind(clippedContainer.widthProperty());
|
prefWidthProperty().bind(clippedContainer.widthProperty());
|
||||||
}
|
}
|
||||||
setPadding(new Insets(2));
|
setPadding(new Insets(2));
|
||||||
getStyleClass().add("log");
|
|
||||||
setWrapText(true);
|
setWrapText(true);
|
||||||
setGraphic(null);
|
setGraphic(null);
|
||||||
}
|
}
|
||||||
|
@ -146,13 +146,13 @@ public class FloatScrollBarSkin implements Skin<ScrollBar> {
|
|||||||
|
|
||||||
if (scrollBar.getOrientation() == Orientation.HORIZONTAL) {
|
if (scrollBar.getOrientation() == Orientation.HORIZONTAL) {
|
||||||
thumb.relocate(0, -5);
|
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.setHeight(5);
|
||||||
thumb.xProperty().bind(Bindings.subtract(scrollBar.widthProperty(), thumb.widthProperty()).multiply(position));
|
thumb.xProperty().bind(Bindings.subtract(scrollBar.widthProperty(), thumb.widthProperty()).multiply(position));
|
||||||
} else {
|
} else {
|
||||||
thumb.relocate(-5, 0);
|
thumb.relocate(-5, 0);
|
||||||
thumb.setWidth(5);
|
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));
|
thumb.yProperty().bind(Bindings.subtract(scrollBar.heightProperty(), thumb.heightProperty()).multiply(position));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -951,37 +951,41 @@
|
|||||||
-fx-text-fill: gray;
|
-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-text-fill: black;
|
||||||
-fx-border-width: 0 0 1 0;
|
-fx-border-width: 0 0 1 0;
|
||||||
-fx-border-color: #dddddd;
|
-fx-border-color: #dddddd;
|
||||||
}
|
}
|
||||||
|
|
||||||
.log:empty {
|
.log-window .list-cell:empty {
|
||||||
-fx-border-width: 0;
|
-fx-border-width: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.log:fatal {
|
.log-window .list-cell:fatal {
|
||||||
-fx-background-color: #F7A699;
|
-fx-background-color: #F7A699;
|
||||||
}
|
}
|
||||||
|
|
||||||
.log:error {
|
.log-window .list-cell:error {
|
||||||
-fx-background-color: #FFCCBB;
|
-fx-background-color: #FFCCBB;
|
||||||
}
|
}
|
||||||
|
|
||||||
.log:warn {
|
.log-window .list-cell:warn {
|
||||||
-fx-background-color: #FFEECC;
|
-fx-background-color: #FFEECC;
|
||||||
}
|
}
|
||||||
|
|
||||||
.log:info {
|
.log-window .list-cell:info {
|
||||||
-fx-background-color: #FFFFFF;
|
-fx-background-color: #FFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
.log:debug {
|
.log-window .list-cell:debug {
|
||||||
-fx-background-color: #EEE9E0;
|
-fx-background-color: #EEE9E0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.log:trace {
|
.log-window .list-cell:trace {
|
||||||
-fx-background-color: #EEE9E0;
|
-fx-background-color: #EEE9E0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user