Merge pull request #16091 from Noshyaar/t

TemplateManager: hold shift to open link in browser
This commit is contained in:
Rémi Verschelde 2018-01-30 13:41:46 +01:00 committed by GitHub
commit 4f94d4378f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -30,6 +30,8 @@
#include "export_template_manager.h"
#include "core/os/input.h"
#include "core/os/keyboard.h"
#include "editor_node.h"
#include "editor_scale.h"
#include "io/json.h"
@ -422,6 +424,11 @@ void ExportTemplateManager::_http_download_templates_completed(int p_status, int
void ExportTemplateManager::_begin_template_download(const String &p_url) {
if (Input::get_singleton()->is_key_pressed(KEY_SHIFT)) {
OS::get_singleton()->shell_open(p_url);
return;
}
for (int i = 0; i < template_list->get_child_count(); i++) {
BaseButton *b = Object::cast_to<BaseButton>(template_list->get_child(0));
if (b) {
@ -576,7 +583,7 @@ ExportTemplateManager::ExportTemplateManager() {
template_downloader->add_child(vbc);
ScrollContainer *sc = memnew(ScrollContainer);
sc->set_custom_minimum_size(Size2(400, 200) * EDSCALE);
vbc->add_margin_child(TTR("Select mirror from list: "), sc);
vbc->add_margin_child(TTR("Select mirror from list: (Shift+Click: Open in Browser)"), sc);
template_list = memnew(VBoxContainer);
sc->add_child(template_list);
sc->set_enable_v_scroll(true);