Open rock3r opened 8 months ago
@rock3r I have created a basic working implementation of segmented controls as seen below:
(Sorry for the poor quality image as it has been cropped.)
I would like to make a pull request, however, I have a couple of questions related to it:
SegmentedControl
or SegmentedButton
?Tabs
. However, in tabs, the TabStrip
element does not have any visual elements such as borders and backgrounds and therefore does not have a separate styling for it. In the case of segmented controls, the strip requires changing the border color depending on its state. So, should I create a separate style for it as well or should I just add extra color elements to the SegmentedButton
's style? Or should this feature be implemented in a different way?Hi @RivanParmar, thanks in advance for your contribution!
SegmentedControl
and its SegmentedControlButton
are separate (yet nested) components, I'd provide each with its own styling.@rock3r Thanks for clearing up the confusion. I will make the pull request after making the necessary changes. Also, could please let me know what colors to use for the different states of the buttons? I've looked into the Figma file but I couldn't find anything regarding it.
When we don't have specs from the Figma (and even when we do, just in case) we check the Swing implementation and use it as reference. This is essential because it'll tell you which theme keys to use in the bridge theme, and in turn you'd use those resolved colours/metrics in the standalone version.
Note that there are several instances where the Swing implementation can have hardcoded values/colours, and not use theme values. In these cases, copying the values from the relevant Swing Darcula*UI class is the only way. If you look at the bridge theme implementation, you'll see many such hardcoded values. This is why :)
Sorry for the late response. However, there are a few things that I'm unable to resolve:
SegmentedControl
. I've set an interactionSource
to it but it just doesn't seem to be getting the focus and so it's border's color isn't changing.content
color in the style to IntUiDarkTheme.colors.grey(12)
but still it doesn't work.@RivanParmar do you have any in-progress code we can look at? Hard to help otherwise...
@rock3r Please have a look at #387
@RivanParmar left you a few notes there!
Check specs and validate against Swing implementation.