-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5a6ce16
commit 872c912
Showing
9 changed files
with
98 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,11 @@ | |
|
||
============ | ||
|
||
## 0.0.69 | ||
|
||
- Implemented: | ||
- View Menu -> Word Wrap | ||
|
||
## 0.0.68 | ||
|
||
- Implemented: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include "wordwrap.h" | ||
|
||
WordWrap::WordWrap(QObject* parent) | ||
: QObject(parent) {} | ||
|
||
void WordWrap::toggle(QPlainTextEdit* editor) { | ||
if (!editor) return; | ||
|
||
QTextOption option = editor->document()->defaultTextOption(); | ||
if (option.wrapMode() == QTextOption::NoWrap) { | ||
option.setWrapMode(QTextOption::WordWrap); | ||
} else { | ||
option.setWrapMode(QTextOption::NoWrap); | ||
} | ||
editor->document()->setDefaultTextOption(option); | ||
} | ||
|
||
bool WordWrap::isWordWrapEnabled(QPlainTextEdit* editor) const { | ||
if (!editor) return false; | ||
|
||
return editor->document()->defaultTextOption().wrapMode() == QTextOption::WordWrap; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#pragma once | ||
|
||
#include <QObject> | ||
#include <QPlainTextEdit> | ||
#include <QTextOption> | ||
|
||
class WordWrap : public QObject { | ||
Q_OBJECT | ||
|
||
public: | ||
explicit WordWrap(QObject* parent = nullptr); | ||
|
||
// Toggle word wrap for a given editor | ||
void toggle(QPlainTextEdit* editor); | ||
|
||
// Check if word wrap is enabled | ||
bool isWordWrapEnabled(QPlainTextEdit* editor) const; | ||
}; | ||
|