Skip to content

Commit

Permalink
Show/hide line numbers in peer widget correctly (DistributedProofread…
Browse files Browse the repository at this point in the history
…ers#531)

Line numbers were always shown in peer widget. Now
show/hide with the ones in the main widget.

Fixes DistributedProofreaders#530
  • Loading branch information
windymilla authored Nov 16, 2024
1 parent de2ce90 commit 3d70a04
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/guiguts/maintext.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,10 +573,6 @@ def set_font(self) -> None:
self.restore_selection_ranges(ranges)
self.after_idle(lambda: self.restore_selection_ranges(ranges))

def toggle_line_numbers(self) -> None:
"""Toggle whether line numbers are shown."""
preferences.set(PrefKey.LINE_NUMBERS, not preferences.get(PrefKey.LINE_NUMBERS))

def show_line_numbers(self, show: bool) -> None:
"""Show or hide line numbers.
Expand All @@ -585,8 +581,10 @@ def show_line_numbers(self, show: bool) -> None:
"""
if show:
self.linenumbers.grid()
self.peer_linenumbers.grid()
else:
self.linenumbers.grid_remove()
self.peer_linenumbers.grid_remove()

def key_bind(
self, keyevent: str, handler: Callable[[Any], None], bind_all: bool
Expand Down

0 comments on commit 3d70a04

Please sign in to comment.