Closed xcfdszzr closed 2 years ago
use WebComboBox and WebPopupMenu ,I can't find any patterns that I need
for example
Due to complexity and some minor issues - popup menu styling haven't been switched to fully-customizable scheme yet, but it should be possible to modify it to make it look like on your 2nd screenshot.
As you correctly noticed - popupmenu
base style can be found in popupmenu.xml
:
https://github.com/mgarin/weblaf/blob/master/modules/ui/src/com/alee/skin/light/resources/popupmenu.xml
It does have a limited amount of settings though because it is based on a custom PopupMenuPainter
.
You can find all the properties you can specify in the popupmenu
style in these two classes:
https://github.com/mgarin/weblaf/blob/master/modules/ui/src/com/alee/laf/menu/PopupMenuPainter.java
https://github.com/mgarin/weblaf/blob/master/modules/ui/src/com/alee/laf/menu/AbstractPopupPainter.java
Also it is important to note that combobox uses it's own variation of popupmenu
style which can be found here:
https://github.com/mgarin/weblaf/blob/master/modules/ui/src/com/alee/skin/light/resources/combobox.xml#L90
It doesn't modify the base one visually though, but it can be helpful in case you want to modify only combobox popup menu.
In the future - current default painter (PopupMenuPainter
) will be replaced with a more customizable one to allow things like shape change, custom backgrounds, states support etc.
To add to my previous answer - you need these settings to specifically replicate popup from your screenshot:
<painter>
<popupStyle>simple</popupStyle>
<background>white</background>
<borderColor>white</borderColor>
<round>0</round>
<shadeWidth>6</shadeWidth>
<shadeOpacity>0.5</shadeOpacity>
<opacity>1</opacity>
</painter>
You can either apply these painter settings to default popupmenu
style, to the combobox
popup menu sub-style or to any other specific separate popupmenu
style with a custom identifier.
The original question should have been answered, so I'll be closing this issue