src/widget.cpp
changeset 8335 09a2e049b3a8
parent 8320 5a41b1329cdf
child 8349 e61105cb1f87
equal deleted inserted replaced
8334:9c2b712806a5 8335:09a2e049b3a8
   470 			}
   470 			}
   471 
   471 
   472 			DrawStringCenteredTruncated(r.left + 2, r.right - 2, r.top + 2, wi->data, 0x84);
   472 			DrawStringCenteredTruncated(r.left + 2, r.right - 2, r.top + 2, wi->data, 0x84);
   473 			break;
   473 			break;
   474 		}
   474 		}
       
   475 
       
   476 		case WWT_DROPDOWN: {
       
   477 			assert(r.bottom - r.top == 11); // ensure consistent size
       
   478 
       
   479 			StringID str = wi->data;
       
   480 			DrawFrameRect(r.left, r.top, r.right - 12, r.bottom, wi->color, FR_NONE);
       
   481 			DrawFrameRect(r.right - 11, r.top, r.right, r.bottom, wi->color, clicked ? FR_LOWERED : FR_NONE);
       
   482 			DrawString(r.right - (clicked ? 8 : 9), r.top + (clicked ? 2 : 1), STR_0225, TC_BLACK);
       
   483 			if (str != STR_NULL) DrawStringTruncated(r.left + 2, r.top + 1, str, TC_BLACK, r.right - r.left - 12);
       
   484 			break;
       
   485 		}
       
   486 
       
   487 		case WWT_DROPDOWNIN: {
       
   488 			assert(r.bottom - r.top == 11); // ensure consistent size
       
   489 
       
   490 			StringID str = wi->data;
       
   491 			DrawFrameRect(r.left, r.top, r.right, r.bottom, wi->color, FR_LOWERED | FR_DARKENED);
       
   492 			DrawFrameRect(r.right - 11, r.top + 1, r.right - 1, r.bottom - 1, wi->color, clicked ? FR_LOWERED : FR_NONE);
       
   493 			DrawString(r.right - (clicked ? 8 : 9), r.top + (clicked ? 2 : 1), STR_0225, TC_BLACK);
       
   494 			if (str != STR_NULL) DrawStringTruncated(r.left + 2, r.top + 2, str, TC_BLACK, r.right - r.left - 12);
       
   495 			break;
       
   496 		}
   475 		}
   497 		}
   476 
   498 
   477 		if (w->IsWidgetDisabled(i)) {
   499 		if (w->IsWidgetDisabled(i)) {
   478 			GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, _colour_gradient[wi->color & 0xF][2] | (1 << PALETTE_MODIFIER_GREYOUT));
   500 			GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, _colour_gradient[wi->color & 0xF][2] | (1 << PALETTE_MODIFIER_GREYOUT));
   479 		}
   501 		}