Skip to content

Enter key behaviour in several the pop-up windows on the opening GUI

Pedro Lopes requested to merge github/fork/Raidenkyu/import&editButton into master

PR Description

#17620 Should be solved

This PR adds a new variable to the class Project Manager, that solves the weird behaviour the enter key had in some pop-up windows of the opening GUI, one of them being the Import one. This type of behaviour was also found in the other pop-up windows such as New Project or Scan.

When a popup window appears from clicking any of the buttons on the right side of the window, the enter key no longer interacts with the main window while those are active, it only interacts with the popup window itself (as it should happen in my opinion).

Before, if the user had highlighted one of the listed projects and the clicked one of those buttons, if the enter key was pressed while the "okay" button of the specific pop-up window (In the Import window, the button is "Import&Edit", for example) was not valid.

Now, in those situations, nothing happens, and the pop-up windows remain open and waiting for the user interaction.

Changes

To fix the issue, we simply added a boolean variable called popup_window_active (with the respective getter and setter), that would allow the program to know when a pop-up window was active or not. The variable is initialized with false,and is set to true while a pop-up window is active in the show_dialog() function.

bool popup_window_active = false;

On the project_manager.cpp file, the _unhandled_input() function will verify the value of the popup_window_active variable, and will only do anything else if the variable is true.

		switch (k->get_scancode()) {

			case KEY_ENTER: {
				if(!npdialog->get_popup_window_active())
					_open_project();
			} break;

To Do

Update documentation related to the changed classes.

Merge request reports