From 366da234706d16d54502d2a6501b43cfb29e9615 Mon Sep 17 00:00:00 2001 From: Harishankar Date: Wed, 8 Dec 2010 18:54:21 +0530 Subject: [PATCH] Small UI improvements Made small UI improvements. Spacebar now deletes a character at the present cell and moves to the next one (depending on whether the across mode or down mode is set) --- player_mainwindow.py | 12 +++++++++--- playerwindow.glade | 15 ++++++++------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/player_mainwindow.py b/player_mainwindow.py index 24fabf6..8ffdb16 100644 --- a/player_mainwindow.py +++ b/player_mainwindow.py @@ -262,7 +262,7 @@ along with GetAClue. If not, see .""" if self.puzzle: # set a guess only if not revealed if self.puzzle.data[self.selected_row][self.selected_col].revealed is False: - self.puzzle.data[self.selected_row][self.selected_col].guess = guess_char.upper () + self.puzzle.data[self.selected_row][self.selected_col].guess = guess_char # across mode typing if self.typing_mode == self.ACROSS: # move by one character across but only if there is no block @@ -355,12 +355,18 @@ along with GetAClue. If not, see .""" drawarea.queue_draw () # if it is A-Z or a-z then elif len (key) == 1 and key.isalpha (): - self.set_guess (key) + guess_char = key.upper () + self.set_guess (guess_char) drawarea.queue_draw () # if it is the delete key then delete character at selected row/col - elif key == "delete" or key == "space": + elif key == "delete": self.puzzle.data[self.selected_row][self.selected_col].guess = None drawarea.queue_draw () + # if the key is space key then delete character and move across or + # down one step depending on the mode + elif key == "space": + self.set_guess (None) + drawarea.queue_draw () # if it is backspace key then delete character at previous row/col # depending on the input mode. If across editing mode, then delete # at previous column else at previous row diff --git a/playerwindow.glade b/playerwindow.glade index 36dd5a6..2727527 100644 --- a/playerwindow.glade +++ b/playerwindow.glade @@ -213,13 +213,12 @@ True - True 180 True True - True + False automatic automatic @@ -230,16 +229,17 @@ True clues_across False + False 0 - Number + # - Clue Across + Clues Across @@ -253,7 +253,7 @@ True - True + False automatic automatic @@ -264,16 +264,17 @@ True clues_down False + False 0 - Number + # - Clue Down + Clues Down -- 2.20.1