diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-06-15 19:36:55 -0400 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2019-07-02 10:10:17 -0400 |
| commit | 9f509f9aa2a1066a223bfd23fb54862f9c988b78 (patch) | |
| tree | 0f58bdc888ba1e07911d7fef273b7d2e3c727565 /src/texteditor.h | |
| parent | 6bd5bed29f3ebcc1155e615d7daa1c9cd1724efb (diff) | |
TextEditor now has a dynamic toolbar
Diffstat (limited to 'src/texteditor.h')
| -rw-r--r-- | src/texteditor.h | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/src/texteditor.h b/src/texteditor.h index 25a15ad7..10f6c4de 100644 --- a/src/texteditor.h +++ b/src/texteditor.h @@ -3,6 +3,27 @@ #include <QPlainTextEdit> +class TextEditor; + +class TextEditorToolbar +{ +public: + TextEditorToolbar(TextEditor& editor); + + QWidget* widget(); + +private: + TextEditor& m_editor; + QWidget* m_widget; + QAction* m_save; + QAction* m_wordWrap; + + void onTextModified(bool b); + void onSave(); + void onWordWrap(); +}; + + class TextEditor : public QObject { Q_OBJECT @@ -21,16 +42,20 @@ public: bool dirty() const; signals: - void changed(bool b); + void modified(bool b); private: QPlainTextEdit* m_edit; + TextEditorToolbar m_toolbar; QString m_filename; QString m_encoding; bool m_dirty; - void onChanged(bool b); + void onModified(bool b); void dirty(bool b); + + void setupToolbar(); + QWidget* wrapEditWidget(); }; #endif // MO_TEXTEDITOR_H |
