-
Notifications
You must be signed in to change notification settings - Fork 542
8358023: javafx.scene.control.ColorPicker configure size of squares in color pallet #1954
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
base: master
Are you sure you want to change the base?
Conversation
|
👋 Welcome back zelmidaoui! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
|
Question: should we make it a styleable property instead, so the application can configure it with CSS? |
|
Since this PR adds public API, it will need a CSR. And the new public methods will need API docs. You will also need to automated tests.
Yes, I think this would be best. /reviewers 2 |
|
@kevinrushforth |
|
@kevinrushforth has indicated that a compatibility and specification (CSR) request is needed for this pull request. @Ziad-Mid please create a CSR request for issue JDK-8358023 with the correct fix version. This pull request cannot be integrated until the CSR request is approved. |
|
I was about to try and figure out why the lack of javadoc comments didn't fail the build. Then I noticed that the class in question, That means that this PR doesn't actually provide the desired functionality as far as the application is concerned. This will need more work. I recommend moving it back to Draft until it is ready. |
Yes some of its styleable properties are present in modena.css and caspian.css - like So adding (an undocumented) styleable property to |
Ideally, everything used by
This highlights the inadequacy of these type of undocumented "back door" properties.
I'd prefer not to implement this enhancement by adding even more hidden, undocumented, CSS properties. How many such properties are there on ColorPickerSkin? Would it make sense to document them or would that open a larger can of worms? |
|
This is a good question. We already have a can of worms on our hands, so we need to figure out what to do with it. First of all, we should decide (speaking generally) what properties should be in the control, to be applied to all the possible skins, and which properties are specific to a particular Skin implementation. In this particular case, the size of the grid cell does not seem to belong to the control, it's clearly a property of the skin. Then, we need to decide whether we allow extending that particular skin, and the degree in which we allow this. We may want to document the structure (hierarchy and style classes) of the skin - maybe in cssref.html, or in the skin's javadoc or similar place (Example: VFlow:78). Or maybe even go further and design the skins explicitly to allow extension - using extendable classes and methods. Then, of course, there is a question of extending behavior and that's where the discussion stalls. What do you think? |
You are right. In this specific case, we have many color picker skin properties in Nothing at all about the popup or the palette.
Right. One thing to note is that if a property is in the skin, and we document it and provide public API in our skin implementation, we are effectively "suggesting" that all skins implement that property.
Perhaps, although there are many controls where sizing information is taken from the control. The most obvious example is text font and size for controls that have a label, which propagates from the control (Button, Label, ComboBox, etc) to the skin. That may or may not make a case for adding the size of the grid cell to the control.
Yes, this is the larger issue. Whatever we do would probably be limited to those attributes that are not overly specific to one particular skin implementation.
This would be a large effort, and probably not something we want to tackle.
Right. We are unlikely to address this any time soon. Getting back to this specific enhancement request, we seem to have a few options, presuming we want to provide this capability without having it blocked by a much larger effort:
|
|
Good points! I might suggest option 1 for this PR, with a follow-up created for improving CSS ref regarding the missing structure and styles (and maybe a discussion on the mailing list about what to document and where). I think we ought to document the default skin structure, but make it clear that the structure and the styles describe the default skin implementation for the purposes of styling. I don't know whether it makes sense to extract the skins css ref into a separate document or not - it might still be easier from the hosting point of view to keep everything in one place since we don't really have a proper CMS. |
|
I changed the status of the PR to draft as suggested to review the comments. |
Added new method
setSquareSize(double size)to be able to customize the size of squares inColorPalettewhich was previously hardcoded with a value 15Progress
Integration blocker
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/1954/head:pull/1954$ git checkout pull/1954Update a local copy of the PR:
$ git checkout pull/1954$ git pull https://git.openjdk.org/jfx.git pull/1954/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 1954View PR using the GUI difftool:
$ git pr show -t 1954Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/1954.diff
Using Webrev
Link to Webrev Comment