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

CSS Customization of MFXFilterComboBox #173

Closed
todayifeeltired opened this issue Apr 7, 2022 · 8 comments
Closed

CSS Customization of MFXFilterComboBox #173

todayifeeltired opened this issue Apr 7, 2022 · 8 comments
Labels
bug Something isn't working css Everything related to css

Comments

@todayifeeltired
Copy link

todayifeeltired commented Apr 7, 2022

I just might not be able to do it, but how can i (for example) change the color of the popup-background?
i saw that you listed the css-selectors, but i just dont get it

<MFXFilterComboBox styleClass="filterableComboBox"> </MFXFilterComboBox>

do i have to set a custom styleclass?
if yes (or no) how can i access .mfx-combo-box .combo-popup in my styleclass?

update: i got how to access .mfx-combo-box .combo-popup, BUT:
the items, the searchfield is now in "dark mode" but there is still a border around it or a pane that still is white and i dont know to access it

i got (quick & dirty)
`.mfx-filter-combo-box {
-fx-text-fill: white;
-fx-background-color: derive(rgb(50, 50, 50), 20%);
-mfx-caret-visible: false;
}

.mfx-filter-combo-box .combo-popup .virtual-flow {
-fx-background-color: transparent;
-fx-background-radius: 0;
-fx-max-height: 400;
-fx-min-height: 400;
-fx-min-width: 300;
-fx-max-width: 300;
}

.mfx-filter-combo-box .combo-popup .search-field {
-fx-background-color: derive(rgb(50, 50, 50), 20%);
-fx-text-fill: white;
-mfx-gap: 0;
-mfx-float-mode: disabled;
-fx-padding: 5;
-fx-display-caret: false;
}

.mfx-combo-box .combo-popup .virtual-flow .mfx-combo-box-cell {
-fx-background-color: derive(rgb(50, 50, 50), 20%);
}

.mfx-combo-box .combo-popup .virtual-flow .data-label {
-fx-text-fill: white;
}`

update 2:
the problem seems to be "mfx-filter-combo-box .combo-popup .search-container":
as in issue #131, if i give this id to my combobox, the styling works

@palexdev
Copy link
Owner

palexdev commented Apr 8, 2022

I can confirm the issue but I have no idea on how to fix it yet, it seems like the combo box stylesheet is always prioritized over everything else for some reason

@palexdev palexdev added bug Something isn't working css Everything related to css labels Apr 8, 2022
@todayifeeltired
Copy link
Author

is it possible to just delete your combo-box stylesheet and i can set my own?

@palexdev
Copy link
Owner

palexdev commented Apr 9, 2022

No it's not possible because that stylesheet is the userAgentStylesheet

@palexdev
Copy link
Owner

palexdev commented Apr 9, 2022

@todayifeeltired
I arranged a fix hoping that it won't happen anymore in any other situation
This is what I've achieved
image

This is the CSS I've used:

.mfx-filter-combo-box {
	-fx-background-color: derive(#323232, 20%);
	-fx-border-color: transparent;
	-mfx-caret-visible: false;
	-mfx-float-mode: disabled;
	-fx-text-fill: white;
}

.mfx-filter-combo-box .caret .mfx-ripple-generator {
	-mfx-ripple-color: rgba(255, 255, 255, 0.2);
}

.mfx-filter-combo-box .caret .mfx-font-icon {
	-mfx-color: white
}

.mfx-filter-combo-box .combo-popup .search-container {
	-fx-background-color: derive(#323232, 20%);
	-fx-background-radius: 5;
	-fx-border-color: transparent;
	-fx-padding: 10 5 5 5;
}

.mfx-filter-combo-box .combo-popup .search-field {
	-fx-background-color: derive(#323232, 20%);
	-fx-text-fill: white;
}

.mfx-filter-combo-box .combo-popup .search-field .text-field {
	-fx-prompt-text-fill: #ebebeb;
}

.mfx-filter-combo-box .combo-popup .virtual-flow {
	-fx-background-color: transparent;
}

.mfx-filter-combo-box .combo-popup .virtual-flow .mfx-combo-box-cell .data-label {
	-fx-text-fill: white;
}

.mfx-filter-combo-box .combo-popup .virtual-flow .mfx-combo-box-cell:hover {
	-fx-background-color: white;
}

.mfx-filter-combo-box .combo-popup .virtual-flow .mfx-combo-box-cell:hover .data-label {
	-fx-text-fill: rgba(0, 0, 0, 0.87);
}

.mfx-filter-combo-box .combo-popup .virtual-flow .mfx-combo-box-cell:selected {
	-fx-background-color: white;
}

.mfx-filter-combo-box .combo-popup .virtual-flow .mfx-combo-box-cell:selected .data-label {
	-fx-text-fill: rgb(0, 0, 0, 0.87);
}

A little bit of patience though, there are some other minor fixes to do before releasing the new minor version

@todayifeeltired
Copy link
Author

thank you very much!
looked at the screenshot and it really looks beautiful.
do you have an idea when the release is planned for or should it already be working?
Thanks again!

@palexdev
Copy link
Owner

Thank you for using MaterialFX

I'd say as soon as #174 provides a MRE so that I can fix it. I hope for today though

palexdev added a commit that referenced this issue Apr 11, 2022
Controls Package
:bug: MFXTextField: fixed TextFormatter not working. It must be added on the BoundTextField, for this reason, added a delegate property (Fix for #174)

CSS Package
:recycle: MFXCSSBridge: do not take into account the Region's user agent stylesheet. If it's needed to specify the user agent the popup's getUserAgentStylesheet() method should be overridden inline, as well as for any other component that mey require it (see MFXComboBoxSkin as an example) (Fix for #173)

Selection Package
:recycle: Adds a method to retrieve the selection values as a List (rather than getSelection().values() which returns a generic Collection). Also make MultipleSelectionManager use LinkedHashSet and LinkedHashMap (TreeMap was used, oversight sorry) to keep insertion order for selection, this also ensures that building the values List returns the selected values in the same exact order as in the selection Map (Enhancement for #161)

Skins Package
:bug: MFXComboBoxSkin, MFXFilterComboBoxSkin: fixed an issue that prevented the combo box's popup from being fully customizable with CSS (Fix for #173)
:bug: MFXDatePickerSkin: initialize the picker's text if the initial date is not null (Fix for #172)

Signed-off-by: palexdev <alessandro.parisi406@gmail.com>
@palexdev
Copy link
Owner

Version 11.13.5 is now available hope it works well now, let me know!

@todayifeeltired
Copy link
Author

thanks for keeping me updatet :)
it works fine and i am very happy about/with it!
thanks for the work you put it !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working css Everything related to css
Projects
None yet
Development

No branches or pull requests

2 participants