diff options
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/control.cpp | 12 | ||||
-rw-r--r-- | scene/gui/rich_text_label.cpp | 8 | ||||
-rw-r--r-- | scene/gui/tab_container.cpp | 6 | ||||
-rw-r--r-- | scene/gui/text_edit.cpp | 25 |
4 files changed, 31 insertions, 20 deletions
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 87dfd95724..2d5b54257a 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -809,9 +809,9 @@ Ref<StyleBox> Control::get_stylebox(const StringName &p_name, const StringName & // try with custom themes Control *theme_owner = data.theme_owner; - while (theme_owner) { + StringName class_name = type; - StringName class_name = type; + while (theme_owner) { while (class_name != StringName()) { if (theme_owner->data.theme->has_stylebox(p_name, class_name)) { @@ -829,6 +829,14 @@ Ref<StyleBox> Control::get_stylebox(const StringName &p_name, const StringName & theme_owner = NULL; } + class_name = type; + + while (class_name != StringName()) { + if (Theme::get_default()->has_stylebox(p_name, class_name)) + return Theme::get_default()->get_stylebox(p_name, class_name); + + class_name = ClassDB::get_parent_class_nocheck(class_name); + } return Theme::get_default()->get_stylebox(p_name, type); } Ref<Font> Control::get_font(const StringName &p_name, const StringName &p_type) const { diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index ab2c2f445f..71b9c4ec72 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -540,14 +540,6 @@ void RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int it = _get_next_item(it); - if (p_mode == PROCESS_POINTER && r_click_item && itp && !it && p_click_pos.y > p_ofs.y + y + lh) { - //at the end of all, return this - if (r_outside) *r_outside = true; - *r_click_item = itp; - *r_click_char = rchar; - return; - } - if (it && (p_line + 1 < p_frame->lines.size()) && p_frame->lines[p_line + 1].from == it) { if (p_mode == PROCESS_POINTER && r_click_item && p_click_pos.y >= p_ofs.y + y && p_click_pos.y <= p_ofs.y + y + lh) { diff --git a/scene/gui/tab_container.cpp b/scene/gui/tab_container.cpp index 657e8590d4..98a8db336e 100644 --- a/scene/gui/tab_container.cpp +++ b/scene/gui/tab_container.cpp @@ -208,6 +208,9 @@ void TabContainer::_notification(int p_what) { break; } + // Draw the tab area. + panel->draw(canvas, Rect2(0, header_height, size.width, size.height - header_height)); + // Draw all visible tabs. int x = 0; for (int i = 0; i < tab_widths.size(); i++) { @@ -280,9 +283,6 @@ void TabContainer::_notification(int p_what) { Point2(x, y_center - (decrement->get_height() / 2)), Color(1, 1, 1, first_tab_cache > 0 ? 1.0 : 0.5)); } - - // Draw the tab area. - panel->draw(canvas, Rect2(0, header_height, size.width, size.height - header_height)); } break; case NOTIFICATION_THEME_CHANGED: { if (get_tab_count() > 0) { diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 1738e303aa..2ca4c81319 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -36,6 +36,10 @@ #include "project_settings.h" #include "scene/main/viewport.h" +#ifdef TOOLS_ENABLED +#include "editor/editor_scale.h" +#endif + #define TAB_PIXELS static bool _is_text_char(CharType c) { @@ -729,15 +733,18 @@ void TextEdit::_notification(int p_what) { VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg, ofs_y, xmargin_end - xmargin_beg, get_row_height()), cache.mark_color); } - if (text.is_breakpoint(line)) { - - VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg, ofs_y, xmargin_end - xmargin_beg, get_row_height()), cache.breakpoint_color); - } - if (line == cursor.line) { VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(0, ofs_y, xmargin_end, get_row_height()), cache.current_line_color); } + if (text.is_breakpoint(line) && !draw_breakpoint_gutter) { +#ifdef TOOLS_ENABLED + VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg, ofs_y + get_row_height() - EDSCALE, xmargin_end - xmargin_beg, EDSCALE), cache.breakpoint_color); +#else + VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg, ofs_y, xmargin_end - xmargin_beg, get_row_height()), cache.breakpoint_color); +#endif + } + // draw breakpoint marker if (text.is_breakpoint(line)) { if (draw_breakpoint_gutter) { @@ -2793,12 +2800,16 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { int ini = selection.from_line; int end = selection.to_line; for (int i = ini; i <= end; i++) { - if (text[i][0] == '#') + if (get_line(i).begins_with("#")) _remove_text(i, 0, i, 1); } } else { - if (text[cursor.line][0] == '#') + if (get_line(cursor.line).begins_with("#")) { _remove_text(cursor.line, 0, cursor.line, 1); + if (cursor.column >= get_line(cursor.line).length()) { + cursor.column = MAX(0, get_line(cursor.line).length() - 1); + } + } } update(); } |