Utilize redraw trigger for board coordinates toggle

This commit is contained in:
blamarche committed 2020-12-09 18:36:31 -05:00
1 parent 416a85b462
commit c9c8eacfc7
4 files changed
+7 -8

No files matched your search

+1
View File
@@ -49,6 +49,7 @@ Many thanks to these additional authors:
* "ajkenny84" for the red-green colourblind theme.
* Lukasz Wierzbowski for the ability to paste urls for sgfs and helping fix alt-gr issues.
* Carton He for a fix to handling empty komi values in sgfs.
* "blamarche" for adding the board coordinates toggle
## Translators
+1
View File
@@ -178,6 +178,7 @@ In addition to shortcuts mentioned above and those shown in the main menu:
* **[Alt]**: Open the main menu.
* **[~]** or **[ ` ]** or **[F12]**: Cycles through more minimalistic UI modes.
* **[k]**: Toggle display of board coordinates.
* **[p]**: Pass
* **[pause]**: Pause/Resume timer
* **[arrow left]** or **[z]**: Undo move. Hold shift for 10 moves at a time, or ctrl to skip to the start.
+1 -4
View File
@@ -138,9 +138,6 @@ class KaTrainGui(Screen, KaTrainBase):
self.idle_analysis = not self.idle_analysis
self.update_state()
def toggle_board_coordinates(self):
self.board_gui.enable_coordinates(not self.board_gui.get_enable_coordinates())
def start(self):
if self.engine:
return
@@ -549,7 +546,7 @@ class KaTrainGui(Screen, KaTrainBase):
elif keycode[1] == "spacebar":
self.toggle_continuous_analysis()
elif keycode[1] == "k":
self.toggle_board_coordinates()
self.board_gui.toggle_coordinates()
elif keycode[1] in ["pause", "break", "f15"] and not ctrl_pressed:
self.controls.timer.paused = not self.controls.timer.paused
elif keycode[1] in ["`", "~", "f12"]:
+4 -4
View File
@@ -62,10 +62,10 @@ class BadukPanWidget(Widget):
self.bind(size=self.redraw_trigger, pos=self.redraw_trigger)
Clock.schedule_interval(self.animate_pv, 0.1)
def enable_coordinates(self, enabled):
self.draw_coords_enabled = enabled
self.draw_board()
self.draw_board_contents()
def toggle_coordinates(self):
self.draw_coords_enabled = not self.draw_coords_enabled
self.redraw_trigger()
return self.draw_coords_enabled
def get_enable_coordinates(self):
return self.draw_coords_enabled