mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-24 03:33:46 -04:00
解决日志页面选中条目,hover背景闪烁两次的问题
This commit is contained in:
parent
8ecdb8b0e1
commit
634f296b83
@ -40,6 +40,7 @@ import javafx.stage.Stage;
|
|||||||
import org.jackhuang.hmcl.game.GameDumpGenerator;
|
import org.jackhuang.hmcl.game.GameDumpGenerator;
|
||||||
import org.jackhuang.hmcl.game.Log;
|
import org.jackhuang.hmcl.game.Log;
|
||||||
import org.jackhuang.hmcl.setting.StyleSheets;
|
import org.jackhuang.hmcl.setting.StyleSheets;
|
||||||
|
import org.jackhuang.hmcl.ui.construct.NoneMultipleSelectionModel;
|
||||||
import org.jackhuang.hmcl.ui.construct.SpinnerPane;
|
import org.jackhuang.hmcl.ui.construct.SpinnerPane;
|
||||||
import org.jackhuang.hmcl.util.Holder;
|
import org.jackhuang.hmcl.util.Holder;
|
||||||
import org.jackhuang.hmcl.util.CircularArrayList;
|
import org.jackhuang.hmcl.util.CircularArrayList;
|
||||||
@ -311,6 +312,7 @@ public final class LogWindow extends Stage {
|
|||||||
Holder<Object> lastCell = new Holder<>();
|
Holder<Object> lastCell = new Holder<>();
|
||||||
listView.setCellFactory(x -> new ListCell<Log>() {
|
listView.setCellFactory(x -> new ListCell<Log>() {
|
||||||
{
|
{
|
||||||
|
x.setSelectionModel(new NoneMultipleSelectionModel<>());
|
||||||
getStyleClass().add("log-window-list-cell");
|
getStyleClass().add("log-window-list-cell");
|
||||||
Region clippedContainer = (Region) listView.lookup(".clipped-container");
|
Region clippedContainer = (Region) listView.lookup(".clipped-container");
|
||||||
if (clippedContainer != null) {
|
if (clippedContainer != null) {
|
||||||
@ -364,6 +366,7 @@ public final class LogWindow extends Stage {
|
|||||||
pseudoClassStateChanged(INFO, !empty && item.getLevel() == Log4jLevel.INFO);
|
pseudoClassStateChanged(INFO, !empty && item.getLevel() == Log4jLevel.INFO);
|
||||||
pseudoClassStateChanged(DEBUG, !empty && item.getLevel() == Log4jLevel.DEBUG);
|
pseudoClassStateChanged(DEBUG, !empty && item.getLevel() == Log4jLevel.DEBUG);
|
||||||
pseudoClassStateChanged(TRACE, !empty && item.getLevel() == Log4jLevel.TRACE);
|
pseudoClassStateChanged(TRACE, !empty && item.getLevel() == Log4jLevel.TRACE);
|
||||||
|
pseudoClassStateChanged(SELECTED, !empty && item.isSelected());
|
||||||
|
|
||||||
if (empty) {
|
if (empty) {
|
||||||
setText(null);
|
setText(null);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user