← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~widelands-dev/widelands/bug-1818013-new-logo into lp:widelands

 

GunChleoc has proposed merging lp:~widelands-dev/widelands/bug-1818013-new-logo into lp:widelands.

Commit message:
New Widelands logo by Nytren. Add it as an icon rather than an overlay for more fine-grained positioning.

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1818013 in widelands: "New Widelands text logo"
  https://bugs.launchpad.net/widelands/+bug/1818013

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bug-1818013-new-logo/+merge/366502
-- 
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1818013-new-logo into lp:widelands.
=== renamed file 'data/images/ui_fsmenu/main_title.png' => 'data/images/ui_fsmenu/main_title.png.OTHER'
Binary files data/images/ui_fsmenu/main_title.png	2019-03-30 06:46:25 +0000 and data/images/ui_fsmenu/main_title.png.OTHER	2019-04-25 08:14:19 +0000 differ
=== modified file 'src/ui_basic/icon.cc'
--- src/ui_basic/icon.cc	2019-02-23 11:00:49 +0000
+++ src/ui_basic/icon.cc	2019-04-25 08:14:19 +0000
@@ -35,6 +35,12 @@
 	set_thinks(false);
 }
 
+
+Icon::Icon(Panel* const parent,
+           const Image* picture_id)
+   : Icon(parent, 0, 0, picture_id->width(), picture_id->height(), picture_id) {
+}
+
 void Icon::set_icon(const Image* picture_id) {
 	pic_ = picture_id;
 }

=== modified file 'src/ui_basic/icon.h'
--- src/ui_basic/icon.h	2019-02-23 11:00:49 +0000
+++ src/ui_basic/icon.h	2019-04-25 08:14:19 +0000
@@ -30,7 +30,11 @@
  * bigger than the icon, the image will be scaled to fit.
  */
 struct Icon : public Panel {
+	/// Create a new icon with the given dimensions and position offset
 	Icon(Panel* parent, int32_t x, int32_t y, int32_t w, int32_t h, const Image* picture_id);
+	/// Create a new icon with no offset. Dimentions are taken from 'picture_id'.
+	Icon(Panel* parent, const Image* picture_id);
+
 
 	void set_icon(const Image* picture_id);
 	const Image* icon() const {

=== modified file 'src/ui_fsmenu/main.cc'
--- src/ui_fsmenu/main.cc	2019-04-11 05:45:55 +0000
+++ src/ui_fsmenu/main.cc	2019-04-25 08:14:19 +0000
@@ -27,6 +27,8 @@
 FullscreenMenuMain::FullscreenMenuMain()
    : FullscreenMenuMainMenu(),
 
+	 logo_icon_(this, g_gr->images().get("images/ui_fsmenu/main_title.png")),
+
      // Buttons
      playtutorial(&vbox_,
                   "play_tutorial",
@@ -107,9 +109,6 @@
 	vbox_.add_inf_space();
 	vbox_.add(&exit, UI::Box::Resizing::kFullSize);
 
-	add_overlay_image("images/ui_fsmenu/main_title.png",
-	                  FullscreenWindow::Alignment(UI::Align::kCenter, UI::Align::kTop));
-
 	layout();
 }
 
@@ -119,6 +118,9 @@
 
 void FullscreenMenuMain::layout() {
 	FullscreenMenuMainMenu::layout();
+
+	logo_icon_.set_pos(Vector2i((get_w() - logo_icon_.get_w()) / 2, title_y_ + logo_icon_.get_h() / 4));
+
 	const int text_height = 0.5 * version.get_h() + padding_;
 	version.set_pos(Vector2i(get_w() - version.get_w(), get_h() - text_height));
 	copyright.set_pos(Vector2i(0, get_h() - 2 * text_height));
@@ -133,9 +135,7 @@
 	about.set_desired_size(butw_, buth_);
 	exit.set_desired_size(butw_, buth_);
 
-	// This box needs to be positioned a bit higher than in the other menus, because we have a lot of
-	// buttons
-	vbox_.set_pos(Vector2i(box_x_, box_y_ - buth_));
+	vbox_.set_pos(Vector2i(box_x_, box_y_));
 	vbox_.set_inner_spacing(padding_);
 	vbox_.set_size(butw_, get_h() - vbox_.get_y() - 5 * padding_);
 }

=== modified file 'src/ui_fsmenu/main.h'
--- src/ui_fsmenu/main.h	2019-02-23 11:00:49 +0000
+++ src/ui_fsmenu/main.h	2019-04-25 08:14:19 +0000
@@ -21,6 +21,7 @@
 #define WL_UI_FSMENU_MAIN_H
 
 #include "ui_basic/button.h"
+#include "ui_basic/icon.h"
 #include "ui_basic/textarea.h"
 #include "ui_fsmenu/main_menu.h"
 
@@ -38,6 +39,7 @@
 private:
 	void layout() override;
 
+	UI::Icon logo_icon_;
 	UI::Button playtutorial;
 	UI::Button singleplayer;
 	UI::Button multiplayer;


Follow ups