summaryrefslogtreecommitdiff
path: root/editor/editor_about.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_about.cpp')
-rw-r--r--editor/editor_about.cpp60
1 files changed, 36 insertions, 24 deletions
diff --git a/editor/editor_about.cpp b/editor/editor_about.cpp
index a48e6c9057..9ab539da07 100644
--- a/editor/editor_about.cpp
+++ b/editor/editor_about.cpp
@@ -5,8 +5,8 @@
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -27,7 +27,9 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+
#include "editor_about.h"
+#include "editor_node.h"
#include "authors.gen.h"
#include "donors.gen.h"
@@ -35,10 +37,23 @@
#include "version.h"
#include "version_hash.gen.h"
+void EditorAbout::_notification(int p_what) {
+
+ switch (p_what) {
+
+ case NOTIFICATION_ENTER_TREE:
+ case NOTIFICATION_THEME_CHANGED: {
+
+ Ref<Font> font = EditorNode::get_singleton()->get_gui_base()->get_font("source", "EditorFonts");
+ _tpl_text->add_font_override("normal_font", font);
+ _license_text->add_font_override("normal_font", font);
+ } break;
+ }
+}
+
void EditorAbout::_license_tree_selected() {
TreeItem *selected = _tpl_tree->get_selected();
- _tpl_text->select(0, 0, 0, 0);
_tpl_text->set_text(selected->get_metadata(0));
}
@@ -52,7 +67,7 @@ TextureRect *EditorAbout::get_logo() const {
return _logo;
}
-ScrollContainer *EditorAbout::_populate_list(const String &p_name, const List<String> &p_sections, const char **p_src[]) {
+ScrollContainer *EditorAbout::_populate_list(const String &p_name, const List<String> &p_sections, const char **p_src[], const int p_flag_single_column) {
ScrollContainer *sc = memnew(ScrollContainer);
sc->set_name(p_name);
@@ -64,6 +79,7 @@ ScrollContainer *EditorAbout::_populate_list(const String &p_name, const List<St
for (int i = 0; i < p_sections.size(); i++) {
+ bool single_column = p_flag_single_column & 1 << i;
const char **names_ptr = p_src[i];
if (*names_ptr) {
@@ -72,17 +88,16 @@ ScrollContainer *EditorAbout::_populate_list(const String &p_name, const List<St
vbc->add_child(lbl);
ItemList *il = memnew(ItemList);
- il->set_max_columns(16);
il->set_h_size_flags(Control::SIZE_EXPAND_FILL);
il->set_same_column_width(true);
il->set_auto_height(true);
+ il->set_mouse_filter(Control::MOUSE_FILTER_IGNORE);
+ il->add_constant_override("hseparation", 16 * EDSCALE);
while (*names_ptr) {
il->add_item(String::utf8(*names_ptr++), NULL, false);
}
+ il->set_max_columns(il->get_item_count() < 4 || single_column ? 1 : 16);
vbc->add_child(il);
- if (il->get_item_count() == 2) {
- il->set_fixed_column_width(200 * EDSCALE);
- }
HSeparator *hs = memnew(HSeparator);
hs->set_modulate(Color(0, 0, 0, 0));
@@ -117,7 +132,8 @@ EditorAbout::EditorAbout() {
Label *about_text = memnew(Label);
about_text->set_v_size_flags(Control::SIZE_SHRINK_CENTER);
- about_text->set_text(VERSION_FULL_NAME + hash + String::utf8("\n\u00A9 2007-2017 Juan Linietsky, Ariel Manzur.\n\u00A9 2014-2017 ") +
+ about_text->set_text(VERSION_FULL_NAME + hash +
+ String::utf8("\n\xc2\xa9 2007-2018 Juan Linietsky, Ariel Manzur.\n\xc2\xa9 2014-2018 ") +
TTR("Godot Engine contributors") + "\n");
hbc->add_child(about_text);
@@ -131,10 +147,10 @@ EditorAbout::EditorAbout() {
List<String> dev_sections;
dev_sections.push_back(TTR("Project Founders"));
dev_sections.push_back(TTR("Lead Developer"));
- dev_sections.push_back(TTR("Project Manager"));
+ dev_sections.push_back(TTR("Project Manager ")); // " " appended to distinguish between 'project supervisor' and 'project list'
dev_sections.push_back(TTR("Developers"));
const char **dev_src[] = { dev_founders, dev_lead, dev_manager, dev_names };
- tc->add_child(_populate_list(TTR("Authors"), dev_sections, dev_src));
+ tc->add_child(_populate_list(TTR("Authors"), dev_sections, dev_src, 1));
// Donors
@@ -146,18 +162,16 @@ EditorAbout::EditorAbout() {
donor_sections.push_back(TTR("Silver Donors"));
donor_sections.push_back(TTR("Bronze Donors"));
const char **donor_src[] = { donor_s_plat, donor_s_gold, donor_s_mini, donor_gold, donor_silver, donor_bronze };
- tc->add_child(_populate_list(TTR("Donors"), donor_sections, donor_src));
+ tc->add_child(_populate_list(TTR("Donors"), donor_sections, donor_src, 3));
// License
- TextEdit *license = memnew(TextEdit);
- license->set_name(TTR("License"));
- license->set_h_size_flags(Control::SIZE_EXPAND_FILL);
- license->set_v_size_flags(Control::SIZE_EXPAND_FILL);
- license->set_wrap(true);
- license->set_readonly(true);
- license->set_text(String::utf8(about_license));
- tc->add_child(license);
+ _license_text = memnew(RichTextLabel);
+ _license_text->set_name(TTR("License"));
+ _license_text->set_h_size_flags(Control::SIZE_EXPAND_FILL);
+ _license_text->set_v_size_flags(Control::SIZE_EXPAND_FILL);
+ _license_text->set_text(String::utf8(about_license));
+ tc->add_child(_license_text);
// Thirdparty License
@@ -201,7 +215,7 @@ EditorAbout::EditorAbout() {
for (int j = 0; j < about_tp_copyright_count[i]; j++) {
text += "\n Files:\n " + String(about_tp_file[read_idx]).replace("\n", "\n ") + "\n";
- String copyright = String::utf8(" \u00A9 ") + String::utf8(about_tp_copyright[read_idx]).replace("\n", String::utf8("\n \u00A9 "));
+ String copyright = String::utf8(" \xc2\xa9 ") + String::utf8(about_tp_copyright[read_idx]).replace("\n", String::utf8("\n \xc2\xa9 "));
text += copyright;
long_text += copyright;
String license = "\n License: " + String(about_tp_license[read_idx]) + "\n";
@@ -224,11 +238,9 @@ EditorAbout::EditorAbout() {
tpl_ti_all->set_metadata(0, long_text);
tpl_hbc->add_child(_tpl_tree);
- _tpl_text = memnew(TextEdit);
+ _tpl_text = memnew(RichTextLabel);
_tpl_text->set_h_size_flags(Control::SIZE_EXPAND_FILL);
_tpl_text->set_v_size_flags(Control::SIZE_EXPAND_FILL);
- _tpl_text->set_wrap(true);
- _tpl_text->set_readonly(true);
tpl_hbc->add_child(_tpl_text);
_tpl_tree->connect("item_selected", this, "_license_tree_selected");