From 37cb6cefcab6be0a1337e0a346d6e259f8dbbb5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Nusser?= Date: Tue, 18 Apr 2017 10:58:52 +0200 Subject: Revert preprocessing on resize for TextEdit. It was just plain dumb. --- plugingui/mainwindow.cc | 2 -- plugingui/textedit.cc | 11 ----------- plugingui/textedit.h | 2 -- 3 files changed, 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; -- cgit v1.2.3