Add line wrap indentation
This commit is contained in:
		| @@ -1,6 +1,6 @@ | ||||
| from PySide6.QtWidgets import QWidget | ||||
| from PySide6.QtCore import QSize | ||||
| from PySide6.QtGui import QTextCharFormat, QTextCursor, QColor | ||||
| from PySide6.QtGui import QTextCharFormat, QTextCursor, QColor, QTextBlockFormat | ||||
| from ui_main_window import Ui_MainWindow | ||||
| from file_cmds import FileCmds | ||||
|  | ||||
| @@ -62,8 +62,17 @@ class MainWindow(QWidget, Ui_MainWindow): | ||||
|             self.content = self.file_cmds.tabs_content[item_selected[0].text()] | ||||
|             self.detail_text_edit.setPlainText(self.content) | ||||
|             self.search() | ||||
|             self.wrap_line_indent() | ||||
|  | ||||
|  | ||||
|     def wrap_line_indent(self): | ||||
|         cursor = QTextCursor(self.detail_text_edit.document()) | ||||
|         cursor.select(QTextCursor.Document) | ||||
|         fmt = QTextBlockFormat() | ||||
|         fmt.setLeftMargin(100) | ||||
|         fmt.setTextIndent(-100) | ||||
|         cursor.mergeBlockFormat(fmt) | ||||
|  | ||||
|     def search(self): | ||||
|         to_search = self.search_line_edit.text() | ||||
|          | ||||
|   | ||||
| @@ -65,7 +65,6 @@ class Ui_MainWindow(object): | ||||
|         self.detail_text_edit.setObjectName(u"detail_text_edit") | ||||
|         self.detail_text_edit.setStyleSheet(u"background-color: rgb(42, 42, 42);") | ||||
|         self.detail_text_edit.setFrameShape(QFrame.NoFrame) | ||||
|         self.detail_text_edit.setLineWrapMode(QTextEdit.NoWrap) | ||||
|         self.detail_text_edit.setReadOnly(True) | ||||
|         self.splitter.addWidget(self.detail_text_edit) | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user