More sizing and centering.

This commit is contained in:
Juanjo
2013-07-27 22:03:06 +00:00
committed by pelya
parent 4c8c1ce146
commit 3f81edb664
18 changed files with 95 additions and 78 deletions

View File

@@ -2368,11 +2368,13 @@ void ShowGameSettings()
void DrawArrowButtons(int x, int y, Colours button_colour, byte state, bool clickable_left, bool clickable_right)
{
int colour = _colour_gradient[button_colour][2];
int half_button = SETTING_BUTTON_WIDTH / 2;
DrawFrameRect(x, y, x + SETTING_BUTTON_WIDTH / 2 - 1, y + SETTING_BUTTON_HEIGHT - 1, button_colour, (state == 1) ? FR_LOWERED : FR_NONE);
DrawFrameRect(x + SETTING_BUTTON_WIDTH / 2, y, x + SETTING_BUTTON_WIDTH - 1, y + SETTING_BUTTON_HEIGHT - 1, button_colour, (state == 2) ? FR_LOWERED : FR_NONE);
DrawSprite(SPR_ARROW_LEFT, PAL_NONE, x + WD_IMGBTN_LEFT, y + WD_IMGBTN_TOP);
DrawSprite(SPR_ARROW_RIGHT, PAL_NONE, x + WD_IMGBTN_LEFT + SETTING_BUTTON_WIDTH / 2, y + WD_IMGBTN_TOP);
DrawFrameRect(x, y, x + half_button - 1, y + SETTING_BUTTON_HEIGHT - 1, button_colour, (state == 1) ? FR_LOWERED : FR_NONE);
DrawFrameRect(x + half_button, y, x + SETTING_BUTTON_WIDTH - 1, y + SETTING_BUTTON_HEIGHT - 1, button_colour, (state == 2) ? FR_LOWERED : FR_NONE);
Dimension d = GetSpriteSize(SPR_ARROW_LEFT);
DrawSprite(SPR_ARROW_LEFT, PAL_NONE, Center(x, half_button, d.width), Center(y, SETTING_BUTTON_HEIGHT, d.height));
DrawSprite(SPR_ARROW_RIGHT, PAL_NONE, Center(x + half_button, half_button, d.width), Center(y, SETTING_BUTTON_HEIGHT, d.height));
/* Grey out the buttons that aren't clickable */
bool rtl = _current_text_dir == TD_RTL;