feat: updated engine
This commit is contained in:
parent
cbe99774ff
commit
f4cf6b3999
6607 changed files with 910135 additions and 430025 deletions
|
|
@ -30,9 +30,16 @@
|
|||
|
||||
#include "link_button.h"
|
||||
|
||||
#include "core/object/class_db.h"
|
||||
#include "core/os/os.h"
|
||||
#include "scene/theme/theme_db.h"
|
||||
#include "servers/display/accessibility_server.h"
|
||||
|
||||
void LinkButton::_shape() {
|
||||
if (!is_inside_tree()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Ref<Font> font = theme_cache.font;
|
||||
int font_size = theme_cache.font_size;
|
||||
|
||||
|
|
@ -59,6 +66,7 @@ void LinkButton::set_text(const String &p_text) {
|
|||
text = p_text;
|
||||
xl_text = atr(text);
|
||||
_shape();
|
||||
update_configuration_warnings();
|
||||
update_minimum_size();
|
||||
queue_redraw();
|
||||
}
|
||||
|
|
@ -203,27 +211,34 @@ Control::CursorShape LinkButton::get_cursor_shape(const Point2 &p_pos) const {
|
|||
return is_disabled() ? CURSOR_ARROW : get_default_cursor_shape();
|
||||
}
|
||||
|
||||
String LinkButton::_get_accessibility_name() const {
|
||||
const String &ac_name = Control::_get_accessibility_name();
|
||||
if (!xl_text.is_empty() && ac_name.is_empty()) {
|
||||
return xl_text;
|
||||
} else if (!xl_text.is_empty() && !ac_name.is_empty() && ac_name != xl_text) {
|
||||
return ac_name + ": " + xl_text;
|
||||
} else if (xl_text.is_empty() && ac_name.is_empty() && !get_tooltip_text().is_empty()) {
|
||||
return get_tooltip_text(); // Fall back to tooltip.
|
||||
} else {
|
||||
return ac_name;
|
||||
}
|
||||
}
|
||||
|
||||
void LinkButton::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ACCESSIBILITY_UPDATE: {
|
||||
RID ae = get_accessibility_element();
|
||||
ERR_FAIL_COND(ae.is_null());
|
||||
|
||||
DisplayServer::get_singleton()->accessibility_update_set_role(ae, DisplayServer::AccessibilityRole::ROLE_LINK);
|
||||
const String &ac_name = get_accessibility_name();
|
||||
if (!xl_text.is_empty() && ac_name.is_empty()) {
|
||||
DisplayServer::get_singleton()->accessibility_update_set_name(ae, xl_text);
|
||||
} else if (!xl_text.is_empty() && !ac_name.is_empty() && ac_name != xl_text) {
|
||||
DisplayServer::get_singleton()->accessibility_update_set_name(ae, ac_name + ": " + xl_text);
|
||||
} else if (xl_text.is_empty() && ac_name.is_empty() && !get_tooltip_text().is_empty()) {
|
||||
DisplayServer::get_singleton()->accessibility_update_set_name(ae, get_tooltip_text()); // Fall back to tooltip.
|
||||
}
|
||||
DisplayServer::get_singleton()->accessibility_update_set_url(ae, uri);
|
||||
AccessibilityServer::get_singleton()->update_set_role(ae, AccessibilityServerEnums::AccessibilityRole::ROLE_LINK);
|
||||
|
||||
AccessibilityServer::get_singleton()->update_set_url(ae, uri);
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_TRANSLATION_CHANGED: {
|
||||
xl_text = atr(text);
|
||||
_shape();
|
||||
update_configuration_warnings();
|
||||
update_minimum_size();
|
||||
queue_redraw();
|
||||
} break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue