@@ -96,10 +96,12 @@ void ProjectExportDialog::_notification(int p_what) {
96
96
case NOTIFICATION_VISIBILITY_CHANGED: {
97
97
if (!is_visible ()) {
98
98
EditorSettings::get_singleton ()->set_project_metadata (" dialog_bounds" , " export" , Rect2 (get_position (), get_size ()));
99
+ show_script_key->set_pressed (false );
99
100
}
100
101
} break ;
101
102
102
103
case NOTIFICATION_THEME_CHANGED: {
104
+ _script_encryption_key_visibility_changed (show_script_key->is_pressed ());
103
105
duplicate_preset->set_button_icon (presets->get_editor_theme_icon (SNAME (" Duplicate" )));
104
106
delete_preset->set_button_icon (presets->get_editor_theme_icon (SNAME (" Remove" )));
105
107
patch_add_btn->set_button_icon (get_editor_theme_icon (SNAME (" Add" )));
@@ -596,8 +598,7 @@ void ProjectExportDialog::_enc_pck_changed(bool p_pressed) {
596
598
script_key->set_editable (p_pressed);
597
599
show_script_key->set_disabled (!p_pressed);
598
600
if (!p_pressed) {
599
- show_script_key->set_pressed_no_signal (false );
600
- script_key->set_secret (true );
601
+ show_script_key->set_pressed (false );
601
602
}
602
603
603
604
_update_current_preset ();
@@ -646,7 +647,9 @@ void ProjectExportDialog::_script_encryption_key_changed(const String &p_key) {
646
647
updating_script_key = false ;
647
648
}
648
649
649
- void ProjectExportDialog::_script_encryption_key_visibility_changed (const bool &p_visible) {
650
+ void ProjectExportDialog::_script_encryption_key_visibility_changed (bool p_visible) {
651
+ show_script_key->set_button_icon (get_editor_theme_icon (p_visible ? SNAME (" GuiVisibilityVisible" ) : SNAME (" GuiVisibilityHidden" )));
652
+ show_script_key->set_tooltip_text (p_visible ? TTRC (" Hide Encryption Key." ) : TTRC (" Show Encryption Key." ));
650
653
script_key->set_secret (!p_visible);
651
654
}
652
655
@@ -1703,20 +1706,24 @@ ProjectExportDialog::ProjectExportDialog() {
1703
1706
enc_ex_filters);
1704
1707
1705
1708
script_key = memnew (LineEdit);
1706
- script_key->set_accessibility_name (TTRC (" Encryption Key" ));
1709
+ script_key->set_h_size_flags (Control::SIZE_EXPAND_FILL);
1710
+ script_key->set_accessibility_name (TTRC (" Encryption Key (256-bits as hexadecimal):" ));
1707
1711
script_key->connect (SceneStringName (text_changed), callable_mp (this , &ProjectExportDialog::_script_encryption_key_changed));
1708
1712
script_key->set_secret (true );
1709
1713
1710
- show_script_key = memnew (CheckButton );
1711
- show_script_key->set_text ( " Show Encryption Key " );
1714
+ show_script_key = memnew (Button );
1715
+ show_script_key->set_toggle_mode ( true );
1712
1716
show_script_key->connect (SceneStringName (toggled), callable_mp (this , &ProjectExportDialog::_script_encryption_key_visibility_changed));
1713
1717
1718
+ HBoxContainer *encryption_hb = memnew (HBoxContainer);
1719
+ encryption_hb->add_child (script_key);
1720
+ encryption_hb->add_child (show_script_key);
1721
+
1714
1722
script_key_error = memnew (Label);
1715
1723
script_key_error->set_focus_mode (Control::FOCUS_ACCESSIBILITY);
1716
1724
script_key_error->set_text (String::utf8 (" • " ) + TTR (" Invalid Encryption Key (must be 64 hexadecimal characters long)" ));
1717
1725
script_key_error->add_theme_color_override (SceneStringName (font_color), EditorNode::get_singleton ()->get_editor_theme ()->get_color (SNAME (" error_color" ), EditorStringName (Editor)));
1718
- sec_vb->add_margin_child (TTR (" Encryption Key (256-bits as hexadecimal):" ), script_key);
1719
- sec_vb->add_child (show_script_key);
1726
+ sec_vb->add_margin_child (TTRC (" Encryption Key (256-bits as hexadecimal):" ), encryption_hb);
1720
1727
sec_vb->add_child (script_key_error);
1721
1728
sections->add_child (sec_scroll_container);
1722
1729
0 commit comments