refactor style inject
This commit is contained in:
@@ -1,11 +1,9 @@
|
||||
package com.imyeyu.fx.ui.components;
|
||||
|
||||
import com.imyeyu.fx.bean.Interpolates;
|
||||
|
||||
import javafx.animation.KeyFrame;
|
||||
import javafx.animation.KeyValue;
|
||||
import javafx.animation.Timeline;
|
||||
import javafx.application.Platform;
|
||||
import javafx.beans.binding.Bindings;
|
||||
import javafx.beans.property.DoubleProperty;
|
||||
import javafx.beans.property.SimpleDoubleProperty;
|
||||
@@ -14,7 +12,6 @@ import javafx.geometry.Bounds;
|
||||
import javafx.scene.control.SkinBase;
|
||||
import javafx.scene.control.ToggleButton;
|
||||
import javafx.scene.layout.HBox;
|
||||
import javafx.scene.layout.Priority;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.StackPane;
|
||||
import javafx.util.Duration;
|
||||
@@ -27,11 +24,8 @@ import javafx.util.Duration;
|
||||
*/
|
||||
public class RadioButtonGroupSkin extends SkinBase<RadioButtonGroup> {
|
||||
|
||||
/** 高度补偿 */
|
||||
private static final double HEIGHT_COMPENSATE = 2;
|
||||
|
||||
/** 动画时长 */
|
||||
private static final Duration SLIDER_DURATION = Duration.millis(180);
|
||||
private static final Duration SLIDER_DURATION = Duration.millis(320);
|
||||
|
||||
/** 按钮容器 */
|
||||
private final HBox box;
|
||||
@@ -159,25 +153,6 @@ public class RadioButtonGroupSkin extends SkinBase<RadioButtonGroup> {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新按钮尺寸策略
|
||||
*/
|
||||
private void refreshButtonSizing() {
|
||||
boolean sliderMode = getSkinnable().getMode() == RadioButtonGroup.Mode.SLIDER;
|
||||
for (ToggleButton button : getSkinnable().getButtons()) {
|
||||
button.setMinSize(Region.USE_PREF_SIZE, Region.USE_PREF_SIZE);
|
||||
button.setPrefHeight(Region.USE_COMPUTED_SIZE);
|
||||
if (sliderMode) {
|
||||
HBox.setHgrow(button, Priority.NEVER);
|
||||
button.setMaxWidth(Region.USE_PREF_SIZE);
|
||||
}
|
||||
else {
|
||||
HBox.setHgrow(button, Priority.ALWAYS);
|
||||
button.setMaxWidth(Double.MAX_VALUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 应用滑块位置和尺寸
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user