fix: GameItem always show empty tag
This commit is contained in:
@@ -25,6 +25,7 @@ import javafx.scene.layout.HBox;
|
|||||||
import javafx.scene.layout.StackPane;
|
import javafx.scene.layout.StackPane;
|
||||||
import org.jackhuang.hmcl.ui.FXUtils;
|
import org.jackhuang.hmcl.ui.FXUtils;
|
||||||
import org.jackhuang.hmcl.ui.construct.TwoLineListItem;
|
import org.jackhuang.hmcl.ui.construct.TwoLineListItem;
|
||||||
|
import org.jackhuang.hmcl.util.StringUtils;
|
||||||
|
|
||||||
public class GameItemSkin extends SkinBase<GameItem> {
|
public class GameItemSkin extends SkinBase<GameItem> {
|
||||||
public GameItemSkin(GameItem skinnable) {
|
public GameItemSkin(GameItem skinnable) {
|
||||||
@@ -46,7 +47,11 @@ public class GameItemSkin extends SkinBase<GameItem> {
|
|||||||
TwoLineListItem item = new TwoLineListItem();
|
TwoLineListItem item = new TwoLineListItem();
|
||||||
item.titleProperty().bind(skinnable.titleProperty());
|
item.titleProperty().bind(skinnable.titleProperty());
|
||||||
FXUtils.onChangeAndOperate(skinnable.tagProperty(), tag -> {
|
FXUtils.onChangeAndOperate(skinnable.tagProperty(), tag -> {
|
||||||
item.getTags().setAll(tag);
|
if (StringUtils.isNotBlank(tag)) {
|
||||||
|
item.getTags().setAll(tag);
|
||||||
|
} else {
|
||||||
|
item.getTags().clear();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
item.subtitleProperty().bind(skinnable.subtitleProperty());
|
item.subtitleProperty().bind(skinnable.subtitleProperty());
|
||||||
BorderPane.setAlignment(item, Pos.CENTER);
|
BorderPane.setAlignment(item, Pos.CENTER);
|
||||||
|
|||||||
@@ -394,10 +394,10 @@
|
|||||||
-fx-background-color: -fx-base-color;
|
-fx-background-color: -fx-base-color;
|
||||||
}
|
}
|
||||||
|
|
||||||
.jfx-tool-bar HBox {
|
/*.jfx-tool-bar HBox {*/
|
||||||
-fx-alignment: center-left;
|
/* -fx-alignment: center-left;*/
|
||||||
-fx-padding: 0.0 5.0;
|
/* -fx-padding: 0.0 5.0;*/
|
||||||
}
|
/*}*/
|
||||||
|
|
||||||
.jfx-tool-bar .jfx-decorator-button {
|
.jfx-tool-bar .jfx-decorator-button {
|
||||||
-fx-min-width: 40px;
|
-fx-min-width: 40px;
|
||||||
@@ -1157,126 +1157,6 @@
|
|||||||
-fx-background-color: rgb(255, 255, 255);
|
-fx-background-color: rgb(255, 255, 255);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* *
|
|
||||||
* Tree Table View *
|
|
||||||
* *
|
|
||||||
*******************************************************************************/
|
|
||||||
|
|
||||||
.no-header .column-header-background {
|
|
||||||
-fx-max-height: 0;
|
|
||||||
-fx-pref-height: 0;
|
|
||||||
-fx-min-height: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tree-table-view {
|
|
||||||
-fx-tree-table-color: rgba(82, 100, 174, 0.4);
|
|
||||||
-fx-tree-table-rippler-color: rgba(82, 100, 174, 0.6);
|
|
||||||
}
|
|
||||||
|
|
||||||
.tree-table-view:focused .tree-table-row-cell:selected {
|
|
||||||
-fx-background-color: -fx-tree-table-color;
|
|
||||||
-fx-table-cell-border-color: -fx-tree-table-color;
|
|
||||||
-fx-text-fill: BLACK;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tree-table-view:focused .tree-table-row-cell:selected .tree-table-cell {
|
|
||||||
-fx-text-fill: BLACK;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tree-table-view .jfx-rippler {
|
|
||||||
-jfx-rippler-fill: -fx-tree-table-rippler-color;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tree-table-view .column-header,
|
|
||||||
.tree-table-view .column-header-background,
|
|
||||||
.tree-table-view .column-header-background .filler {
|
|
||||||
-fx-background-color: TRANSPARENT;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tree-table-view .column-header {
|
|
||||||
-fx-border-width: 0 1 0 1;
|
|
||||||
-fx-border-color: #F3F3F3;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tree-table-view .column-header .label {
|
|
||||||
-fx-text-fill: #949494;
|
|
||||||
-fx-padding: 8 0 8 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tree-table-view .column-header .arrow, .tree-table-view .column-header .sort-order-dot {
|
|
||||||
-fx-background-color: #949494;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tree-table-view .column-header:last-visible {
|
|
||||||
-fx-border-width: 0 2 0 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tree-table-view .column-header-background {
|
|
||||||
-fx-border-width: 0 0.0 1 0;
|
|
||||||
-fx-border-color: #F3F3F3;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tree-table-view .tree-table-cell {
|
|
||||||
-fx-border-width: 0 0 0 0;
|
|
||||||
-fx-padding: 0 0 0 0;
|
|
||||||
/*-fx-alignment: top-center;*/
|
|
||||||
}
|
|
||||||
|
|
||||||
.tree-table-view .column-overlay {
|
|
||||||
-fx-background-color: -fx-tree-table-color;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tree-table-view .column-resize-line, .tree-table-view .column-drag-header {
|
|
||||||
-fx-background-color: -fx-tree-table-rippler-color;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tree-table-view:focused {
|
|
||||||
-fx-background-color: -fx-tree-table-color, -fx-box-border, -fx-control-inner-background;
|
|
||||||
-fx-background-insets: -1.4, 0, 1;
|
|
||||||
-fx-background-radius: 1.4, 0, 0;
|
|
||||||
/*....*/
|
|
||||||
-fx-padding: 1; /* 0.083333em; */
|
|
||||||
}
|
|
||||||
|
|
||||||
.tree-table-row-cell > .tree-disclosure-node > .arrow {
|
|
||||||
-fx-background-color: -fx-text-fill;
|
|
||||||
-fx-padding: 0.333333em 0.229em 0.333333em 0.229em; /* 4 */
|
|
||||||
-fx-shape: "M 0 -3.5 L 4 0 L 0 3.5 z";
|
|
||||||
}
|
|
||||||
|
|
||||||
.tree-table-row-cell .jfx-text-field {
|
|
||||||
-fx-focus-color: rgb(82, 100, 174);
|
|
||||||
}
|
|
||||||
|
|
||||||
.tree-table-row-cell .jfx-text-field:error {
|
|
||||||
-jfx-focus-color: #D34336;
|
|
||||||
-jfx-unfocus-color: #D34336;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tree-table-row-cell .jfx-text-field .error-label {
|
|
||||||
-fx-text-fill: #D34336;
|
|
||||||
-fx-font-size: 0.75em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tree-table-row-cell .jfx-text-field .error-icon {
|
|
||||||
-fx-fill: #D34336;
|
|
||||||
-fx-font-size: 1.0em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tree-table-row-group {
|
|
||||||
-fx-background-color: rgb(230, 230, 230);
|
|
||||||
}
|
|
||||||
|
|
||||||
.tree-table-view .menu-item:focused {
|
|
||||||
-fx-background-color: -fx-tree-table-color;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.tree-table-view .menu-item .label {
|
|
||||||
-fx-padding: 5 0 5 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* *
|
* *
|
||||||
* Scroll Bar *
|
* Scroll Bar *
|
||||||
|
|||||||
Reference in New Issue
Block a user