aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
Diffstat (limited to 'gui')
-rw-r--r--gui/dialog.cpp10
-rw-r--r--gui/newgui.cpp4
-rw-r--r--gui/theme-config.cpp8
3 files changed, 18 insertions, 4 deletions
diff --git a/gui/dialog.cpp b/gui/dialog.cpp
index ef396301be..6fce837aa0 100644
--- a/gui/dialog.cpp
+++ b/gui/dialog.cpp
@@ -80,12 +80,12 @@ int Dialog::runModal() {
}
void Dialog::open() {
- Widget *w = _firstWidget;
_result = 0;
_visible = true;
g_gui.openDialog(this);
+ Widget *w = _firstWidget;
// Search for the first objects that wantsFocus() (if any) and give it the focus
while (w && !w->wantsFocus()) {
w = w->_next;
@@ -331,14 +331,18 @@ void Dialog::removeWidget(Widget *del) {
Widget *w = _firstWidget;
if (del == _firstWidget) {
- _firstWidget = _firstWidget->_next;
+ Widget *del_next = del->_next;
+ del->_next = 0;
+ _firstWidget = del_next;
return;
}
w = _firstWidget;
while (w) {
if (w->_next == del) {
- w->_next = w->_next->_next;
+ Widget *del_next = del->_next;
+ del->_next = 0;
+ w->_next = del_next;
return;
}
w = w->_next;
diff --git a/gui/newgui.cpp b/gui/newgui.cpp
index c340c1e8fd..4afc59367b 100644
--- a/gui/newgui.cpp
+++ b/gui/newgui.cpp
@@ -22,6 +22,7 @@
* $Id$
*/
+#include "backends/keymapper/keymapper.h"
#include "common/events.h"
#include "common/system.h"
#include "common/util.h"
@@ -236,7 +237,7 @@ void NewGui::runLoop() {
}
Common::EventManager *eventMan = _system->getEventManager();
-
+ eventMan->getKeymapper()->pushKeymap("gui");
while (!_dialogStack.empty() && activeDialog == getTopDialog()) {
if (_needRedraw) {
redraw();
@@ -328,6 +329,7 @@ void NewGui::runLoop() {
// Delay for a moment
_system->delayMillis(10);
}
+ eventMan->getKeymapper()->popKeymap();
// HACK: since we reopen all dialogs anyway on redraw
// we for now use Theme::closeAllDialogs here, until
diff --git a/gui/theme-config.cpp b/gui/theme-config.cpp
index 9fc23c5e7d..81e0a5c1d7 100644
--- a/gui/theme-config.cpp
+++ b/gui/theme-config.cpp
@@ -377,6 +377,14 @@ const char *Theme::_defaultConfigINI =
"scummsaveload_delete=prev.x (prev.y - 30) prev.w prev.h\n"
"scummsaveload_extinfo.visible=true\n"
"\n"
+"# Keymapper remap dialog\n"
+"remap=(10) (10) (w - 20) (h - 20)\n"
+"remap_spacing=10\n"
+"remap_popup=remap_spacing remap_spacing (remap.w - remap_spacing * 2) (kLineHeight + 2)\n"
+"remap_keymap_area=remap_spacing (remap_popup.y + remap_popup.h + remap_spacing) (remap.w - remap_spacing * 2) (remap.h - self.y - remap_spacing * 2 - kBigButtonHeight)\n"
+"remap_label_width=100\n"
+"remap_button_width=80\n"
+"remap_close_button=((remap.w - kButtonWidth) / 2) (remap_keymap_area.y + remap_keymap_area.h + remap_spacing) kButtonWidth kBigButtonHeight\n"
"############################################\n"
"[chooser]\n"
"chooserW=(w - 2 * 8)\n"