1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Add more visual feedback for button states (#8916)

- Add style properties for overriding the the hovered/pressed state
  - By default, hovered buttons are a lighter version of the base color
  - By default, pressed buttons are a darker version of the base color
- Add hovered bg image support for image buttons (style property)
This commit is contained in:
Hugues Ross 2019-10-12 12:44:23 -04:00 committed by SmallJoker
parent 894008ce6f
commit 69a2099c04
10 changed files with 151 additions and 39 deletions

View file

@ -18,6 +18,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "guiPasswordChange.h"
#include "client/client.h"
#include "guiButton.h"
#include <IGUICheckBox.h>
#include <IGUIEditBox.h>
#include <IGUIButton.h>
@ -145,14 +146,14 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize)
core::rect<s32> rect(0, 0, 100 * s, 30 * s);
rect = rect + v2s32(size.X / 4 + 56 * s, ypos);
text = wgettext("Change");
Environment->addButton(rect, this, ID_change, text);
GUIButton::addButton(Environment, rect, this, ID_change, text);
delete[] text;
}
{
core::rect<s32> rect(0, 0, 100 * s, 30 * s);
rect = rect + v2s32(size.X / 4 + 185 * s, ypos);
text = wgettext("Cancel");
Environment->addButton(rect, this, ID_cancel, text);
GUIButton::addButton(Environment, rect, this, ID_cancel, text);
delete[] text;
}