fix css var

This commit is contained in:
Timi
2026-06-26 18:00:15 +08:00
parent 0457ffc432
commit 0f8b23be91
22 changed files with 84 additions and 532 deletions
@@ -1,365 +0,0 @@
package com.imyeyu.fx.ui.components;
import com.imyeyu.fx.ui.TimiFXUI;
import javafx.beans.property.*;
import javafx.collections.FXCollections;
import javafx.collections.ListChangeListener;
import javafx.collections.ObservableList;
import javafx.geometry.Pos;
import javafx.scene.control.Control;
import javafx.scene.control.Skin;
import javafx.scene.control.ToggleButton;
import javafx.scene.control.ToggleGroup;
/**
* 分段按钮组组件,使用单选模式组织多个切换按钮
*
* @author 夜雨
* @since 2026-06-25
*/
public class SegmentedButtonGroup extends Control {
/** 根样式 */
public static final String STYLE_CLASS = "segmented-button-group";
/** 按钮容器样式 */
public static final String STYLE_CLASS_BOX = "segmented-button-group-box";
/** 按钮样式 */
public static final String STYLE_CLASS_BUTTON = "segmented-button-group-button";
/** 首按钮样式 */
public static final String STYLE_CLASS_FIRST = "first";
/** 中间按钮样式 */
public static final String STYLE_CLASS_MIDDLE = "middle";
/** 末按钮样式 */
public static final String STYLE_CLASS_LAST = "last";
/** 单按钮样式 */
public static final String STYLE_CLASS_SINGLE = "single";
/** 按钮列表 */
private final ObservableList<ToggleButton> buttons;
/** 按钮组 */
private final ToggleGroup toggleGroup;
/** 当前选中按钮 */
private final ReadOnlyObjectWrapper<ToggleButton> selectedButton;
/** 当前选中下标 */
private final IntegerProperty selectedIndex;
/** 按钮间距 */
private final DoubleProperty spacing;
/** 布局对齐方式 */
private final ObjectProperty<Pos> alignment;
/** true 为允许清空选中 */
private final BooleanProperty allowClearSelection;
/**
* 默认构造器
*/
public SegmentedButtonGroup() {
buttons = FXCollections.observableArrayList();
toggleGroup = new ToggleGroup();
selectedButton = new ReadOnlyObjectWrapper<>();
selectedIndex = new SimpleIntegerProperty(-1);
spacing = new SimpleDoubleProperty();
alignment = new SimpleObjectProperty<>(Pos.CENTER_LEFT);
allowClearSelection = new SimpleBooleanProperty();
getStyleClass().add(STYLE_CLASS);
setFocusTraversable(false);
initSelectionSync();
initButtonsListener();
}
/**
* 初始化选中同步
*/
private void initSelectionSync() {
toggleGroup.selectedToggleProperty().addListener((obs, o, toggle) -> {
if (toggle instanceof ToggleButton button) {
selectedButton.set(button);
selectedIndex.set(buttons.indexOf(button));
return;
}
selectedButton.set(null);
selectedIndex.set(-1);
});
selectedIndex.addListener((obs, o, newIndex) -> {
int index = newIndex == null ? -1 : newIndex.intValue();
if (index < 0) {
if (isAllowClearSelection()) {
toggleGroup.selectToggle(null);
}
return;
}
if (index < buttons.size()) {
toggleGroup.selectToggle(buttons.get(index));
}
});
}
/**
* 初始化按钮监听
*/
private void initButtonsListener() {
buttons.addListener((ListChangeListener<ToggleButton>) change -> {
while (change.next()) {
if (change.wasRemoved()) {
for (ToggleButton button : change.getRemoved()) {
detachButton(button);
}
}
if (change.wasAdded()) {
for (ToggleButton button : change.getAddedSubList()) {
attachButton(button);
}
}
}
syncSelectionState();
});
}
/**
* 挂载按钮到当前组件
*
* @param button 按钮
*/
private void attachButton(ToggleButton button) {
if (button == null) {
throw new IllegalArgumentException("button must not be null");
}
button.setToggleGroup(toggleGroup);
button.addEventFilter(javafx.scene.input.MouseEvent.MOUSE_PRESSED, SegmentedButtonGroupSkin.EVENT_KEEP_SELECTED);
}
/**
* 卸载按钮
*
* @param button 按钮
*/
private void detachButton(ToggleButton button) {
button.removeEventFilter(javafx.scene.input.MouseEvent.MOUSE_PRESSED, SegmentedButtonGroupSkin.EVENT_KEEP_SELECTED);
if (button.getToggleGroup() == toggleGroup) {
button.setToggleGroup(null);
}
}
/**
* 同步当前选中状态
*/
private void syncSelectionState() {
ToggleButton currentSelectedButton = getSelectedButton();
if (currentSelectedButton != null && !buttons.contains(currentSelectedButton)) {
if (isAllowClearSelection()) {
toggleGroup.selectToggle(null);
} else if (!buttons.isEmpty()) {
toggleGroup.selectToggle(buttons.getFirst());
}
return;
}
int index = selectedIndex.get();
if (index < 0 || buttons.size() <= index) {
if (!buttons.isEmpty() && !isAllowClearSelection() && toggleGroup.getSelectedToggle() == null) {
toggleGroup.selectToggle(buttons.getFirst());
}
return;
}
toggleGroup.selectToggle(buttons.get(index));
}
@Override
protected Skin<?> createDefaultSkin() {
return new SegmentedButtonGroupSkin(this);
}
@Override
public String getUserAgentStylesheet() {
return SegmentedButtonGroup.class.getResource(TimiFXUI.RESOURCE + "style/components/segmented-button-group.css").toExternalForm();
}
/**
* 获取按钮列表
*
* @return 按钮列表
*/
public ObservableList<ToggleButton> getButtons() {
return buttons;
}
/**
* 添加按钮
*
* @param buttons 按钮列表
*/
public void addButton(ToggleButton... buttons) {
getButtons().addAll(buttons);
}
/**
* 添加文本按钮
*
* @param text 按钮文本
* @return 新增按钮
*/
public ToggleButton addButton(String text) {
ToggleButton button = new ToggleButton(text);
getButtons().add(button);
return button;
}
/**
* 设置当前选中按钮
*
* @param button 当前选中按钮
*/
public void setSelectedButton(ToggleButton button) {
if (button == null) {
if (isAllowClearSelection()) {
toggleGroup.selectToggle(null);
}
return;
}
if (!buttons.contains(button)) {
throw new IllegalArgumentException("button must belong to current group");
}
toggleGroup.selectToggle(button);
}
/**
* 获取当前选中按钮
*
* @return 当前选中按钮
*/
public ToggleButton getSelectedButton() {
return selectedButton.get();
}
/**
* 获取当前选中按钮属性
*
* @return 当前选中按钮属性
*/
public ReadOnlyObjectProperty<ToggleButton> selectedButtonProperty() {
return selectedButton.getReadOnlyProperty();
}
/**
* 设置当前选中下标
*
* @param selectedIndex 当前选中下标
*/
public void setSelectedIndex(int selectedIndex) {
this.selectedIndex.set(selectedIndex);
}
/**
* 获取当前选中下标
*
* @return 当前选中下标
*/
public int getSelectedIndex() {
return selectedIndex.get();
}
/**
* 获取当前选中下标属性
*
* @return 当前选中下标属性
*/
public IntegerProperty selectedIndexProperty() {
return selectedIndex;
}
/**
* 设置按钮间距
*
* @param spacing 按钮间距
*/
public void setSpacing(double spacing) {
this.spacing.set(Math.max(0, spacing));
}
/**
* 获取按钮间距
*
* @return 按钮间距
*/
public double getSpacing() {
return spacing.get();
}
/**
* 获取按钮间距属性
*
* @return 按钮间距属性
*/
public DoubleProperty spacingProperty() {
return spacing;
}
/**
* 设置布局对齐方式
*
* @param alignment 布局对齐方式
*/
public void setAlignment(Pos alignment) {
this.alignment.set(alignment);
}
/**
* 获取布局对齐方式
*
* @return 布局对齐方式
*/
public Pos getAlignment() {
return alignment.get();
}
/**
* 获取布局对齐方式属性
*
* @return 布局对齐方式属性
*/
public ObjectProperty<Pos> alignmentProperty() {
return alignment;
}
/**
* 设置是否允许清空选中
*
* @param allowClearSelection true 为允许清空选中
*/
public void setAllowClearSelection(boolean allowClearSelection) {
this.allowClearSelection.set(allowClearSelection);
if (!allowClearSelection && toggleGroup.getSelectedToggle() == null && !buttons.isEmpty()) {
toggleGroup.selectToggle(buttons.getFirst());
}
}
/**
* 获取是否允许清空选中
*
* @return true 为允许清空选中
*/
public boolean isAllowClearSelection() {
return allowClearSelection.get();
}
/**
* 获取是否允许清空选中属性
*
* @return 是否允许清空选中属性
*/
public BooleanProperty allowClearSelectionProperty() {
return allowClearSelection;
}
}
@@ -1,86 +0,0 @@
package com.imyeyu.fx.ui.components;
import javafx.collections.ListChangeListener;
import javafx.scene.control.SkinBase;
import javafx.scene.control.ToggleButton;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.HBox;
/**
* 分段按钮组皮肤
*
* @author 夜雨
* @since 2026-06-25
*/
public class SegmentedButtonGroupSkin extends SkinBase<SegmentedButtonGroup> {
/** 保持当前选中状态 */
static final javafx.event.EventHandler<MouseEvent> EVENT_KEEP_SELECTED = event -> {
if (event.getSource() instanceof ToggleButton button && button.isSelected()) {
event.consume();
}
};
/** 按钮容器 */
private final HBox box;
/**
* 构造按钮组皮肤
*
* @param control 按钮组控件
*/
public SegmentedButtonGroupSkin(SegmentedButtonGroup control) {
super(control);
box = new HBox();
box.getStyleClass().add(SegmentedButtonGroup.STYLE_CLASS_BOX);
box.spacingProperty().bind(control.spacingProperty());
box.alignmentProperty().bind(control.alignmentProperty());
getChildren().add(box);
rebuildButtons();
control.getButtons().addListener((ListChangeListener<ToggleButton>) change -> rebuildButtons());
}
/**
* 重建按钮结构
*/
private void rebuildButtons() {
box.getChildren().setAll(getSkinnable().getButtons());
syncButtonStyleClass();
}
/**
* 同步按钮样式
*/
private void syncButtonStyleClass() {
int size = getSkinnable().getButtons().size();
for (int i = 0; i < size; i++) {
ToggleButton button = getSkinnable().getButtons().get(i);
button.setMaxWidth(Double.MAX_VALUE);
button.getStyleClass().removeAll(
SegmentedButtonGroup.STYLE_CLASS_BUTTON,
SegmentedButtonGroup.STYLE_CLASS_FIRST,
SegmentedButtonGroup.STYLE_CLASS_MIDDLE,
SegmentedButtonGroup.STYLE_CLASS_LAST,
SegmentedButtonGroup.STYLE_CLASS_SINGLE
);
button.getStyleClass().add(SegmentedButtonGroup.STYLE_CLASS_BUTTON);
if (size == 1) {
button.getStyleClass().add(SegmentedButtonGroup.STYLE_CLASS_SINGLE);
continue;
}
if (i == 0) {
button.getStyleClass().add(SegmentedButtonGroup.STYLE_CLASS_FIRST);
continue;
}
if (i == size - 1) {
button.getStyleClass().add(SegmentedButtonGroup.STYLE_CLASS_LAST);
continue;
}
button.getStyleClass().add(SegmentedButtonGroup.STYLE_CLASS_MIDDLE);
}
}
}
+26 -5
View File
@@ -30,9 +30,30 @@
-fx-font-smoothing-type: gray; -fx-font-smoothing-type: gray;
} }
.root { .root {
-timi-fx-color: #177CB0; -timi-fx-white-color: #FFF;
-timi-fx-icon-color: #333; -timi-fx-red-color: #F30;
-timi-fx-border-color: #B5B5B5; -timi-fx-brown-color: #A67D7B;
-timi-fx-black-color: #000;
-timi-fx-orange-color: #F60;
-timi-fx-yellow-color: #FF0;
-timi-fx-green-color: #393;
-timi-fx-dark-green-color: #373;
-timi-fx-gray-color: #666;
-timi-fx-blue-color: #008DCB;
-timi-fx-light-blue-color: #DDEAF0;
-timi-fx-gray-white-color: #F4F4F4;
-timi-fx-light-gray-color: #B5B5B5;
-timi-fx-dark-gray-color: #333;
-timi-fx-pink-color: #FF7A9B;
-timi-fx-transparent: transparent;
-timi-fx-focused-default-color: #177CB0;
-timi-fx-focused-light-color: #55B0DF;
-timi-fx-focused-dark-color: #0B6C9E;
-timi-fx-icon-disabled-color: #939393;
-timi-fx-color: -timi-fx-focused-default-color;
-timi-fx-icon-color: -timi-fx-dark-gray-color;
-timi-fx-border-color: -timi-fx-light-gray-color;
-timi-fx-popup-shadow: dropshadow(three-pass-box, rgba(0, 0, 0, .3), 5, 0, 0, 1); -timi-fx-popup-shadow: dropshadow(three-pass-box, rgba(0, 0, 0, .3), 5, 0, 0, 1);
-timi-fx-opacity-hover: .7; -timi-fx-opacity-hover: .7;
-timi-fx-selected-color: #7CC4FF; -timi-fx-selected-color: #7CC4FF;
@@ -45,7 +66,7 @@
-fx-faint-focus-color: transparent; -fx-faint-focus-color: transparent;
-fx-shadow-highlight-color: transparent; -fx-shadow-highlight-color: transparent;
-fx-cell-focus-inner-border: transparent; -fx-cell-focus-inner-border: transparent;
-fx-control-inner-background: #FFF; -fx-control-inner-background: -timi-fx-white-color;
} }
/* --------------------------- 聚焦边距 --------------------------- */ /* --------------------------- 聚焦边距 --------------------------- */
.text-area:focused, .text-area:focused,
@@ -64,5 +85,5 @@
/* --------------------------- 只读 --------------------------- */ /* --------------------------- 只读 --------------------------- */
.text-area:readonly, .text-area:readonly,
.text-field:readonly { .text-field:readonly {
-fx-text-fill: #666; -fx-text-fill: -timi-fx-gray-color;
} }
@@ -4,7 +4,7 @@
.date-time-picker-time-pane { .date-time-picker-time-pane {
-fx-border-width: 0 0 0 1; -fx-border-width: 0 0 0 1;
-fx-border-color: -timi-fx-border-color; -fx-border-color: -timi-fx-border-color;
-fx-background-color: #F4F4F4; -fx-background-color: -timi-fx-gray-white-color;
-fx-translate-y: -1; -fx-translate-y: -1;
-fx-effect: dropshadow(three-pass-box, rgba(0, 0, 0, .25), 4, 0, 0, 1); -fx-effect: dropshadow(three-pass-box, rgba(0, 0, 0, .25), 4, 0, 0, 1);
} }
@@ -15,5 +15,6 @@
-fx-alignment: center-right; -fx-alignment: center-right;
} }
.date-time-picker-clear { .date-time-picker-clear {
-fx-background-color: #F4F4F4; -fx-background-color: -timi-fx-gray-white-color;
} }
@@ -1,6 +1,7 @@
.x-hyperlink { .x-hyperlink {
-fx-text-fill: #177CB0; -fx-text-fill: -timi-fx-focused-default-color;
} }
.x-hyperlink:hover { .x-hyperlink:hover {
-fx-underline: true; -fx-underline: true;
} }
@@ -2,3 +2,4 @@
-fx-border-width: 1; -fx-border-width: 1;
-fx-border-color: transparent; -fx-border-color: transparent;
} }
@@ -4,3 +4,4 @@
.label-progress-bar:indeterminate .bar { .label-progress-bar:indeterminate .bar {
-fx-background-color: linear-gradient(to left, transparent, #7ACAF4); -fx-background-color: linear-gradient(to left, transparent, #7ACAF4);
} }
@@ -14,7 +14,7 @@
-fx-background-color: #CCC; -fx-background-color: #CCC;
} }
.navigation .navigation-button:selected { .navigation .navigation-button:selected {
-fx-text-fill: #FFF; -fx-text-fill: -timi-fx-white-color;
-fx-background-color: -timi-fx-color; -fx-background-color: -timi-fx-color;
} }
.navigation .navigation-button:disabled { .navigation .navigation-button:disabled {
@@ -31,3 +31,4 @@
.group-pane .content { .group-pane .content {
-fx-padding: 0; -fx-padding: 0;
} }
@@ -5,3 +5,4 @@
-fx-pref-height: 6; -fx-pref-height: 6;
-fx-background-insets: 0; -fx-background-insets: 0;
} }
@@ -1,38 +0,0 @@
.segmented-button-group {
-fx-skin: "com.imyeyu.fx.ui.components.SegmentedButtonGroupSkin";
}
.segmented-button-group .segmented-button-group-box {
-fx-spacing: 0;
-fx-alignment: center-left;
}
.segmented-button-group .segmented-button-group-button {
-fx-background-radius: 0;
-fx-border-radius: 0;
-fx-border-width: 1 1 1 0;
-fx-padding: .333333em 1em; /* 4 12 */
-fx-background-color: #FFF;
}
.segmented-button-group .segmented-button-group-button.first,
.segmented-button-group .segmented-button-group-button.single {
-fx-border-width: 1;
}
.segmented-button-group .segmented-button-group-button.single {
-fx-background-radius: .083333em;
-fx-border-radius: .083333em;
}
.segmented-button-group .segmented-button-group-button.first {
-fx-background-radius: .083333em 0 0 .083333em;
-fx-border-radius: .083333em 0 0 .083333em;
}
.segmented-button-group .segmented-button-group-button.last {
-fx-background-radius: 0 .083333em .083333em 0;
-fx-border-radius: 0 .083333em .083333em 0;
}
.segmented-button-group .segmented-button-group-button:hover {
-fx-background-color: #F4F9FC;
}
.segmented-button-group .segmented-button-group-button:selected {
-fx-background-color: -timi-fx-color;
-fx-border-color: -timi-fx-color;
-fx-text-fill: #FFF;
}
@@ -5,3 +5,4 @@
-fx-hbar-policy: never; -fx-hbar-policy: never;
-fx-vbar-policy: never; -fx-vbar-policy: never;
} }
@@ -33,3 +33,4 @@
.tab-pane:top > .tab-header-area { .tab-pane:top > .tab-header-area {
-fx-padding: 0; -fx-padding: 0;
} }
@@ -1,7 +1,8 @@
.text-area-editor .find-field { .text-area-editor .find-field {
-fx-background-color: #FFF; -fx-background-color: -timi-fx-white-color;
-fx-background-insets: 0; -fx-background-insets: 0;
} }
.text-area-editor .replace-field { .text-area-editor .replace-field {
-fx-padding: .25em .333333em .25em 1.25em; /* 3 4 3 15 */ -fx-padding: .25em .333333em .25em 1.25em; /* 3 4 3 15 */
} }
@@ -1,11 +1,11 @@
.time-picker .text-field:readonly { .time-picker .text-field:readonly {
-fx-text-fill: #666; -fx-text-fill: -timi-fx-gray-color;
} }
.time-picker-popup { .time-picker-popup {
-fx-effect: dropshadow(three-pass-box, rgba(0, 0, 0, .3), 5, 0, 0, 1); -fx-effect: dropshadow(three-pass-box, rgba(0, 0, 0, .3), 5, 0, 0, 1);
-fx-border-width: 1; -fx-border-width: 1;
-fx-border-color: -timi-fx-border-color; -fx-border-color: -timi-fx-border-color;
-fx-background-color: #F4F4F4; -fx-background-color: -timi-fx-gray-white-color;
} }
.time-picker-time-box { .time-picker-time-box {
-fx-spacing: 0; -fx-spacing: 0;
@@ -13,3 +13,4 @@
.time-picker-now { .time-picker-now {
-fx-alignment: center-right; -fx-alignment: center-right;
} }
@@ -4,3 +4,4 @@
.toggle-icon:disabled .icon { .toggle-icon:disabled .icon {
-fx-opacity: -timi-fx-opacity-disabled; -fx-opacity: -timi-fx-opacity-disabled;
} }
@@ -1,3 +1,4 @@
.tray-menu { .tray-menu {
-fx-border-width: 0; -fx-border-width: 0;
} }
+9 -7
View File
@@ -9,6 +9,7 @@
} }
.toggle-button { .toggle-button {
-fx-padding: .25em .833333em; /* 3 10 */ -fx-padding: .25em .833333em; /* 3 10 */
-fx-pref-height: 26;
-fx-border-width: 1; -fx-border-width: 1;
-fx-border-color: -timi-fx-border-color; -fx-border-color: -timi-fx-border-color;
-fx-background-color: transparent; -fx-background-color: transparent;
@@ -114,7 +115,7 @@
.combo-box .text-input, .combo-box .text-input,
.date-picker .text-input { .date-picker .text-input {
-fx-padding: 4; -fx-padding: 4;
-fx-background-color: -fx-text-box-border, #FFF; -fx-background-color: -fx-text-box-border, -timi-fx-white-color;
-fx-background-insets: 0, 0 1 0 0; -fx-background-insets: 0, 0 1 0 0;
-fx-background-radius: 0; -fx-background-radius: 0;
} }
@@ -150,7 +151,7 @@
-fx-padding: 0; -fx-padding: 0;
-fx-translate-y: -1; -fx-translate-y: -1;
-fx-border-width: 1 1 0 1; -fx-border-width: 1 1 0 1;
-fx-background-color: -timi-fx-border-color, #FFF; -fx-background-color: -timi-fx-border-color, -timi-fx-white-color;
-fx-background-insets: 0, 0 0 1 0; -fx-background-insets: 0, 0 0 1 0;
} }
.combo-box .combo-box-popup .list-view .list-cell { .combo-box .combo-box-popup .list-view .list-cell {
@@ -158,12 +159,12 @@
-fx-background-color: transparent; -fx-background-color: transparent;
} }
.combo-box .combo-box-popup .list-view .list-cell:filled:hover { .combo-box .combo-box-popup .list-view .list-cell:filled:hover {
-fx-text-fill: #FFF; -fx-text-fill: -timi-fx-white-color;
-fx-background-color: -timi-fx-color; -fx-background-color: -timi-fx-color;
} }
.combo-box .combo-box-popup .list-view .list-cell:filled:selected, .combo-box .combo-box-popup .list-view .list-cell:filled:selected,
.combo-box .combo-box-popup .list-view .list-cell:filled:selected:hover { .combo-box .combo-box-popup .list-view .list-cell:filled:selected:hover {
-fx-text-fill: #FFF; -fx-text-fill: -timi-fx-white-color;
-fx-background-color: -timi-fx-color; -fx-background-color: -timi-fx-color;
} }
.combo-box .combo-box-popup .list-view .scroll-bar:vertical { .combo-box .combo-box-popup .list-view .scroll-bar:vertical {
@@ -201,14 +202,14 @@
-fx-padding: 0; -fx-padding: 0;
-fx-border-width: 1; -fx-border-width: 1;
-fx-border-color: -timi-fx-border-color; -fx-border-color: -timi-fx-border-color;
-fx-background-color: #FFF; -fx-background-color: -timi-fx-white-color;
-fx-background-insets: 0; -fx-background-insets: 0;
} }
.context-menu .menu-item:focused { .context-menu .menu-item:focused {
-fx-background-color: -timi-fx-selected-color; -fx-background-color: -timi-fx-selected-color;
} }
.context-menu .menu-item:focused .label { .context-menu .menu-item:focused .label {
-fx-text-fill: #333; -fx-text-fill: -timi-fx-dark-gray-color;
} }
.context-menu .separator { .context-menu .separator {
-fx-padding: 0; -fx-padding: 0;
@@ -391,7 +392,7 @@
-fx-padding: 0; -fx-padding: 0;
-fx-border-width: 2 0 0 0; -fx-border-width: 2 0 0 0;
-fx-border-color: -timi-fx-border-color; -fx-border-color: -timi-fx-border-color;
-fx-background-color: #FFF; -fx-background-color: -timi-fx-white-color;
-fx-background-insets: 0; -fx-background-insets: 0;
} }
.titled-group .titled-pane { .titled-group .titled-pane {
@@ -424,3 +425,4 @@
-fx-pref-height: 1; -fx-pref-height: 1;
-fx-background-color: -timi-fx-border-color; -fx-background-color: -timi-fx-border-color;
} }
+1
View File
@@ -15,6 +15,7 @@
.text-area, .text-area,
.text-field, .text-field,
.list-view > *, .list-view > *,
.toggle-button,
.table-view > *, .table-view > *,
.minecraft-ae { .minecraft-ae {
-fx-font-size: 16; -fx-font-size: 16;
@@ -11,3 +11,4 @@
-fx-background-color: transparent; -fx-background-color: transparent;
-fx-background-insets: 0; -fx-background-insets: 0;
} }
@@ -2,3 +2,5 @@
@import "controls.css"; @import "controls.css";
@import "layout.css"; @import "layout.css";
@import "utility.css"; @import "utility.css";
@import "components/radio-button-group.css";
+22 -20
View File
@@ -5,13 +5,13 @@
-fx-background-insets: 0; -fx-background-insets: 0;
} }
.bg-white { .bg-white {
-fx-background-color: #FFF; -fx-background-color: -timi-fx-white-color;
} }
.bg-black { .bg-black {
-fx-background-color: #000; -fx-background-color: -timi-fx-black-color;
} }
.bg-default { .bg-default {
-fx-background-color: #F4F4F4; -fx-background-color: -timi-fx-gray-white-color;
} }
.bg-button-static { .bg-button-static {
-fx-border-color: -timi-fx-border-color; -fx-border-color: -timi-fx-border-color;
@@ -67,7 +67,7 @@
-fx-border-width: .083333em .083333em .083333em 0; /* 1 1 1 0 */ -fx-border-width: .083333em .083333em .083333em 0; /* 1 1 1 0 */
} }
.editable-table .table-row-cell .text-field { .editable-table .table-row-cell .text-field {
-fx-background-color: -timi-fx-color, #FFF; -fx-background-color: -timi-fx-color, -timi-fx-white-color;
-fx-background-insets: 0, 0; -fx-background-insets: 0, 0;
} }
.editable-table .table-row-cell .text-field:focused { .editable-table .table-row-cell .text-field:focused {
@@ -77,52 +77,52 @@
-fx-padding: 0; -fx-padding: 0;
} }
.white { .white {
-fx-text-fill: #FFF; -fx-text-fill: -timi-fx-white-color;
} }
.red { .red {
-fx-text-fill: #F30; -fx-text-fill: -timi-fx-red-color;
} }
.brown { .brown {
-fx-text-fill: #A67D7B; -fx-text-fill: -timi-fx-brown-color;
} }
.black { .black {
-fx-text-fill: #000; -fx-text-fill: -timi-fx-black-color;
} }
.orange { .orange {
-fx-text-fill: #F60; -fx-text-fill: -timi-fx-orange-color;
} }
.yellow { .yellow {
-fx-text-fill: #FF0; -fx-text-fill: -timi-fx-yellow-color;
} }
.green { .green {
-fx-text-fill: #393; -fx-text-fill: -timi-fx-green-color;
} }
.dark-green { .dark-green {
-fx-text-fill: #373; -fx-text-fill: -timi-fx-dark-green-color;
} }
.gray { .gray {
-fx-text-fill: #666; -fx-text-fill: -timi-fx-gray-color;
} }
.blue { .blue {
-fx-text-fill: #008DCB; -fx-text-fill: -timi-fx-blue-color;
} }
.light-blue { .light-blue {
-fx-text-fill: #DDEAF0; -fx-text-fill: -timi-fx-light-blue-color;
} }
.gray-white { .gray-white {
-fx-text-fill: #F4F4F4; -fx-text-fill: -timi-fx-gray-white-color;
} }
.light-gray { .light-gray {
-fx-text-fill: #B5B5B5; -fx-text-fill: -timi-fx-light-gray-color;
} }
.dark-gray { .dark-gray {
-fx-text-fill: #333; -fx-text-fill: -timi-fx-dark-gray-color;
} }
.pink { .pink {
-fx-text-fill: #FF7A9B; -fx-text-fill: -timi-fx-pink-color;
} }
.transparent { .transparent {
-fx-text-fill: #FFFFFF00; -fx-text-fill: -timi-fx-transparent;
} }
.border-all { .border-all {
-fx-border-width: 1; -fx-border-width: 1;
@@ -172,3 +172,5 @@
.border-lr { .border-lr {
-fx-border-width: 0 1 0 1; -fx-border-width: 0 1 0 1;
} }
@@ -1,14 +1,14 @@
package com.imyeyu.fx.ui.examples.view; package com.imyeyu.fx.ui.examples.view;
import com.imyeyu.fx.ui.TimiFXUI;
import com.imyeyu.fx.ui.examples.bean.Config;
import com.imyeyu.fx.ui.examples.component.RootLayout;
import com.imyeyu.inject.annotation.Inject;
import javafx.application.Application; import javafx.application.Application;
import javafx.scene.PerspectiveCamera; import javafx.scene.PerspectiveCamera;
import javafx.scene.Scene; import javafx.scene.Scene;
import javafx.scene.image.Image; import javafx.scene.image.Image;
import javafx.stage.Stage; import javafx.stage.Stage;
import com.imyeyu.fx.ui.TimiFXUI;
import com.imyeyu.fx.ui.examples.bean.Config;
import com.imyeyu.fx.ui.examples.component.RootLayout;
import com.imyeyu.inject.annotation.Inject;
/** /**
* 主界面 * 主界面