black-sheep-dev / harbour-aenigma

Sudoku game for Sailfish OS
GNU General Public License v2.0
2 stars 1 forks source link

Toggle between edit mode and note mode by pressing on the number buttons #14

Open elBoberido opened 2 years ago

elBoberido commented 2 years ago

Quite often the finger is already on the number when one notices that the wrong input mode is selected. A second press on the button could toggle the modes. Pressing a new number button would retain the last mode. To visualize which mode is selected, a + or pencil icon could be shown at the top left corner of the button. e.g. with the proposal from #13

e.g. 4 is already selected

+-----------+ +-----------+ +-----------+
|           | |           | |           |
|     1     | |     2     | |     3     |
|           | |           | |           |
+-----------+ +-----------+ +-----------+
+-----------+ +-----------+ +-----------+
| +         | |           | |           |
|     4     | |     5     | |     6     |
|           | |           | |           |
+-----------+ +-----------+ +-----------+
+-----------+ +-----------+ +-----------+
|           | |           | |           |
|      7    | |     8     | |     9     |
|           | |           | |           |
+-----------+ +-----------+ +-----------+

Another press on 4 toggles the mode

+-----------+ +-----------+ +-----------+
|           | |           | |           |
|     1     | |     2     | |     3     |
|           | |           | |           |
+-----------+ +-----------+ +-----------+
+-----------+ +-----------+ +-----------+
| p         | |           | |           |
|     4     | |     5     | |     6     |
|           | |           | |           |
+-----------+ +-----------+ +-----------+
+-----------+ +-----------+ +-----------+
|           | |           | |           |
|      7    | |     8     | |     9     |
|           | |           | |           |
+-----------+ +-----------+ +-----------+

A press on 5 switches the number but keeps the mode

+-----------+ +-----------+ +-----------+
|           | |           | |           |
|     1     | |     2     | |     3     |
|           | |           | |           |
+-----------+ +-----------+ +-----------+
+-----------+ +-----------+ +-----------+
|           | | p         | |           |
|     4     | |     5     | |     6     |
|           | |           | |           |
+-----------+ +-----------+ +-----------+
+-----------+ +-----------+ +-----------+
|           | |           | |           |
|      7    | |     8     | |     9     |
|           | |           | |           |
+-----------+ +-----------+ +-----------+

Another press on 4 toggles the mode

+-----------+ +-----------+ +-----------+
|           | |           | |           |
|     1     | |     2     | |     3     |
|           | |           | |           |
+-----------+ +-----------+ +-----------+
+-----------+ +-----------+ +-----------+
|           | | +         | |           |
|     4     | |     5     | |     6     |
|           | |           | |           |
+-----------+ +-----------+ +-----------+
+-----------+ +-----------+ +-----------+
|           | |           | |           |
|      7    | |     8     | |     9     |
|           | |           | |           |
+-----------+ +-----------+ +-----------+

Additionally, the background color of the button or the text color could also be changed to make the current mode more visible.

black-sheep-dev commented 2 years ago

One question...

You mean every number button will save its own last used mode (add / note)? The last step is not clear to me (Another press on 4 toggles the mode). You mean by pressing 5 toggles the mode.

elBoberido commented 2 years ago

No, there is a global mode so pressing a button means either toggle the mode if the button was already selected or switch to the new number and keep the mode if it's a new button. This way it is obvious what happens and with each button press there is only one change. Having each button saving it's mode would make it confusing.

Basically the behavior would be like now but instead of having a separate add/note button, a press on the already selected button toggles mode.

elBoberido commented 2 years ago

I had some more thought on this and tried to find specific cases where this feature would be helpful. Let's assume we have the following situation in the bottom left square

                   222         
                   222         
                   222         
                    |          
                    v          

+-----------+ +-----------+ +-----------+
|    444    | |           | |           |   
|    444    | |           | |           |   
|    444    | |           | |           |   
+-----------+ +-----------+ +-----------+
+-----------+ +-----------+ +-----------+
|           | |           | |    777    |
|           | |           | |    777    |
|           | |           | |    777    |
+-----------+ +-----------+ +-----------+
+-----------+ +-----------+ +-----------+
|           | |    111    | |           |        222
|           | |    111    | |           |     <- 222
|           | |    111    | |           |        222
+-----------+ +-----------+ +-----------+

The 2 could be a solution for two cells. If not already in note mode, one would now switch to that mode to add the notes.

                   222         
                   222         
                   222         
                    |          
                    v          

+-----------+ +-----------+ +-----------+
|    444    | |           | |  2        |   
|    444    | |           | |           |   
|    444    | |           | |           |   
+-----------+ +-----------+ +-----------+
+-----------+ +-----------+ +-----------+
|  2        | |           | |    777    |
|           | |           | |    777    |
|           | |           | |    777    |
+-----------+ +-----------+ +-----------+
+-----------+ +-----------+ +-----------+
|           | |    111    | |           |        222
|           | |    111    | |           |     <- 222
|           | |    111    | |           |        222
+-----------+ +-----------+ +-----------+

Now one pressed on 3 on the number pad and sees this situation

      333                        333
      333                        333
      333                        333
       |                          |
       v                          v

+-----------+ +-----------+ +-----------+
|    444    | |           | |  2        |        333
|    444    | |           | |           |     <- 333
|    444    | |           | |           |        333
+-----------+ +-----------+ +-----------+
+-----------+ +-----------+ +-----------+
|  2        | |           | |    777    |
|           | |           | |    777    |
|           | |           | |    777    |
+-----------+ +-----------+ +-----------+
+-----------+ +-----------+ +-----------+
|           | |    111    | |           |           
|           | |    111    | |           |           
|           | |    111    | |           |           
+-----------+ +-----------+ +-----------+

Since the thumb would still be above the 3, one could just tab it a second time and then put the solution in the center of the square.

I also thought about the visualization of the mode. Instead of putting a small + or a pen in the corner of the button it would be better to let the font size on the button mirror the font size of the number and notes on the squares. So when in add mode, the numbers would be big and when in note mode the numbers would be small and also placed on the button where they would be placed on the cell. This is how the number pad would look like with ascii art in add mode

+-----------+ +-----------+ +-----------+
|    111    | |    222    | |    333    |
|    111    | |    222    | |    333    |
|    111    | |    222    | |    333    |
+-----------+ +-----------+ +-----------+
+-----------+ +-----------+ +-----------+
|    444    | |    555    | |    666    |
|    444    | |    555    | |    666    |
|    444    | |    555    | |    666    |
+-----------+ +-----------+ +-----------+
+-----------+ +-----------+ +-----------+
|    777    | |    888    | |    999    |
|    777    | |    888    | |    999    |
|    777    | |    888    | |    999    |
+-----------+ +-----------+ +-----------+

and this would be note mode

+-----------+ +-----------+ +-----------+
|  1        | |     2     | |        3  |
|           | |           | |           |
|           | |           | |           |
+-----------+ +-----------+ +-----------+
+-----------+ +-----------+ +-----------+
|           | |           | |           |
|  4        | |     5     | |        6  |
|           | |           | |           |
+-----------+ +-----------+ +-----------+
+-----------+ +-----------+ +-----------+
|           | |           | |           |
|           | |           | |           |
|  7        | |     8     | |        9  |
+-----------+ +-----------+ +-----------+

This is how the mode would change after pressing 3,3,4,5. We start with 2 as the initial selected number in note mode

+-----------+ ############# +-----------+
|  1        | #     2     # |        3  |
|           | #           # |           |
|           | #           # |           |
+-----------+ ############# +-----------+
+-----------+ +-----------+ +-----------+
|           | |           | |           |
|  4        | |     5     | |        6  |
|           | |           | |           |
+-----------+ +-----------+ +-----------+
+-----------+ +-----------+ +-----------+
|           | |           | |           |
|           | |           | |           |
|  7        | |     8     | |        9  |
+-----------+ +-----------+ +-----------+

Now 3 is pressed for the first time

+-----------+ +-----------+ #############
|  1        | |     2     | #        3  #
|           | |           | #           #
|           | |           | #           #
+-----------+ +-----------+ #############
+-----------+ +-----------+ +-----------+
|           | |           | |           |
|  4        | |     5     | |        6  |
|           | |           | |           |
+-----------+ +-----------+ +-----------+
+-----------+ +-----------+ +-----------+
|           | |           | |           |
|           | |           | |           |
|  7        | |     8     | |        9  |
+-----------+ +-----------+ +-----------+

Now 3 is pressed for the second time

+-----------+ +-----------+ #############
|    111    | |    222    | #    333    #
|    111    | |    222    | #    333    #
|    111    | |    222    | #    333    #
+-----------+ +-----------+ #############
+-----------+ +-----------+ +-----------+
|    444    | |    555    | |    666    |
|    444    | |    555    | |    666    |
|    444    | |    555    | |    666    |
+-----------+ +-----------+ +-----------+
+-----------+ +-----------+ +-----------+
|    777    | |    888    | |    999    |
|    777    | |    888    | |    999    |
|    777    | |    888    | |    999    |
+-----------+ +-----------+ +-----------+

Now 4 is pressed

+-----------+ +-----------+ +-----------+
|    111    | |    222    | |    333    |
|    111    | |    222    | |    333    |
|    111    | |    222    | |    333    |
+-----------+ +-----------+ +-----------+
############# +-----------+ +-----------+
#    444    # |    555    | |    666    |
#    444    # |    555    | |    666    |
#    444    # |    555    | |    666    |
############# +-----------+ +-----------+
+-----------+ +-----------+ +-----------+
|    777    | |    888    | |    999    |
|    777    | |    888    | |    999    |
|    777    | |    888    | |    999    |
+-----------+ +-----------+ +-----------+

Now 5 is pressed

+-----------+ +-----------+ +-----------+
|    111    | |    222    | |    333    |
|    111    | |    222    | |    333    |
|    111    | |    222    | |    333    |
+-----------+ +-----------+ +-----------+
+-----------+ ############# +-----------+
|    444    | #    555    # |    666    |
|    444    | #    555    # |    666    |
|    444    | #    555    # |    666    |
+-----------+ ############# +-----------+
+-----------+ +-----------+ +-----------+
|    777    | |    888    | |    999    |
|    777    | |    888    | |    999    |
|    777    | |    888    | |    999    |
+-----------+ +-----------+ +-----------+

This got quite lengthy but I hope it is now more clear what I meant with this feature request.

Feel free to just close this request if it does not fit into your vision for the app :)