summaryrefslogtreecommitdiff
path: root/editor/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'editor/plugins')
-rw-r--r--editor/plugins/asset_library_editor_plugin.cpp111
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp4
2 files changed, 58 insertions, 57 deletions
diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp
index 1503258ff5..31b11d8bea 100644
--- a/editor/plugins/asset_library_editor_plugin.cpp
+++ b/editor/plugins/asset_library_editor_plugin.cpp
@@ -177,6 +177,8 @@ void EditorAssetLibraryItemDescription::set_image(int p_type, int p_index, const
tex->create_from_image(thumbnail);
preview_images[i].button->set_icon(tex);
+ // Make it clearer that clicking it will open an external link
+ preview_images[i].button->set_default_cursor_shape(CURSOR_POINTING_HAND);
} else {
preview_images[i].button->set_icon(p_image);
}
@@ -403,54 +405,60 @@ void EditorAssetLibraryItemDownload::configure(const String &p_title, int p_asse
void EditorAssetLibraryItemDownload::_notification(int p_what) {
- if (p_what == NOTIFICATION_PROCESS) {
+ switch (p_what) {
- // Make the progress bar visible again when retrying the download
- progress->set_modulate(Color(1, 1, 1, 1));
+ case NOTIFICATION_READY: {
- if (download->get_downloaded_bytes() > 0) {
- progress->set_max(download->get_body_size());
- progress->set_value(download->get_downloaded_bytes());
- }
+ add_style_override("panel", get_stylebox("panel", "TabContainer"));
+ } break;
+ case NOTIFICATION_PROCESS: {
- int cstatus = download->get_http_client_status();
+ // Make the progress bar visible again when retrying the download.
+ progress->set_modulate(Color(1, 1, 1, 1));
- if (cstatus == HTTPClient::STATUS_BODY) {
- if (download->get_body_size() > 0) {
- status->set_text(
- vformat(
- TTR("Downloading (%s / %s)..."),
- String::humanize_size(download->get_downloaded_bytes()),
- String::humanize_size(download->get_body_size())));
- } else {
- // Total file size is unknown, so it cannot be displayed
- status->set_text(TTR("Downloading..."));
+ if (download->get_downloaded_bytes() > 0) {
+ progress->set_max(download->get_body_size());
+ progress->set_value(download->get_downloaded_bytes());
}
- }
- if (cstatus != prev_status) {
- switch (cstatus) {
+ int cstatus = download->get_http_client_status();
+
+ if (cstatus == HTTPClient::STATUS_BODY) {
+ if (download->get_body_size() > 0) {
+ status->set_text(vformat(
+ TTR("Downloading (%s / %s)..."),
+ String::humanize_size(download->get_downloaded_bytes()),
+ String::humanize_size(download->get_body_size())));
+ } else {
+ // Total file size is unknown, so it cannot be displayed.
+ status->set_text(TTR("Downloading..."));
+ }
+ }
- case HTTPClient::STATUS_RESOLVING: {
- status->set_text(TTR("Resolving..."));
- progress->set_max(1);
- progress->set_value(0);
- } break;
- case HTTPClient::STATUS_CONNECTING: {
- status->set_text(TTR("Connecting..."));
- progress->set_max(1);
- progress->set_value(0);
- } break;
- case HTTPClient::STATUS_REQUESTING: {
- status->set_text(TTR("Requesting..."));
- progress->set_max(1);
- progress->set_value(0);
- } break;
- default: {
+ if (cstatus != prev_status) {
+ switch (cstatus) {
+
+ case HTTPClient::STATUS_RESOLVING: {
+ status->set_text(TTR("Resolving..."));
+ progress->set_max(1);
+ progress->set_value(0);
+ } break;
+ case HTTPClient::STATUS_CONNECTING: {
+ status->set_text(TTR("Connecting..."));
+ progress->set_max(1);
+ progress->set_value(0);
+ } break;
+ case HTTPClient::STATUS_REQUESTING: {
+ status->set_text(TTR("Requesting..."));
+ progress->set_max(1);
+ progress->set_value(0);
+ } break;
+ default: {
+ }
}
+ prev_status = cstatus;
}
- prev_status = cstatus;
- }
+ } break;
}
}
void EditorAssetLibraryItemDownload::_close() {
@@ -531,7 +539,7 @@ EditorAssetLibraryItemDownload::EditorAssetLibraryItemDownload() {
hb2->add_spacer();
install = memnew(Button);
- install->set_text(TTR("Install"));
+ install->set_text(TTR("Install..."));
install->set_disabled(true);
install->connect("pressed", this, "_install");
@@ -564,6 +572,7 @@ EditorAssetLibraryItemDownload::EditorAssetLibraryItemDownload() {
void EditorAssetLibrary::_notification(int p_what) {
switch (p_what) {
+
case NOTIFICATION_READY: {
error_tr->set_texture(get_icon("Error", "EditorIcons"));
@@ -573,14 +582,12 @@ void EditorAssetLibrary::_notification(int p_what) {
error_label->raise();
} break;
-
case NOTIFICATION_VISIBILITY_CHANGED: {
if (is_visible()) {
- _repository_changed(0); // Update when shown for the first time
+ _repository_changed(0); // Update when shown for the first time.
}
} break;
-
case NOTIFICATION_PROCESS: {
HTTPClient::Status s = request->get_http_client_status();
@@ -619,6 +626,7 @@ void EditorAssetLibrary::_notification(int p_what) {
case NOTIFICATION_THEME_CHANGED: {
library_scroll_bg->add_style_override("panel", get_stylebox("bg", "Tree"));
+ downloads_scroll->add_style_override("bg", get_stylebox("bg", "Tree"));
error_tr->set_texture(get_icon("Error", "EditorIcons"));
reverse->set_icon(get_icon("Sort", "EditorIcons"));
filter->set_right_icon(get_icon("Search", "EditorIcons"));
@@ -749,7 +757,7 @@ void EditorAssetLibrary::_image_update(bool use_cache, bool final, const PoolByt
float scale_ratio = max_height / (image->get_height() * EDSCALE);
if (scale_ratio < 1) {
- image->resize(image->get_width() * EDSCALE * scale_ratio, image->get_height() * EDSCALE * scale_ratio, Image::INTERPOLATE_CUBIC);
+ image->resize(image->get_width() * EDSCALE * scale_ratio, image->get_height() * EDSCALE * scale_ratio, Image::INTERPOLATE_LANCZOS);
}
} break;
case IMAGE_QUEUE_SCREENSHOT: {
@@ -757,7 +765,7 @@ void EditorAssetLibrary::_image_update(bool use_cache, bool final, const PoolByt
float scale_ratio = max_height / (image->get_height() * EDSCALE);
if (scale_ratio < 1) {
- image->resize(image->get_width() * EDSCALE * scale_ratio, image->get_height() * EDSCALE * scale_ratio, Image::INTERPOLATE_CUBIC);
+ image->resize(image->get_width() * EDSCALE * scale_ratio, image->get_height() * EDSCALE * scale_ratio, Image::INTERPOLATE_LANCZOS);
}
} break;
}
@@ -1238,9 +1246,6 @@ void EditorAssetLibrary::_http_request_completed(int p_status, int p_code, const
description->connect("confirmed", this, "_install_asset");
description->configure(r["title"], r["asset_id"], category_map[r["category_id"]], r["category_id"], r["author"], r["author_id"], r["cost"], r["version"], r["version_string"], r["description"], r["download_url"], r["browse_url"], r["download_hash"]);
- /*item->connect("asset_selected",this,"_select_asset");
- item->connect("author_selected",this,"_select_author");
- item->connect("category_selected",this,"_category_selected");*/
if (r.has("icon_url") && r["icon_url"] != "") {
_request_image(description->get_instance_id(), r["icon_url"], IMAGE_QUEUE_ICON, 0);
@@ -1267,9 +1272,8 @@ void EditorAssetLibrary::_http_request_completed(int p_status, int p_code, const
if (p.has("thumbnail")) {
_request_image(description->get_instance_id(), p["thumbnail"], IMAGE_QUEUE_THUMBNAIL, i);
}
- if (is_video) {
- //_request_image(description->get_instance_id(),p["link"],IMAGE_QUEUE_SCREENSHOT,i);
- } else {
+
+ if (!is_video) {
_request_image(description->get_instance_id(), p["link"], IMAGE_QUEUE_SCREENSHOT, i);
}
}
@@ -1390,19 +1394,16 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) {
reverse = memnew(ToolButton);
reverse->set_toggle_mode(true);
reverse->connect("toggled", this, "_rerun_search");
- //reverse->set_text(TTR("Reverse"));
+ reverse->set_tooltip(TTR("Reverse sorting."));
search_hb2->add_child(reverse);
search_hb2->add_child(memnew(VSeparator));
- //search_hb2->add_spacer();
-
search_hb2->add_child(memnew(Label(TTR("Category:") + " ")));
categories = memnew(OptionButton);
categories->add_item(TTR("All"));
search_hb2->add_child(categories);
categories->set_h_size_flags(SIZE_EXPAND_FILL);
- //search_hb2->add_spacer();
categories->connect("item_selected", this, "_rerun_search");
search_hb2->add_child(memnew(VSeparator));
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index 915fc5ba4c..d4eab888cc 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -2246,8 +2246,6 @@ void CanvasItemEditor::_gui_input_viewport(const Ref<InputEvent> &p_event) {
//printf("Plugin\n");
} else if ((accepted = _gui_input_open_scene_on_double_click(p_event))) {
//printf("Open scene on double click\n");
- } else if ((accepted = _gui_input_anchors(p_event))) {
- //printf("Anchors\n");
} else if ((accepted = _gui_input_scale(p_event))) {
//printf("Set scale\n");
} else if ((accepted = _gui_input_pivot(p_event))) {
@@ -2258,6 +2256,8 @@ void CanvasItemEditor::_gui_input_viewport(const Ref<InputEvent> &p_event) {
//printf("Rotate\n");
} else if ((accepted = _gui_input_move(p_event))) {
//printf("Move\n");
+ } else if ((accepted = _gui_input_anchors(p_event))) {
+ //printf("Anchors\n");
} else if ((accepted = _gui_input_select(p_event))) {
//printf("Selection\n");
} else {