| 218 | } |
| 219 | |
| 220 | void GuiIconButtonCtrl::renderButton( Point2I &offset, const RectI& updateRect ) |
| 221 | { |
| 222 | bool highlight = mHighlighted; |
| 223 | bool depressed = mDepressed; |
| 224 | |
| 225 | ColorI fontColor = mActive ? (highlight ? mProfile->mFontColorHL : mProfile->mFontColor) : mProfile->mFontColorNA; |
| 226 | |
| 227 | RectI boundsRect(offset, getExtent()); |
| 228 | |
| 229 | GFXDrawUtil *drawer = GFX->getDrawUtil(); |
| 230 | |
| 231 | if (mDepressed || mStateOn) |
| 232 | { |
| 233 | // If there is a bitmap array then render using it. |
| 234 | // Otherwise use a standard fill. |
| 235 | if(mProfile->mUseBitmapArray && mProfile->mBitmapArrayRects.size()) |
| 236 | renderBitmapArray(boundsRect, statePressed); |
| 237 | else |
| 238 | renderSlightlyLoweredBox(boundsRect, mProfile); |
| 239 | } |
| 240 | else if(mHighlighted && mActive) |
| 241 | { |
| 242 | // If there is a bitmap array then render using it. |
| 243 | // Otherwise use a standard fill. |
| 244 | if (mProfile->mUseBitmapArray && mProfile->mBitmapArrayRects.size()) |
| 245 | { |
| 246 | renderBitmapArray(boundsRect, stateMouseOver); |
| 247 | } |
| 248 | else |
| 249 | { |
| 250 | drawer->drawRectFill(boundsRect, mProfile->mFillColorHL); |
| 251 | drawer->drawRect(boundsRect, mProfile->mBorderColorHL); |
| 252 | } |
| 253 | } |
| 254 | else |
| 255 | { |
| 256 | // If there is a bitmap array then render using it. |
| 257 | // Otherwise use a standard fill. |
| 258 | if(mProfile->mUseBitmapArray && mProfile->mBitmapArrayRects.size()) |
| 259 | { |
| 260 | if(mActive) |
| 261 | renderBitmapArray(boundsRect, stateNormal); |
| 262 | else |
| 263 | renderBitmapArray(boundsRect, stateDisabled); |
| 264 | } |
| 265 | else |
| 266 | { |
| 267 | if (mActive) |
| 268 | { |
| 269 | drawer->drawRectFill(boundsRect, mProfile->mFillColor); |
| 270 | drawer->drawRect(boundsRect, mProfile->mBorderColor); |
| 271 | } |
| 272 | else |
| 273 | { |
| 274 | drawer->drawRectFill(boundsRect, mProfile->mFillColorNA); |
| 275 | drawer->drawRect(boundsRect, mProfile->mBorderColorNA); |
| 276 | } |
| 277 | } |
nothing calls this directly
no test coverage detected