diff --git a/tgms_made_easy.py b/tgms_made_easy.py index 8bc803c22449e04d5fe29c197c34ea36db10dcd9..dc49bf421cfba89280db829a6600a609cab30a5d 100644 --- a/tgms_made_easy.py +++ b/tgms_made_easy.py @@ -179,10 +179,10 @@ class import_dialog(QtWidgets.QDialog): textBoxLayout = QtWidgets.QHBoxLayout() textBoxWidget = QtWidgets.QWidget() # textBoxLayout.addWidget(self.lineNumberWidget) - textBoxWidget.setLayout(textBoxLayout) - textBoxLayout.addWidget(self.textWidget) - textBoxLayout.addLayout(textlayout) - textDock.addWidget(textBoxWidget) + # textBoxWidget.setLayout(textBoxLayout) + # textBoxLayout.addWidget(self.textWidget) + # textBoxLayout.addLayout(textlayout) + textDock.addWidget(self.textWidget) tableDock.addWidget(self.tableWidget) docks.addDock(textDock) docks.addDock(tableDock) @@ -936,7 +936,7 @@ class TextPreviewWidget(QtWidgets.QPlainTextEdit): font rather than standart.) """ n_lines = self.blockCount() digits = np.ceil(np.log10(n_lines)) + 1 - return int(digits * QtGui.QFontMetrics(self.font()).averageCharWidth() + 3) + return int(digits * QtGui.QFontMetrics(self.font()).averageCharWidth() + 10) def updateLineNumberAreaWidth(self, _): # print('CodeEditor.updateLineNumberAreaWidth: margin = {}'.format(self.lineNumberAreaWidth())) @@ -972,13 +972,16 @@ class TextPreviewWidget(QtWidgets.QPlainTextEdit): top = self.blockBoundingGeometry(block).translated(self.contentOffset()).top() bottom = top + self.blockBoundingRect(block).height() + margin = 10 + # Just to make sure I use the right font height = QtGui.QFontMetrics(self.font()).height() while block.isValid() and (top <= event.rect().bottom()): if block.isVisible() and (bottom >= event.rect().top()): number = str(blockNumber + 1) - # painter.setPen(QtCore.Qt.GlobalColor.black) - painter.drawText(0, int(top), self.lineNumberArea.width(), height, + painter.setPen(QtCore.Qt.GlobalColor.gray) + painter.setFont(QtGui.QFont("consolas")) + painter.drawText(0, int(top), self.lineNumberArea.width() - margin, height, QtCore.Qt.AlignmentFlag.AlignRight, number) block = block.next() @@ -992,7 +995,7 @@ class TextPreviewWidget(QtWidgets.QPlainTextEdit): selection = QtWidgets.QTextEdit.ExtraSelection() QtWidgets.QPushButton.palette - lineColor = QtWidgets.QPushButton().palette().color(QtGui.QPalette.ColorRole.Button).lighter(160) + lineColor = QtGui.QColor(128, 128, 128, 85) selection.format.setBackground(lineColor) selection.format.setProperty(QtGui.QTextFormat.Property.FullWidthSelection, True)