Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase the bottom margin for text info #334

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 3 additions & 32 deletions ReText/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ def lineNumberAreaWidth(self):
return 5 + self.fontMetrics().width('9') * digits

def updateLineNumberAreaWidth(self, blockcount=0):
self.setViewportMargins(self.lineNumberAreaWidth(), 0, 0, 0)
self.setViewportMargins(self.lineNumberAreaWidth(), 0, 0, self.fontMetrics().height())

def resizeEvent(self, event):
QTextEdit.resizeEvent(self, event)
Expand Down Expand Up @@ -483,43 +483,14 @@ def getAreaPosition(self, width, height):
def getText(self):
return ""

def enterEvent(self, event):
palette = self.palette()
windowColor = QColor(self.baseColor)
windowColor.setAlpha(0x20)
palette.setColor(QPalette.Window, windowColor)
textColor = palette.color(QPalette.WindowText)
textColor.setAlpha(0x20)
palette.setColor(QPalette.WindowText, textColor)
self.setPalette(palette)

def leaveEvent(self, event):
palette = self.palette()
palette.setColor(QPalette.Window, self.baseColor)
palette.setColor(QPalette.WindowText,
self.editor.palette().color(QPalette.WindowText))
self.setPalette(palette)

def mousePressEvent(self, event):
pos = self.mapToParent(event.pos())
pos.setX(pos.x() - self.editor.lineNumberAreaWidth())
newEvent = QMouseEvent(event.type(), pos,
event.button(), event.buttons(),
event.modifiers())
self.editor.mousePressEvent(newEvent)

mouseReleaseEvent = mousePressEvent
mouseDoubleClickEvent = mousePressEvent
mouseMoveEvent = mousePressEvent

class LineInfoArea(InfoArea):
def __init__(self, editor):
InfoArea.__init__(self, editor, colorValues['infoArea'])

def getAreaPosition(self, width, height):
viewport = self.editor.viewport()
rightSide = viewport.width() + self.editor.lineNumberAreaWidth()
return rightSide - width, viewport.height() - height
return rightSide - width, viewport.height() + 1

def getText(self):
template = '%d : %d'
Expand All @@ -536,7 +507,7 @@ def __init__(self, editor):
def getAreaPosition(self, width, height):
viewport = self.editor.viewport()
leftSide = self.editor.lineNumberAreaWidth()
return leftSide, viewport.height() - height
return leftSide, viewport.height() + 1

def getText(self):
if not globalSettings.documentStatsEnabled:
Expand Down