diff options
author | André Nusser <andre.nusser@googlemail.com> | 2017-04-18 10:58:52 +0200 |
---|---|---|
committer | André Nusser <andre.nusser@googlemail.com> | 2017-04-18 10:58:52 +0200 |
commit | 37cb6cefcab6be0a1337e0a346d6e259f8dbbb5f (patch) | |
tree | e85d93bc3557ae6216cfc3634a9821ffdc015a88 /plugingui | |
parent | 8ba4c6c7f3317d9e3c4465be15265e7f72d4ab28 (diff) |
Revert preprocessing on resize for TextEdit. It was just plain dumb.
Diffstat (limited to 'plugingui')
-rw-r--r-- | plugingui/mainwindow.cc | 2 | ||||
-rw-r--r-- | plugingui/textedit.cc | 11 | ||||
-rw-r--r-- | plugingui/textedit.h | 2 |
3 files changed, 0 insertions, 15 deletions
diff --git a/plugingui/mainwindow.cc b/plugingui/mainwindow.cc index b37185c..e57008d 100644 --- a/plugingui/mainwindow.cc +++ b/plugingui/mainwindow.cc @@ -56,7 +56,6 @@ MainWindow::MainWindow(Settings& settings, void* native_window) tabs.addTab("About", &about_text_field); about_text_field.setText(getAboutText()); - about_text_field.adaptTextOnResize(true); about_text_field.setReadOnly(true); } @@ -118,7 +117,6 @@ void MainWindow::repaintEvent(RepaintEvent* repaintEvent) void MainWindow::sizeChanged(std::size_t width, std::size_t height) { - about_text_field.preprocessText(); tabs.resize(width - 2 * 16, height); } diff --git a/plugingui/textedit.cc b/plugingui/textedit.cc index 63b4cd4..abfb3ab 100644 --- a/plugingui/textedit.cc +++ b/plugingui/textedit.cc @@ -56,12 +56,6 @@ void TextEdit::resize(std::size_t width, std::size_t height) Widget::resize(width, height); scroll.resize(scroll.width(), height - 14); scroll.move(width - 23, 7); - - // TODO: This might be bad for performance. Improve at some point. - if (adapt_text_on_resize) - { - preprocessText(); - } } void TextEdit::setReadOnly(bool readonly) @@ -88,11 +82,6 @@ std::string TextEdit::text() return _text; } -void TextEdit::adaptTextOnResize(bool adapt) -{ - adapt_text_on_resize = adapt; -} - void TextEdit::preprocessText() { preprocessedtext.clear(); diff --git a/plugingui/textedit.h b/plugingui/textedit.h index 3eaf02f..9ca0301 100644 --- a/plugingui/textedit.h +++ b/plugingui/textedit.h @@ -53,7 +53,6 @@ public: void setReadOnly(bool readonly); bool readOnly(); - void adaptTextOnResize(bool adapt); void preprocessText(); Notifier<> textChangedNotifier; @@ -76,7 +75,6 @@ private: std::string _text; - bool adapt_text_on_resize{false}; bool readonly{true}; std::list< std::string > preprocessedtext; |