/****************************************************************************** * * * Pixel Size to Font Size * * * * 1px: 0.083333em * * 2px: 0.166667em * * 3px: 0.25em * * 4px: 0.333333em * * 5px: 0.416667em * * 6px: 0.5em * * 7px: 0.583333em * * 8px: 0.666667em * * 9px: 0.75em * * 10px: 0.833333em * * 11px: 0.916667em * * 12px: 1.0em * * * ******************************************************************************/ /* - TimiFX 的样式表 - 1. 主体颜色为灰色,辅助色为靛青 #177CB0 2. 基本组件在前,复杂组件在后,公共类最后 */ * { -fx-tab-size: 4; -fx-font-smoothing-type: gray; } .root { -timi-fx-color: #177CB0; -timi-fx-icon-color: #333; -timi-fx-border-color: #B5B5B5; -timi-fx-popup-shadow: dropshadow(three-pass-box, rgba(0, 0, 0, .3), 5, 0, 0, 1); -timi-fx-opacity-hover: .7; -timi-fx-selected-color: #7CC4FF; -timi-fx-opacity-disabled: .4; -fx-accent: -timi-fx-color; -fx-focus-color: transparent; -fx-focused-base: transparent; -fx-text-box-border: -timi-fx-border-color; -fx-faint-focus-color: transparent; -fx-shadow-highlight-color: transparent; -fx-cell-focus-inner-border: transparent; -fx-control-inner-background: #FFF; } /* --------------------------- 聚焦边距 --------------------------- */ .text-area:focused, .text-field:focused { -fx-background-insets: 1, 2; } .button:focused { -fx-background-insets: 0; } .list-view:focused { -fx-background-insets: 0, 0, 2; } .table-view:focused { -fx-background-insets: 0, 0, 1; } /* --------------------------- 只读 --------------------------- */ .text-area:readonly, .text-field:readonly, .time-picker:readonly { -fx-text-fill: #666; } /* --------------------------- 控件 --------------------------- */ /* 可选标签 */ .selectable-label * { -fx-background-color: transparent; } .selectable-label .scroll-pane { -fx-hbar-policy: never; -fx-vbar-policy: never; } /* 按钮 */ .button { -fx-padding: .25em .833333em; /* 3 10 */ -fx-border-width: 1; -fx-border-color: -timi-fx-border-color; -fx-background-color: -fx-body-color; -fx-background-insets: 0; -fx-background-radius: 0; } .toggle-button { -fx-padding: .25em .833333em; /* 3 10 */ -fx-border-width: 1; -fx-border-color: -timi-fx-border-color; -fx-background-color: transparent; -fx-background-insets: 0; -fx-background-radius: .083333em; } .toggle-button:selected { -fx-background-color: -timi-fx-selected-color; } /* 图标按钮 */ .icon-button { -fx-border-width: 1; -fx-border-color: transparent; } /* 切换图标按钮 */ .toggle-icon:disabled { -fx-opacity: -timi-fx-opacity-disabled; } .toggle-icon:disabled .icon { -fx-opacity: -timi-fx-opacity-disabled; } /* 文本框 */ .text-field { -fx-padding: .25em .333333em; /* 3 4 */ -fx-border-width: 1; -fx-border-color: -timi-fx-border-color; -fx-background-color: -fx-control-inner-background; -fx-background-insets: 0; -fx-background-radius: 0; } /* 文本域 */ .text-area { -fx-border-width: 1; -fx-border-color: -timi-fx-border-color; -fx-background-color: -fx-control-inner-background; -fx-background-radius: 0; } .text-area:focused { -fx-background-color: -fx-focus-color, -fx-control-inner-background; } .text-area .content { -fx-padding: .25em .388888em; /* 3 4.5 */ -fx-background-color: -fx-control-inner-background; } .text-area .scroll-pane { -fx-padding: 0; } /* 文本域编辑器 */ .text-area-editor .find-field { -fx-background-color: #FFF; -fx-background-insets: 0; } .text-area-editor .replace-field { -fx-padding: .25em .333333em .25em 1.25em; /* 3 4 3 15 */ } /* 滑动选择 */ .slider > .track { -fx-padding: .25em; -fx-background-radius: 0; } .slider > .thumb { -fx-padding: .5em .3em; -fx-background-color: -fx-shadow-highlight-color, -fx-outer-border, -fx-inner-border, -fx-body-color; -fx-background-insets: 0 0 -1 0, 0, 1, 2; -fx-background-radius: 0; } .slider:focused > .thumb { -fx-background-color: -fx-shadow-highlight-color, -fx-outer-border, -fx-inner-border, -fx-body-color; -fx-background-insets: 0 0 -1 0, 0, 1, 2; } /* 树形结构 */ .tree-view { -fx-padding: 0; } .tree-view .tree-disclosure-node { -fx-padding: .166667em .583333em 0 .333333em; } .tree-view .tree-cell .arrow, .tree-view .tree-cell:expanded .arrow { -fx-shape: "M303.5,391.5h1v1h1v1h1v1h1v1h1v1h-1v1h-1v1h-1v1h-1v1h-1Z"; -fx-min-width: 5; -fx-min-height: 9; -fx-pref-width: 5; -fx-pref-height: 9; } /* 列表 */ .list-view { -fx-padding: 0; -fx-border-width: 1; -fx-border-color: -timi-fx-border-color; -fx-background-color: -fx-control-inner-background; -fx-background-insets: 0; } .list-view:focused { -fx-background-color: -fx-control-inner-background; -fx-background-insets: 0; } /* 表格 */ .table-view { -fx-padding: 0; -fx-border-width: 1; -fx-border-color: -timi-fx-border-color; -fx-background-color: -fx-control-inner-background; -fx-background-insets: 1; } .table-view .arrow, .tree-table-view .arrow { -fx-shape: "M0,0h9v1H8v1H7v1H6v1H5v1H4V4H3V3H2V2H1V1H0V0z"; -fx-min-width: 9; -fx-min-height: 5; -fx-pref-width: 9; -fx-pref-height: 5; } .table-view .text-field { -fx-background-insets: 0; } .table-view .text-field:focused { -fx-background-insets: 1; } /* 下拉选择,菜单按钮,颜色选择,日期选择 */ .combo-box, .menu-button, .date-picker, .color-picker { -fx-border-width: 1; -fx-border-color: -fx-text-box-border; -fx-background-color: -fx-body-color; -fx-background-insets: 0; -fx-background-radius: 0; } .combo-box .text-input, .date-picker .text-input { -fx-padding: 4; -fx-background-color: -fx-text-box-border, #FFF; -fx-background-insets: 0, 0 1 0 0; -fx-background-radius: 0; } .combo-box > .list-cell { -fx-padding: .25em; } .menu-button.icon > .label { -fx-padding: .166667em .083333em .25em .333333em; /* 2 1 3 4 */ } .menu-button.empty > .label { -fx-padding: 0; } /* 下拉箭头 */ .combo-box-base .text-field { -fx-border-width: 0; } .combo-box .arrow-button, .menu-button .arrow-button { -fx-padding: 0 .5em; -fx-background-radius: 0; -fx-background-insets: 0; } .combo-box .arrow-button .arrow, .menu-button .arrow-button .arrow, .color-picker .arrow-button .arrow { -fx-shape: "M301.5,393.5v1h1v1h1v1h1v1h1v1h1v-1h1v-1h1v-1h1v-1h1v-1Z"; -fx-min-width: 9; -fx-min-height: 5; -fx-pref-width: 9; -fx-pref-height: 5; } .combo-box .combo-box-popup .list-view { -fx-effect: -timi-fx-popup-shadow; -fx-padding: 0; -fx-translate-y: -1; -fx-border-width: 1 1 0 1; -fx-background-color: -timi-fx-border-color, #FFF; -fx-background-insets: 0, 0 0 1 0; } .combo-box .combo-box-popup .list-view .list-cell { -fx-border-color: transparent; -fx-background-color: transparent; } .combo-box .combo-box-popup .list-view .list-cell:filled:hover { -fx-text-fill: #FFF; -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:hover { -fx-text-fill: #FFF; -fx-background-color: -timi-fx-color; } .combo-box .combo-box-popup .list-view .scroll-bar:vertical { -fx-border-width: 0 0 1 1; -fx-border-color: -timi-fx-border-color; -fx-background-color: -fx-background; } /* 单选,多选 */ .check-box, .radio-button, .check-box:hover, .radio-button:hover { -fx-padding: .166667em .333333em .166667em 0; /* 3 4 3 0 */ } .check-box > .box, .radio-button > .radio { -fx-padding: 0; -fx-pref-width: 18; -fx-pref-height: 18; -fx-background-color: -fx-focus-color, -fx-outer-border, -fx-inner-border, -fx-body-color; -fx-background-insets: -1.4, 0, 1, 2; -fx-background-radius: 0, 0, 0, 1; } .check-box .mark, .radio-button .dot { -fx-shape: "M3,7v2h1v1h1v1h1v1h1v-1h1v-1h1V9h1V8h1V7h1V6h1V4h-2v1h-1v1H9v1H8v1H7v1H6V8H5V7H3z"; -fx-padding: 0; -fx-max-width: 10; -fx-max-height: 8; -fx-pref-width: 10; -fx-pref-height: 8; } /* 弹出菜单 */ .context-menu { -fx-color: -fx-base; -fx-effect: -timi-fx-popup-shadow; -fx-padding: 0; -fx-border-width: 1; -fx-border-color: -timi-fx-border-color; -fx-background-color: #FFF; -fx-background-insets: 0; } .context-menu .menu-item:focused { -fx-background-color: -timi-fx-selected-color; } .context-menu .menu-item:focused .label { -fx-text-fill: #333; } .context-menu .separator { -fx-padding: 0; } /* 托盘菜单 */ .tray-menu { -fx-border-width: 0; } /* 菜单 */ .menu > .right-container > .arrow { -fx-shape: "M303.5,391.5h1v1h1v1h1v1h1v1h1v1h-1v1h-1v1h-1v1h-1v1h-1Z"; -fx-min-width: 5; -fx-min-height: 9; -fx-pref-width: 5; -fx-pref-height: 9; } .radio-menu-item:checked > .left-container > .radio { -fx-shape: "M3,7v2h1v1h1v1h1v1h1v-1h1v-1h1V9h1V8h1V7h1V6h1V4h-2v1h-1v1H9v1H8v1H7v1H6V8H5V7H3z"; } .check-menu-item:checked > .left-container > .check { -fx-shape: "M3,7v2h1v1h1v1h1v1h1v-1h1v-1h1V9h1V8h1V7h1V6h1V4h-2v1h-1v1H9v1H8v1H7v1H6V8H5V7H3z"; } /* 日期选择 */ .date-picker:focused { -fx-background-color: -fx-control-inner-background; } .date-picker > .arrow-button { -fx-padding: 0 8; -fx-background-insets: 0; } .date-picker > .arrow-button > .arrow { -fx-shape: "M300,391v2h11v-2Z M303,394v2h2v-2Z M306,394v2h2v-2Z M309,394v2h2v-2Z M309,397v2h2v-2Z M306,397v2h2v-2Z M305,397v2h-2v-2Z M300,397h2v2h-2Z M300,400v2h2v-2Z M303,400v2h2v-2Z M306,400v2h2v-2Z"; -fx-min-width: 11; -fx-min-height: 11; -fx-pref-width: 11; -fx-pref-height: 11; -fx-background-color: -timi-fx-icon-color; } .date-picker-popup { -fx-effect: -timi-fx-popup-shadow; -fx-translate-y: -1; -fx-background-color: -fx-box-border; -fx-background-insets: 0; } .date-picker-popup > .month-year-pane { -fx-padding: .25em; } .date-picker-popup > * > .spinner { -fx-spacing: .166667em; } .date-picker-popup > * > .spinner > .left-button, .date-picker-popup > * > .spinner > .right-button { -fx-padding: 0 .333333em .333333em .333333em; -fx-border-width: 0; } .date-picker-popup > * > .spinner > .button > .left-arrow, .date-picker-popup > * > .spinner > .button > .right-arrow { -fx-min-width: 8; -fx-min-height: 13; -fx-pref-width: 8; -fx-pref-height: 13; -fx-background-color: -timi-fx-icon-color; } .date-picker-popup > * > .spinner > .button > .left-arrow { -fx-shape: "M298,394h1v-1h1v-1h1v-1h1v-1h1v-1h1v-1h2v1h-1v1h-1v1h-1v1h-1v1h-1v1h-1v1h1v1h1v1h1v1h1v1h1v1h1v1h-2v-1h-1v-1h-1v-1h-1v-1h-1v-1h-1v-1h-1Z"; } .date-picker-popup > * > .spinner > .button > .right-arrow { -fx-shape: "M306,394h-1v-1h-1v-1h-1v-1h-1v-1h-1v-1h-1v-1h-2v1h1v1h1v1h1v1h1v1h1v1h1v1h-1v1h-1v1h-1v1h-1v1h-1v1h-1v1h2v-1h1v-1h1v-1h1v-1h1v-1h1v-1h1Z"; } /* 颜色选择器 */ .color-palette { -fx-translate-y: -1; -fx-background-radius: 0; } .custom-color-dialog { -fx-border-width: 1 0 0 0; -fx-border-color: -timi-fx-border-color; } .custom-color-dialog > .color-rect-pane > .color-bar > #color-bar-indicator { -fx-border-radius: 0; } .custom-color-dialog .controls-pane .toggle-button { -fx-padding: .25em .5em; -fx-background-radius: 0; } .custom-color-dialog .controls-pane .current-new-color-grid #current-new-color-border { -fx-border-color: derive(-fx-base, -20%); -fx-border-width: 1px; } .custom-color-dialog .controls-pane .customcolor-controls-background { -fx-background-color: -fx-text-box-border, -fx-control-inner-background; -fx-background-insets: 12px 0 0 0, 13px 1px 1px 1px; -fx-background-radius: 0; } /* 滚动条 */ .scroll-bar { -fx-padding: 0; } .scroll-bar .decrement-arrow, .scroll-bar .increment-arrow, .scroll-bar .decrement-button, .scroll-bar .increment-button { visibility: hidden; -fx-min-width: 0; -fx-min-height: 0; -fx-pref-width: 0; -fx-pref-height: 0; } .scroll-bar:vertical, .scroll-bar:horizontal { -fx-padding: 0; -fx-background-color: transparent; } .scroll-bar:vertical { -fx-pref-width: 7; } .scroll-bar:horizontal { -fx-pref-height: 7; } .scroll-bar:vertical .thumb, .scroll-bar:horizontal .thumb { -fx-background-color: -timi-fx-color; -fx-background-insets: 0; -fx-background-radius: 0; } /* 列表滚动条 */ .tree-view .scroll-bar:vertical, .list-view .scroll-bar:vertical, .table-view .scroll-bar:vertical { -fx-border-width: 0 0 0 1; -fx-border-color: -timi-fx-border-color; -fx-background-color: -fx-background; } .tree-view .scroll-bar:horizontal, .list-view .scroll-bar:horizontal, .table-view .scroll-bar:horizontal { -fx-border-width: 1 0 0 0; -fx-border-color: -timi-fx-border-color; -fx-background-color: -fx-background; } /* 进度条 */ .progress-bar { -fx-padding: 1; -fx-border-width: 1; -fx-border-color: -timi-fx-border-color; -fx-indeterminate-bar-flip: true; -fx-indeterminate-bar-length: 120; -fx-indeterminate-bar-escape: true; -fx-indeterminate-bar-animation-time: 4; } .progress-bar .track { -fx-background-color: transparent; -fx-background-radius: 0; } .progress-bar .bar { -fx-background-color: -timi-fx-color; -fx-background-insets: 0; -fx-background-radius: 0; } .progress-bar:indeterminate .bar { -fx-background-color: linear-gradient(to left, transparent, -timi-fx-color); } /* 标签进度 */ .label-progress-bar .bar { -fx-background-color: #7ACAF4; } .label-progress-bar:indeterminate .bar { -fx-background-color: linear-gradient(to left, transparent, #7ACAF4); } /* 滑动选择 - 进度 */ .progress-slider .track { -fx-padding: 0; } .progress-slider .progress-bar .bar { -fx-pref-height: 6; -fx-background-insets: 0; } /* 分页 */ .x-pagination .button, .x-pagination .toggle-button { -fx-padding: 0; -fx-pref-width: 28; -fx-pref-height: 26; } /* 标题组件 */ .titled-pane { -fx-animate: false; -fx-border-width: 1; -fx-border-color: -timi-fx-border-color; -fx-background-color: -timi-fx-border-color, #F1F1F1; -fx-background-insets: 0, 0 0 1 0; } .titled-pane > .title { -fx-padding: .333333em .833333em; /* 4 10 */ -fx-background-color: -fx-inner-border, -fx-body-color; -fx-background-insets: 0, 1; -fx-background-radius: 0, 0; } .titled-pane > .title > .arrow-button { -fx-padding: 0; -fx-translate-x: -4; -fx-translate-y: -1; } .titled-pane > .title > .arrow-button > .arrow { -fx-shape: "M300,393v1h1v1h1v1h1v1h1v1h1v-1h1v-1h1v-1h1v-1h1v-1Z"; -fx-padding: 0; -fx-min-width: 9; -fx-min-height: 5; -fx-pref-width: 9; -fx-pref-height: 5; } .titled-pane > .content { -fx-padding: 0; -fx-border-width: 2 0 0 0; -fx-border-color: -timi-fx-border-color; -fx-background-color: #FFF; -fx-background-insets: 0; } .titled-group .titled-pane { -fx-border-width: 0 0 1 0; -fx-background-insets: 0, 0; } /* 图表 */ .chart { -fx-padding: 0 0 6 0; } .chart-content { -fx-padding: 0 24 4 6; } .chart-legend { -fx-padding: 4 8; -fx-background-radius: 0, 0; } .area-legend-symbol { -fx-padding: 6; -fx-background-radius: 0; -fx-background-insets: 0, 6; } /* 导航 */ .navigation { -fx-border-width: 1; -fx-border-color: -timi-fx-border-color; } .navigation .group-pane { -fx-animated: false; -fx-border-width: 1 0 0 0; } .navigation .group-pane.bottom-line { -fx-border-width: 1 0 1 0; } .navigation .group-pane .content { -fx-padding: 0; } .navigation .navigation-button { -fx-padding: .25em .833333em; /* 3 10 */ -fx-border-width: 0; -fx-border-color: -timi-fx-border-color; } .navigation .navigation-button.after-group { /* 紧挨着上一个导航组时,添加上边框 */ -fx-border-width: 1 0 0 0; } .navigation .navigation-button:hover { -fx-background-color: #CCC; } .navigation .navigation-button:selected { -fx-text-fill: #FFF; -fx-background-color: -timi-fx-color; } .navigation .navigation-button:disabled { -fx-opacity: -timi-fx-opacity-disabled; } /* 可编辑表格 */ .editable-table .table-row-cell:odd { -fx-background-color: -fx-table-cell-border-color, -fx-control-inner-background; } .editable-table .table-row-cell:filled:selected, .editable-table .table-row-cell:filled:selected:focused { -fx-padding: 0; -fx-text-fill: -fx-selection-bar-text; -fx-background: -timi-fx-selected-color; -fx-border-width: 0; -fx-background-color: -timi-fx-selected-color; -fx-background-insets: 0; -fx-table-cell-border-color: -timi-fx-selected-color; } .editable-table .table-cell { -fx-padding: 0; -fx-cell-size: 0; -fx-border-width: .083333em .083333em .083333em 0; /* 1 1 1 0 */ } .editable-table .table-row-cell .text-field { -fx-background-color: -timi-fx-color, #FFF; -fx-background-insets: 0, 0; } .editable-table .table-row-cell .text-field:focused { -fx-background-insets: 0, 1; } /* 选项卡 */ .tab-pane { -fx-border-color: -timi-fx-border-color; } .tab-pane > .tab-header-area > .headers-region > .tab { -fx-padding: 0 0 0 .5em; -fx-background-insets: 0 0 1 0, 0 1 1 0, 1 2 1 1; -fx-background-radius: 0, 0, 0; } .tab-pane > .tab-header-area > .headers-region > .tab:selected { -fx-background-insets: 0 1 0 0, 0 1 0 0; } .tab-pane > .tab-header-area > .headers-region > .tab > .tab-container > .tab-label { -fx-padding: 0 .5em 0 0; } .tab-pane:top > .tab-header-area { -fx-padding: 0; } /* 分割线 */ .separator > .line { -fx-border-style: null; -fx-border-width: 0; } .separator:horizontal > .line { -fx-padding: 0; -fx-min-height: 1; -fx-max-height: 1; -fx-pref-height: 1; -fx-background-color: -timi-fx-border-color; } /* --------------------------- 布局 --------------------------- */ /* 滚动 */ .scroll-pane { -fx-padding: 0; -fx-background-insets: 0; } .scroll-pane .corner { -fx-background-color: transparent; } /* 分割 */ .split-pane { -fx-padding: 0; -fx-background-color: transparent; -fx-background-insets: 0; } /* --------------------------- 可选类 --------------------------- */ /* 其他 */ .bg-tp, .bg-tp .viewport { -fx-background-color: transparent; -fx-background-insets: 0; } .bg-white { -fx-background-color: #FFF; } .bg-black { -fx-background-color: #000; } .bg-default { -fx-background-color: #F4F4F4; } .bg-button-static { -fx-border-color: -timi-fx-border-color; -fx-background-color: -fx-body-color; } .bg-button-static:disabled { -fx-opacity: -timi-fx-opacity-disabled; } .bg-button { -fx-border-color: -timi-fx-border-color; -fx-background-color: -fx-body-color; } .bg-button:hover { -fx-color: -fx-hover-base; } .bg-button:armed { -fx-color: -fx-pressed-base; } .bg-button:disabled { -fx-opacity: -timi-fx-opacity-disabled; } .hover-opacity:hover { -fx-opacity: -timi-fx-opacity-hover; } /* 滚动面板的滚动条边框 */ .sp-border .scroll-bar:vertical { -fx-border-width: 0 0 0 1; -fx-border-color: -timi-fx-border-color; } .sp-border .scroll-bar:horizontal { -fx-border-width: 1 0 0 0; -fx-border-color: -timi-fx-border-color; } .sp-border .corner { -fx-border-width: 1 0 0 1; -fx-border-color: -timi-fx-border-color; } /* 内边距 */ .padding-n { -fx-padding: 0; } /* 字体颜色 */ .white { -fx-text-fill: #FFF; } .red { -fx-text-fill: #F30; } .brown { -fx-text-fill: #A67D7B; } .black { -fx-text-fill: #000; } .orange { -fx-text-fill: #F60; } .yellow { -fx-text-fill: #FF0; } .green { -fx-text-fill: #393; } .dark-green { -fx-text-fill: #373; } .gray { -fx-text-fill: #666; } .blue { -fx-text-fill: #008DCB; } .light-blue { -fx-text-fill: #DDEAF0; } .gray-white { -fx-text-fill: #F4F4F4; } .light-gray { -fx-text-fill: #B5B5B5; } .dark-gray { -fx-text-fill: #333; } .pink { -fx-text-fill: #FF7A9B; } .transparent { -fx-text-fill: #FFFFFF00; } /* 边框控制 */ .border-all { -fx-border-width: 1; } .border-n { -fx-border-width: 0; } .border-t { -fx-border-width: 1 0 0 0; } .border-r { -fx-border-width: 0 1 0 0; } .border-b { -fx-border-width: 0 0 1 0; } .border-l { -fx-border-width: 0 0 0 1; } .border-tr { -fx-border-width: 1 1 0 0; } .border-rb { -fx-border-width: 0 1 1 0; } .border-bl { -fx-border-width: 0 0 1 1; } .border-lt { -fx-border-width: 1 0 0 1; } .border-trb { -fx-border-width: 1 1 1 0; } .border-rbl { -fx-border-width: 0 1 1 1; } .border-blt { -fx-border-width: 1 0 1 1; } .border-ltr { -fx-border-width: 1 1 0 1; } .border-tb { -fx-border-width: 1 0 1 0; } .border-lr { -fx-border-width: 0 1 0 1; }