From cc496af9b697280ed52205ca01904e155df7e82c Mon Sep 17 00:00:00 2001 From: Markus Pristovsek Date: Tue, 16 Jul 2024 04:03:09 +0000 Subject: [PATCH] Shrinking of banner width independent from button number git-svn-id: svn://tron.homeunix.org/simutrans/simutrans/trunk@11345 8aca7d54-2c30-db11-9de9-000461428c89 --- src/simutrans/gui/banner.cc | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/src/simutrans/gui/banner.cc b/src/simutrans/gui/banner.cc index 27df6a655a..4cd3d98046 100644 --- a/src/simutrans/gui/banner.cc +++ b/src/simutrans/gui/banner.cc @@ -59,6 +59,7 @@ class banner_text_t : public gui_component_t banner_t::banner_t() : gui_frame_t("") { set_table_layout(3,0); + gui_image_t* image1, *image2; add_table(1, 0); { // Continue game button now really continues the current game and not overwrite an ongoing game @@ -111,13 +112,11 @@ banner_t::banner_t() : gui_frame_t("") add_component( &install ); new_component(false, true); - if (D_BUTTONS_PER_ROW < 4) { // narrow screen - new_component()->set_image(skinverwaltung_t::logosymbol->get_image_id(0), true); - } - else { - new_component(); - } + image1 = new_component(); + image1->set_image(skinverwaltung_t::logosymbol->get_image_id(0), true); + image1->set_visible(false); + new_component(); // Quit button quit.init( button_t::roundbox | button_t::flexible, "Beenden"); @@ -152,9 +151,8 @@ banner_t::banner_t() : gui_frame_t("") } end_table(); new_component(); - if (D_BUTTONS_PER_ROW >= 4) { - new_component()->set_image(skinverwaltung_t::logosymbol->get_image_id(0), true); - } + image2 = new_component(); + image2->set_image(skinverwaltung_t::logosymbol->get_image_id(0), true); } end_table(); @@ -182,11 +180,29 @@ banner_t::banner_t() : gui_frame_t("") new_component(false, true); new_component(); new_component(false, true); - new_component(get_version(), SYSCOL_TEXT_HIGHLIGHT, gui_label_t::right)->set_shadow(SYSCOL_TEXT_SHADOW, true); + new_component("Version " VERSION_NUMBER, SYSCOL_TEXT_HIGHLIGHT, gui_label_t::right)->set_shadow(SYSCOL_TEXT_SHADOW, true); + new_component( + "" VERSION_DATE +#ifdef REVISION + " r" QUOTEME(REVISION) +#endif +#ifdef GIT_HASH + " hash " QUOTEME(GIT_HASH) +#endif +#if defined DEBUG +# define L_DEBUG_TEXT " (debug)" +#endif + , SYSCOL_TEXT_HIGHLIGHT, gui_label_t::right)->set_shadow(SYSCOL_TEXT_SHADOW, true); } end_table(); reset_min_windowsize(); + + if (get_windowsize().w > display_get_width()) { + image1->set_visible(true); + image2->set_visible(false); + reset_min_windowsize(); + } }