Skip to content

Commit

Permalink
ui, pop-ups: set details scrollbar position correctly
Browse files Browse the repository at this point in the history
When adding the details of a connection, the scrollbar was always at the
bottom of the view.
  • Loading branch information
gustavo-iniguez-goya committed Nov 22, 2023
1 parent 2f04d0f commit ffd7083
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions ui/opensnitch/dialogs/prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,6 @@ def _timeout_worker(self):
@QtCore.pyqtSlot()
def on_connection_prompt_triggered(self):
self.stackedWidget.setCurrentIndex(1)
# FIXME: scrolling to the top in _render_details doesn't seem to work,
# so do it here until we figure out why.
xpos = self.connDetails.verticalScrollBar().minimum()
self.connDetails.verticalScrollBar().setValue(xpos)
self._render_connection(self._con)
if self._tick > 0:
self.show()
Expand Down Expand Up @@ -504,6 +500,7 @@ def _render_details(self, con):

self.connDetails.document().clear()
self.connDetails.document().setHtml(details)
self.connDetails.moveCursor(QtGui.QTextCursor.Start)

# https://gis.stackexchange.com/questions/86398/how-to-disable-the-escape-key-for-a-dialog
def keyPressEvent(self, event):
Expand Down

0 comments on commit ffd7083

Please sign in to comment.