diff --git a/QT/main_window_dark.ui b/QT/main_window_dark.ui index e8ed3e3..5453341 100644 --- a/QT/main_window_dark.ui +++ b/QT/main_window_dark.ui @@ -91,9 +91,6 @@ font: 11pt "UbuntuMono NF"; QFrame::NoFrame - - QTextEdit::NoWrap - true diff --git a/mediainfosama/main_window.py b/mediainfosama/main_window.py index b0f4672..ee88331 100644 --- a/mediainfosama/main_window.py +++ b/mediainfosama/main_window.py @@ -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() diff --git a/mediainfosama/ui_main_window.py b/mediainfosama/ui_main_window.py index 597e383..94266cb 100644 --- a/mediainfosama/ui_main_window.py +++ b/mediainfosama/ui_main_window.py @@ -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)