feat: modules moved and engine moved to submodule
This commit is contained in:
parent
dfb5e645cd
commit
c33d2130cc
5136 changed files with 225275 additions and 64485 deletions
|
|
@ -51,6 +51,12 @@ void AcceptDialog::_parent_focused() {
|
|||
|
||||
void AcceptDialog::_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_DIALOG);
|
||||
} break;
|
||||
case NOTIFICATION_POST_ENTER_TREE: {
|
||||
if (is_visible()) {
|
||||
get_ok_button()->grab_focus();
|
||||
|
|
@ -197,16 +203,12 @@ bool AcceptDialog::has_autowrap() {
|
|||
}
|
||||
|
||||
void AcceptDialog::set_ok_button_text(String p_ok_button_text) {
|
||||
ok_button->set_text(p_ok_button_text);
|
||||
|
||||
child_controls_changed();
|
||||
if (is_visible()) {
|
||||
_update_child_rects();
|
||||
}
|
||||
ok_text = p_ok_button_text;
|
||||
_update_ok_text();
|
||||
}
|
||||
|
||||
String AcceptDialog::get_ok_button_text() const {
|
||||
return ok_button->get_text();
|
||||
return ok_text;
|
||||
}
|
||||
|
||||
void AcceptDialog::register_text_enter(LineEdit *p_line_edit) {
|
||||
|
|
@ -257,6 +259,25 @@ void AcceptDialog::_update_child_rects() {
|
|||
}
|
||||
}
|
||||
|
||||
void AcceptDialog::_update_ok_text() {
|
||||
String prev_text = ok_button->get_text();
|
||||
String new_text = internal_ok_text;
|
||||
|
||||
if (!ok_text.is_empty()) {
|
||||
new_text = ok_text;
|
||||
}
|
||||
|
||||
if (new_text == prev_text) {
|
||||
return;
|
||||
}
|
||||
ok_button->set_text(new_text);
|
||||
|
||||
child_controls_changed();
|
||||
if (is_visible()) {
|
||||
_update_child_rects();
|
||||
}
|
||||
}
|
||||
|
||||
Size2 AcceptDialog::_get_contents_minimum_size() const {
|
||||
// First, we then iterate over the label and any other custom controls
|
||||
// to try and find the size that encompasses all content.
|
||||
|
|
@ -294,6 +315,11 @@ Size2 AcceptDialog::_get_contents_minimum_size() const {
|
|||
return content_minsize;
|
||||
}
|
||||
|
||||
void AcceptDialog::set_internal_ok_text(const String &p_text) {
|
||||
internal_ok_text = p_text;
|
||||
_update_ok_text();
|
||||
}
|
||||
|
||||
void AcceptDialog::_custom_action(const String &p_action) {
|
||||
emit_signal(SNAME("custom_action"), p_action);
|
||||
custom_action(p_action);
|
||||
|
|
@ -428,6 +454,9 @@ AcceptDialog::AcceptDialog() {
|
|||
set_clamp_to_embedder(true);
|
||||
set_keep_title_visible(true);
|
||||
|
||||
set_flag(FLAG_MINIMIZE_DISABLED, true);
|
||||
set_flag(FLAG_MAXIMIZE_DISABLED, true);
|
||||
|
||||
bg_panel = memnew(Panel);
|
||||
add_child(bg_panel, false, INTERNAL_MODE_FRONT);
|
||||
|
||||
|
|
@ -442,7 +471,7 @@ AcceptDialog::AcceptDialog() {
|
|||
|
||||
buttons_hbox->add_spacer();
|
||||
ok_button = memnew(Button);
|
||||
ok_button->set_text(ETR("OK"));
|
||||
set_internal_ok_text(ETR("OK"));
|
||||
buttons_hbox->add_child(ok_button);
|
||||
buttons_hbox->add_spacer();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue