For luminos skin use a copy of the Close button and set the proper offset (previously the image itself had the offset)
Add Clear buttons to the other 2 skins (a copy of the Close button for Xaw and the middle part of a checkbox for Default skin, this one not very nice tbh)
14 files changed:
COLOR_INPUTBOX_N '1 1 1'
COLOR_INPUTBOX_F '1 1 1'
MARGIN_INPUTBOX_CHARS 1
COLOR_INPUTBOX_N '1 1 1'
COLOR_INPUTBOX_F '1 1 1'
MARGIN_INPUTBOX_CHARS 1
// item: key grabber
COLOR_KEYGRABBER_TITLES '1 1 1'
// item: key grabber
COLOR_KEYGRABBER_TITLES '1 1 1'
COLOR_INPUTBOX_N '1 1 1'
COLOR_INPUTBOX_F '1 1 1'
MARGIN_INPUTBOX_CHARS 1
COLOR_INPUTBOX_N '1 1 1'
COLOR_INPUTBOX_F '1 1 1'
MARGIN_INPUTBOX_CHARS 1
// item: key grabber
COLOR_KEYGRABBER_TITLES '1 1 1'
// item: key grabber
COLOR_KEYGRABBER_TITLES '1 1 1'
COLOR_INPUTBOX_N '1 1 1'
COLOR_INPUTBOX_F '1 1 1'
MARGIN_INPUTBOX_CHARS 1
COLOR_INPUTBOX_N '1 1 1'
COLOR_INPUTBOX_F '1 1 1'
MARGIN_INPUTBOX_CHARS 1
// item: key grabber
COLOR_KEYGRABBER_TITLES '1 1 1'
// item: key grabber
COLOR_KEYGRABBER_TITLES '1 1 1'
ATTRIB(InputBox, enableClearButton, float, 1)
ATTRIB(InputBox, clearButton, entity, NULL)
ATTRIB(InputBox, cb_size, vector, '0 0 0')
ATTRIB(InputBox, enableClearButton, float, 1)
ATTRIB(InputBox, clearButton, entity, NULL)
ATTRIB(InputBox, cb_size, vector, '0 0 0')
+ ATTRIB(InputBox, cb_offset, float, SKINOFFSET_CLEARBUTTON) // bound to range -1, 0
ATTRIB(InputBox, cb_pressed, float, 0)
ATTRIB(InputBox, cb_focused, float, 0)
ATTRIB(InputBox, cb_src, string, SKINGFX_CLEARBUTTON)
ATTRIB(InputBox, cb_pressed, float, 0)
ATTRIB(InputBox, cb_focused, float, 0)
ATTRIB(InputBox, cb_src, string, SKINGFX_CLEARBUTTON)
if (me.enableClearButton)
{
me.cb_size = eX * (absSize_y / absSize_x) + eY;
if (me.enableClearButton)
{
me.cb_size = eX * (absSize_y / absSize_x) + eY;
- me.keepspaceRight = me.keepspaceRight + me.cb_size_x;
+ me.cb_offset = bound(-1, me.cb_offset, 0) * me.cb_size_x; // bound to range -1, 0
+ me.keepspaceRight = me.keepspaceRight - me.cb_offset + me.cb_size_x;
float over_ClearButton(entity me, vector pos)
{
float over_ClearButton(entity me, vector pos)
{
- if (pos_x >= 1 - me.cb_size_x)
- if (pos_x < 1)
+ if (pos_x >= 1 + me.cb_offset - me.cb_size_x)
+ if (pos_x < 1 + me.cb_offset)
if (pos_y >= 0)
if (pos_y < me.cb_size_y)
return 1;
if (pos_y >= 0)
if (pos_y < me.cb_size_y)
return 1;
if (me.text != "")
{
if(me.focused && me.cb_pressed)
if (me.text != "")
{
if(me.focused && me.cb_pressed)
- draw_Picture('1 1 0' - me.cb_size, strcat(me.cb_src, "_c"), me.cb_size, '1 1 1', 1);
+ draw_Picture('1 1 0' + eX * me.cb_offset - me.cb_size, strcat(me.cb_src, "_c"), me.cb_size, '1 1 1', 1);
else if(me.focused && me.cb_focused)
else if(me.focused && me.cb_focused)
- draw_Picture('1 1 0' - me.cb_size, strcat(me.cb_src, "_f"), me.cb_size, '1 1 1', 1);
+ draw_Picture('1 1 0' + eX * me.cb_offset - me.cb_size, strcat(me.cb_src, "_f"), me.cb_size, '1 1 1', 1);
- draw_Picture('1 1 0' - me.cb_size, strcat(me.cb_src, "_n"), me.cb_size, '1 1 1', 1);
+ draw_Picture('1 1 0' + eX * me.cb_offset - me.cb_size, strcat(me.cb_src, "_n"), me.cb_size, '1 1 1', 1);
SKINVECTOR(COLOR_INPUTBOX_N, '1 1 1');
SKINVECTOR(COLOR_INPUTBOX_F, '1 1 1');
SKINSTRING(GFX_CLEARBUTTON, "clearbutton");
SKINVECTOR(COLOR_INPUTBOX_N, '1 1 1');
SKINVECTOR(COLOR_INPUTBOX_F, '1 1 1');
SKINSTRING(GFX_CLEARBUTTON, "clearbutton");
+ SKINFLOAT(OFFSET_CLEARBUTTON, 0);
SKINFLOAT(MARGIN_INPUTBOX_CHARS, 1);
// item: key grabber
SKINFLOAT(MARGIN_INPUTBOX_CHARS, 1);
// item: key grabber