X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fentry.cpp;h=8b638dea2206f07fd4fb6bace8353c336fcc67c5;hb=4ac5101da154d8130b606b4509c9750332365fef;hp=751f173d0c234a36a10c340987112fa6a7dd1605;hpb=474578fd04355c3247e8f9f6383d17e37c2c3015;p=libs%2Fgltk.git diff --git a/source/entry.cpp b/source/entry.cpp index 751f173..8b638de 100644 --- a/source/entry.cpp +++ b/source/entry.cpp @@ -56,7 +56,11 @@ void Entry::autosize_special(const Part &part, Geometry &ageom) const void Entry::set_text(const string &t) { - text = t; + if(t!=text.get()) + { + text = t; + signal_text_changed.emit(text.get()); + } set_edit_position(text.size()); } @@ -458,10 +462,13 @@ void Entry::check_view_range() else if(row>=first_row+visible_rows) first_row = row+1-visible_rows; + unsigned scroll = max(text.get_n_lines(), visible_rows)-visible_rows; + if(first_row>scroll) + first_row = scroll; + if(first_row!=old_first_row) signal_scroll_position_changed.emit(first_row); - unsigned scroll = max(text.get_n_lines(), visible_rows)-visible_rows; slider->set_range(0, scroll); slider->set_value(scroll-first_row); }