forked from Mirrorlandia_minetest/irrlicht
Listbox items can now change individual background colors
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6453 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
parent
b4b28c367c
commit
75d485b5cd
@ -1,6 +1,7 @@
|
|||||||
--------------------------
|
--------------------------
|
||||||
Changes in 1.9 (not yet released)
|
Changes in 1.9 (not yet released)
|
||||||
|
|
||||||
|
- Listbox items can now change individual background colors
|
||||||
- Fix some bitfield sizes in SMaterial which were chosen too small for enums (PolygonOffsetDirection, ZWriteEnable, BlendOperation)
|
- Fix some bitfield sizes in SMaterial which were chosen too small for enums (PolygonOffsetDirection, ZWriteEnable, BlendOperation)
|
||||||
- Add ISceneNode::UpdateAbsolutePosBehavior variable to allow nodes to ignore the scale/rotation parts of their parents transformation.
|
- Add ISceneNode::UpdateAbsolutePosBehavior variable to allow nodes to ignore the scale/rotation parts of their parents transformation.
|
||||||
- Add IGUISpinBox functions getValueFor and getOldValue
|
- Add IGUISpinBox functions getValueFor and getOldValue
|
||||||
|
@ -26,6 +26,11 @@ namespace gui
|
|||||||
EGUI_LBC_ICON,
|
EGUI_LBC_ICON,
|
||||||
//! Color of selected icon
|
//! Color of selected icon
|
||||||
EGUI_LBC_ICON_HIGHLIGHT,
|
EGUI_LBC_ICON_HIGHLIGHT,
|
||||||
|
//! Color of background.
|
||||||
|
//! Note that this one is drawn over the listbox background and when not used there is no other default
|
||||||
|
EGUI_LBC_BACKGROUND,
|
||||||
|
//! Color of selected background
|
||||||
|
EGUI_LBC_BACKGROUND_HIGHLIGHT,
|
||||||
//! Not used, just counts the number of available colors
|
//! Not used, just counts the number of available colors
|
||||||
EGUI_LBC_COUNT
|
EGUI_LBC_COUNT
|
||||||
};
|
};
|
||||||
|
@ -528,7 +528,13 @@ void CGUIListBox::draw()
|
|||||||
frameRect.UpperLeftCorner.Y <= AbsoluteRect.LowerRightCorner.Y)
|
frameRect.UpperLeftCorner.Y <= AbsoluteRect.LowerRightCorner.Y)
|
||||||
{
|
{
|
||||||
if (i == Selected && hl)
|
if (i == Selected && hl)
|
||||||
skin->draw2DRectangle(this, skin->getColor(EGDC_HIGH_LIGHT), frameRect, &clientClip);
|
{
|
||||||
|
skin->draw2DRectangle(this, hasItemOverrideColor(i, EGUI_LBC_BACKGROUND_HIGHLIGHT) ? getItemOverrideColor(i, EGUI_LBC_BACKGROUND_HIGHLIGHT) : getItemDefaultColor(EGUI_LBC_BACKGROUND_HIGHLIGHT), frameRect, &clientClip);
|
||||||
|
}
|
||||||
|
else if ( hasItemOverrideColor(i, EGUI_LBC_BACKGROUND ) )
|
||||||
|
{
|
||||||
|
skin->draw2DRectangle(this, getItemOverrideColor(i, EGUI_LBC_BACKGROUND), frameRect, &clientClip);
|
||||||
|
}
|
||||||
|
|
||||||
core::rect<s32> textRect = frameRect;
|
core::rect<s32> textRect = frameRect;
|
||||||
textRect.UpperLeftCorner.X += 3;
|
textRect.UpperLeftCorner.X += 3;
|
||||||
@ -671,6 +677,14 @@ bool CGUIListBox::getSerializationLabels(EGUI_LISTBOX_COLOR colorType, core::str
|
|||||||
useColorLabel = "UseColIconHl";
|
useColorLabel = "UseColIconHl";
|
||||||
colorLabel = "ColIconHl";
|
colorLabel = "ColIconHl";
|
||||||
break;
|
break;
|
||||||
|
case EGUI_LBC_BACKGROUND:
|
||||||
|
useColorLabel = "UseColBg";
|
||||||
|
colorLabel = "ColBg";
|
||||||
|
break;
|
||||||
|
case EGUI_LBC_BACKGROUND_HIGHLIGHT:
|
||||||
|
useColorLabel = "UseColBgHl";
|
||||||
|
colorLabel = "ColBgHl";
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -887,6 +901,10 @@ video::SColor CGUIListBox::getItemDefaultColor(EGUI_LISTBOX_COLOR colorType) con
|
|||||||
return skin->getColor(EGDC_ICON);
|
return skin->getColor(EGDC_ICON);
|
||||||
case EGUI_LBC_ICON_HIGHLIGHT:
|
case EGUI_LBC_ICON_HIGHLIGHT:
|
||||||
return skin->getColor(EGDC_ICON_HIGH_LIGHT);
|
return skin->getColor(EGDC_ICON_HIGH_LIGHT);
|
||||||
|
case EGUI_LBC_BACKGROUND:
|
||||||
|
return skin->getColor(EGDC_3D_HIGH_LIGHT);
|
||||||
|
case EGUI_LBC_BACKGROUND_HIGHLIGHT:
|
||||||
|
return skin->getColor(EGDC_HIGH_LIGHT);
|
||||||
default:
|
default:
|
||||||
return video::SColor();
|
return video::SColor();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user