void InfoBoxLook::Initialise(bool _inverse, bool use_colors, unsigned width) { inverse = _inverse; value.fg_color = title.fg_color = comment.fg_color = inverse ? COLOR_WHITE : COLOR_BLACK; background_color = inverse ? COLOR_BLACK : COLOR_WHITE; caption_background_color = inverse ? Color(0x40, 0x40, 0x40) : Color(0xe0, 0xe0, 0xe0); focused_background_color = COLOR_XCSOAR_LIGHT; pressed_background_color = COLOR_YELLOW; Color border_color = Color(128, 128, 128); border_pen.Create(BORDER_WIDTH, border_color); ReinitialiseLayout(width); unit_fraction_pen.Create(1, value.fg_color); colors[0] = border_color; if (HasColors() && use_colors) { colors[1] = inverse ? COLOR_INVERSE_RED : COLOR_RED; colors[2] = inverse ? COLOR_INVERSE_BLUE : COLOR_BLUE; colors[3] = inverse ? COLOR_INVERSE_GREEN : Color(0, 192, 0); colors[4] = inverse ? COLOR_INVERSE_YELLOW : COLOR_YELLOW; colors[5] = inverse ? COLOR_INVERSE_MAGENTA : COLOR_MAGENTA; } else std::fill(colors + 1, colors + 6, inverse ? COLOR_WHITE : COLOR_BLACK); }
void MainWindow::OnResize(PixelSize new_size) { Layout::Initialize(new_size, CommonInterface::GetUISettings().GetPercentScale()); SingleWindow::OnResize(new_size); ReinitialiseLayout(); const PixelRect rc = GetClientRect(); ButtonLabel::OnResize(rc); ProgressGlue::Move(rc); }
void MainWindow::OnResize(PixelSize new_size) { SingleWindow::OnResize(new_size); Layout::Initialize(new_size); ReinitialiseLayout(); if (map != NULL) { /* the map being created already is an indicator that XCSoar is running already, and so we assume the menu buttons have been created, too */ map->BringToBottom(); } const PixelRect rc = GetClientRect(); ButtonLabel::OnResize(rc); ProgressGlue::Move(rc); }
bool MainWindow::on_resize(unsigned width, unsigned height) { SingleWindow::on_resize(width, height); Layout::Initialize(width, height); ReinitialiseLayout(); if (map.defined()) { /* the map being created already is an indicator that XCSoar is running already, and so we assume the menu buttons have been created, too */ ButtonLabel::Destroy(); ButtonLabel::CreateButtonLabels(*this); ButtonLabel::SetFont(Fonts::MapBold); map.BringToBottom(); } return true; }