Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to remove underline in Editor Docs #64861

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions editor/editor_help.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,8 @@ void EditorHelp::_update_doc() {
method_line.clear();
section_line.clear();

class_desc->set_meta_underline(EditorSettings::get_singleton()->get_setting("text_editor/help/show_meta_underline"));

_update_theme();
String link_color_text = title_color.to_html(false);

Expand Down Expand Up @@ -1985,6 +1987,14 @@ void EditorHelp::_toggle_scripts_pressed() {
update_toggle_scripts_button();
}

void EditorHelp::_meta_hover_started(Variant p_meta) {
// TODO: Very cool meta tooltips.
class_desc->set_default_cursor_shape(CURSOR_POINTING_HAND);
}
void EditorHelp::_meta_hover_ended(Variant p_meta) {
class_desc->set_default_cursor_shape(CURSOR_ARROW);
}

void EditorHelp::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_READY:
Expand Down Expand Up @@ -2105,6 +2115,11 @@ EditorHelp::EditorHelp() {
class_desc->connect("meta_clicked", callable_mp(this, &EditorHelp::_class_desc_select));
class_desc->connect("gui_input", callable_mp(this, &EditorHelp::_class_desc_input));
class_desc->connect("resized", callable_mp(this, &EditorHelp::_class_desc_resized).bind(false));

// Change cursor shape, even if meta_underline is disabled.
class_desc->connect("meta_hover_started", callable_mp(this, &EditorHelp::_meta_hover_started)); //.unbind(1));
class_desc->connect("meta_hover_ended", callable_mp(this, &EditorHelp::_meta_hover_ended)); //.unbind(1));

_class_desc_resized(false);

// Added second so it opens at the bottom so it won't offset the entire widget.
Expand Down
2 changes: 2 additions & 0 deletions editor/editor_help.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ class EditorHelp : public VBoxContainer {

String _fix_constant(const String &p_constant) const;
void _toggle_scripts_pressed();
void _meta_hover_started(Variant p_meta);
void _meta_hover_ended(Variant p_meta);

static Thread thread;

Expand Down
1 change: 1 addition & 0 deletions editor/editor_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
EDITOR_SETTING(Variant::INT, PROPERTY_HINT_RANGE, "text_editor/help/help_source_font_size", 14, "8,48,1")
EDITOR_SETTING(Variant::INT, PROPERTY_HINT_RANGE, "text_editor/help/help_title_font_size", 23, "8,48,1")
EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "text_editor/help/class_reference_examples", 0, "GDScript,C#,GDScript and C#")
_initial_set("text_editor/help/show_meta_underline", true);

/* Editors */

Expand Down