summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/control.cpp1
-rw-r--r--scene/gui/text_edit.cpp26
-rw-r--r--scene/resources/dynamic_font.cpp8
-rw-r--r--scene/resources/dynamic_font_stb.cpp4
4 files changed, 24 insertions, 15 deletions
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index 73e7237058..0522b2efed 100644
--- a/scene/gui/control.cpp
+++ b/scene/gui/control.cpp
@@ -1810,6 +1810,7 @@ void Control::_propagate_theme_changed(Control *p_owner) {
void Control::set_theme(const Ref<Theme>& p_theme) {
+
data.theme=p_theme;
if (!p_theme.is_null()) {
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index fd6e97d33f..fe03b34105 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -700,15 +700,6 @@ void TextEdit::_notification(int p_what) {
if (highlighted_text.length() != 0 && highlighted_text != search_text)
highlighted_text_col = _get_column_pos_of_word(highlighted_text, str, SEARCH_MATCH_CASE|SEARCH_WHOLE_WORDS, 0);
- if (cache.line_number_w) {
- String fc = String::num(line+1);
- while (fc.length() < line_number_char_count) {
- fc="0"+fc;
- }
-
- cache.font->draw(ci,Point2(cache.style_normal->get_margin(MARGIN_LEFT)+cache.breakpoint_gutter_width,ofs_y+cache.font->get_ascent()),fc,cache.line_number_color);
- }
-
const Map<int,Text::ColorRegionInfo>& cri_map=text.get_color_region_info(line);
@@ -720,8 +711,14 @@ void TextEdit::_notification(int p_what) {
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);
+ }
- // draw breakpoint marker
+ // draw breakpoint marker
+ if (text.is_breakpoint(line)) {
if (draw_breakpoint_gutter) {
int vertical_gap = cache.breakpoint_gutter_width / 2;
int marker_size = cache.breakpoint_gutter_width - vertical_gap;
@@ -731,10 +728,13 @@ void TextEdit::_notification(int p_what) {
}
- if (line==cursor.line) {
-
- VisualServer::get_singleton()->canvas_item_add_rect(ci,Rect2(xmargin_beg, ofs_y,xmargin_end-xmargin_beg,get_row_height()),cache.current_line_color);
+ if (cache.line_number_w) {
+ String fc = String::num(line+1);
+ while (fc.length() < line_number_char_count) {
+ fc="0"+fc;
+ }
+ cache.font->draw(ci,Point2(cache.style_normal->get_margin(MARGIN_LEFT)+cache.breakpoint_gutter_width,ofs_y+cache.font->get_ascent()),fc,cache.line_number_color);
}
for (int j=0;j<str.length();j++) {
diff --git a/scene/resources/dynamic_font.cpp b/scene/resources/dynamic_font.cpp
index 3cd5e5f329..78a5571bf0 100644
--- a/scene/resources/dynamic_font.cpp
+++ b/scene/resources/dynamic_font.cpp
@@ -574,8 +574,10 @@ void DynamicFont::set_font_data(const Ref<DynamicFontData>& p_data) {
data=p_data;
data_at_size=data->_get_dynamic_font_at_size(size);
+ emit_changed();
}
+
Ref<DynamicFontData> DynamicFont::get_font_data() const{
return data;
@@ -594,6 +596,8 @@ void DynamicFont::set_size(int p_size){
fallback_data_at_size[i]=fallbacks[i]->_get_dynamic_font_at_size(size);
}
+ emit_changed();
+ _change_notify();
}
int DynamicFont::get_size() const{
@@ -663,6 +667,9 @@ void DynamicFont::add_fallback(const Ref<DynamicFontData>& p_data) {
fallback_data_at_size.push_back(fallbacks[fallbacks.size()-1]->_get_dynamic_font_at_size(size)); //const..
_change_notify();
+ emit_changed();
+ _change_notify();
+
}
int DynamicFont::get_fallback_count() const {
@@ -679,6 +686,7 @@ void DynamicFont::remove_fallback(int p_idx) {
ERR_FAIL_INDEX(p_idx,fallbacks.size());
fallbacks.remove(p_idx);
fallback_data_at_size.remove(p_idx);
+ emit_changed();
_change_notify();
}
diff --git a/scene/resources/dynamic_font_stb.cpp b/scene/resources/dynamic_font_stb.cpp
index 344043fcdd..0b9f95da4f 100644
--- a/scene/resources/dynamic_font_stb.cpp
+++ b/scene/resources/dynamic_font_stb.cpp
@@ -384,8 +384,8 @@ void DynamicFont::_bind_methods() {
ObjectTypeDB::bind_method(_MD("set_size","data"),&DynamicFont::set_size);
ObjectTypeDB::bind_method(_MD("get_size"),&DynamicFont::get_size);
- ADD_PROPERTY(PropertyInfo(Variant::INT,"size"),_SCS("set_size"),_SCS("get_size"));
- ADD_PROPERTY(PropertyInfo(Variant::OBJECT,"font",PROPERTY_HINT_RESOURCE_TYPE,"DynamicFontData"),_SCS("set_font_data"),_SCS("get_font_data"));
+ ADD_PROPERTY(PropertyInfo(Variant::INT,"font/size"),_SCS("set_size"),_SCS("get_size"));
+ ADD_PROPERTY(PropertyInfo(Variant::OBJECT,"font/font",PROPERTY_HINT_RESOURCE_TYPE,"DynamicFontData"),_SCS("set_font_data"),_SCS("get_font_data"));
}