Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: colorpicker move on input #656

Merged
merged 15 commits into from
Mar 12, 2024
Merged
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import com.oracle.javafx.scenebuilder.kit.util.control.paintpicker.gradientpicker.GradientPickerStop;
import javafx.beans.value.ChangeListener;
import javafx.event.ActionEvent;
import javafx.event.Event;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.geometry.Bounds;
Expand All @@ -48,7 +49,9 @@
import javafx.scene.control.TextField;
import javafx.scene.input.Clipboard;
import javafx.scene.input.ClipboardContent;
import javafx.scene.input.KeyEvent;
import javafx.scene.input.MouseEvent;
import javafx.scene.input.ScrollEvent;
import javafx.scene.layout.Region;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
Expand Down Expand Up @@ -155,6 +158,7 @@ private void initialize() {
assert green_textfield != null;
assert blue_textfield != null;
assert alpha_slider != null;
assert picker_scrollpane != null;

hue_slider.setStyle(makeHueSliderCSS()); // Make the grad for hue slider

Expand Down Expand Up @@ -252,6 +256,11 @@ private void initialize() {
picker_region.pressedProperty().addListener(liveUpdateListener);
hue_slider.pressedProperty().addListener(liveUpdateListener);
alpha_slider.pressedProperty().addListener(liveUpdateListener);

// Fix ColorPicker movement on focus. Now blocks scroll and key events (Home, End, PgUp, PgDn, arrows) to keep it static. For issue #654.
leewyatt marked this conversation as resolved.
Show resolved Hide resolved
picker_scrollpane.addEventFilter(KeyEvent.ANY, Event::consume);
picker_scrollpane.addEventFilter(ScrollEvent.SCROLL, Event::consume);

// paint combobox add values
paintCombobox.getItems().setAll(CSS_CODE, JAVA_CODE);
paintCombobox.getSelectionModel().select(0);
Expand Down