How to change formspec field highlight color?

Post Reply
isaiah658
Member
Posts: 168
Joined: Sun Jan 24, 2016 14:58
Contact:

How to change formspec field highlight color?

by isaiah658 » Post

Starting in Minetest 5.6.0, I've noticed all formspec field elements default to having a green background color when selected. Is there any way to change this color? The only workaround so far is to disable the entire border, but that's not what I want to do. This didn't happen in previous versions of Minetest.

User avatar
Desour
Member
Posts: 1469
Joined: Thu Jun 19, 2014 19:49
GitHub: Desour
IRC: Desour
In-game: DS
Location: I'm scared that if this is too exact, I will be unable to use my keyboard.

Re: How to change formspec field highlight color?

by Desour » Post

This probably has to do something with the irrlicht version. I think it's this color: <https://github.com/minetest/minetest/bl ... r.cpp#L176>
TBH, I don't remember how the background of a focused field element used to look like.
It doesn't look like there's a way to change the color using a mod. You could try to make a PR to extend the style element for this.
he/him; Codeberg; GitHub; ContentDB; public personal TODO list; "DS" is preferred (but often too short)

isaiah658
Member
Posts: 168
Joined: Sun Jan 24, 2016 14:58
Contact:

Re: How to change formspec field highlight color?

by isaiah658 » Post

Edit: I was wrong. It first started in 5.5.0. I think this is the change that made it happen. https://github.com/minetest/minetest/co ... bda7394d20

Hmm ok. I'll try to dig through the code to figure out if that is it or not. Below is a picture for reference of the before and after. It's the same thing for in-game formspecs. The old way was more neutral and didn't clash with other colors.
Example.png
Example.png (10.52 KiB) Viewed 616 times

User avatar
Blockhead
Member
Posts: 1622
Joined: Wed Jul 17, 2019 10:14
GitHub: Montandalar
IRC: Blockhead256
In-game: Blockhead Blockhead256
Location: Land Down Under
Contact:

Re: How to change formspec field highlight color?

by Blockhead » Post

I think it's good to have a distinction on the focused element and that green fits the default theme just fine, but I understand a lot of people would want to use different colours in their formspecs. What colour what you suggest instead?
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂

isaiah658
Member
Posts: 168
Joined: Sun Jan 24, 2016 14:58
Contact:

Re: How to change formspec field highlight color?

by isaiah658 » Post

It would probably be best to somehow allow styling the field colors with the style formspec element. But if that happened, I imagine the color when highlighting text would also be an issue. It could lead to some funky color combos.

User avatar
Desour
Member
Posts: 1469
Joined: Thu Jun 19, 2014 19:49
GitHub: Desour
IRC: Desour
In-game: DS
Location: I'm scared that if this is too exact, I will be unable to use my keyboard.

Re: How to change formspec field highlight color?

by Desour » Post

You could open a feature request, btw..
he/him; Codeberg; GitHub; ContentDB; public personal TODO list; "DS" is preferred (but often too short)

User avatar
sirrobzeroone
Member
Posts: 593
Joined: Mon Jul 16, 2018 07:56
GitHub: sirrobzeroone
Contact:

Re: How to change formspec field highlight color?

by sirrobzeroone » Post

I can't find the code at the moment, been too long since I looked but those fields can be styled. What I can't remeber is where the green came from just that it was irritating to find.

I'll have another dig tommorrow if this hasn't been answered/worked out :)

Edit: Think it's just add a styling element to the fields....Could of sworn green was stored somewhere....

Code: Select all

....
"style[creative_filter;border=false;textcolor=#7feef3;font=bold;font_size=+4]"..
"field[0.3,4.2;2.8,1.2;creative_filter;;" .. esc(inv.filter) .. "]"
..
Attachments
styled_search.PNG
styled_search.PNG (14.26 KiB) Viewed 502 times

Post Reply

Who is online

Users browsing this forum: Google [Bot], rudzik8 and 3 guests