diff options
author | Eugene Sandulenko | 2009-05-09 22:36:57 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2009-05-09 22:36:57 +0000 |
commit | 87fdc5d544e73a4cb520eb6c794bb12d87f0a6a8 (patch) | |
tree | 0c17a184751c144156bc2da3e2034cc151e27264 | |
parent | 8b813f02b850f7b67c17cdaf4a058c73f2febe2c (diff) | |
download | scummvm-rg350-87fdc5d544e73a4cb520eb6c794bb12d87f0a6a8.tar.gz scummvm-rg350-87fdc5d544e73a4cb520eb6c794bb12d87f0a6a8.tar.bz2 scummvm-rg350-87fdc5d544e73a4cb520eb6c794bb12d87f0a6a8.zip |
Original GSoC'08 keymapper now works.
Plans:
- Make remap dialog less ugly
- Port dialog to other resolutions and classic theme
- Stop polluting config namespaces with keymap
- Improve automapper
- Add support to the engines and backends
svn-id: r40404
-rw-r--r-- | backends/keymapper/remap-dialog.cpp | 17 | ||||
-rw-r--r-- | gui/themes/scummmodern/scummmodern_layout.stx | 9 |
2 files changed, 18 insertions, 8 deletions
diff --git a/backends/keymapper/remap-dialog.cpp b/backends/keymapper/remap-dialog.cpp index cded6ba5a0..5a61b9e7e1 100644 --- a/backends/keymapper/remap-dialog.cpp +++ b/backends/keymapper/remap-dialog.cpp @@ -80,6 +80,8 @@ void RemapDialog::open() { keymapCount += _gameKeymaps->size(); } + debug(3, "keymaps: %d", keymapCount); + _keymapTable = (Keymap **)malloc(sizeof(Keymap*) * keymapCount); Keymapper::Domain::iterator it; @@ -125,14 +127,15 @@ void RemapDialog::reflowLayout() { int buttonHeight = g_gui.xmlEval()->getVar("Globals.Button.Height", 0); int scrollbarWidth = g_gui.xmlEval()->getVar("Globals.Scrollbar.Width", 0); - int areaX = g_gui.xmlEval()->getVar("KeyRemapper.KeymapArea.x"); - int areaY = g_gui.xmlEval()->getVar("KeyRemapper.KeymapArea.y"); - int areaW = g_gui.xmlEval()->getVar("KeyRemapper.KeymapArea.w"); - int areaH = g_gui.xmlEval()->getVar("KeyRemapper.KeymapArea.h"); - int spacing = 10; //g_gui.xmlEval()->getVar("remap_spacing"); - int labelWidth = 100; //g_gui.xmlEval()->getVar("remap_label_width"); - int buttonWidth = 80; //g_gui.xmlEval()->getVar("remap_button_width"); + int16 areaX, areaY; + uint16 areaW, areaH; + int spacing = g_gui.xmlEval()->getVar("Globals.KeyRemapper.Spacing"); + int labelWidth = g_gui.xmlEval()->getVar("Globals.KeyRemapper.LabelWidth"); + int buttonWidth = g_gui.xmlEval()->getVar("Globals.KeyRemapper.ButtonWidth"); int colWidth = labelWidth + buttonWidth + spacing; + + g_gui.xmlEval()->getWidgetData((const String&)String("KeyRemapper.KeymapArea"), areaX, areaY, areaW, areaH); + _colCount = (areaW - scrollbarWidth) / colWidth; _rowCount = (areaH + spacing) / (buttonHeight + spacing); if (_colCount <= 0 || _rowCount <= 0) diff --git a/gui/themes/scummmodern/scummmodern_layout.stx b/gui/themes/scummmodern/scummmodern_layout.stx index 9ed10503ad..6377cc48ae 100644 --- a/gui/themes/scummmodern/scummmodern_layout.stx +++ b/gui/themes/scummmodern/scummmodern_layout.stx @@ -45,6 +45,10 @@ <def var = 'ScummSaveLoad.ExtInfo.Visible' value = '1'/> + <def var = 'KeyRemapper.Spacing' value = '10'/> + <def var = 'KeyRemapper.LabelWidth' value = '100'/> + <def var = 'KeyRemapper.ButtonWidth' value = '80'/> + <widget name = 'OptionsLabel' size = '110, Globals.Line.Height' /> @@ -712,8 +716,11 @@ <layout type = 'vertical' padding = '8, 8, 32, 8' center = 'true'> <widget name = 'Popup' type = 'PopUp' + width = '600' /> - <widget name = 'KeymapArea' + <widget name = 'KeymapArea' + width = '600' + height = '378' /> <widget name = 'Close' type = 'Button' |