[Scummvm-cvs-logs] SF.net SVN: scummvm:[33990] scummvm/branches/gsoc2008-vkeybd

kenny-d at users.sourceforge.net kenny-d at users.sourceforge.net
Mon Aug 18 17:13:56 CEST 2008


Revision: 33990
          http://scummvm.svn.sourceforge.net/scummvm/?rev=33990&view=rev
Author:   kenny-d
Date:     2008-08-18 15:13:55 +0000 (Mon, 18 Aug 2008)

Log Message:
-----------
remap dialog updates

Modified Paths:
--------------
    scummvm/branches/gsoc2008-vkeybd/backends/keymapper/remap-dialog.cpp
    scummvm/branches/gsoc2008-vkeybd/gui/theme-config.cpp

Modified: scummvm/branches/gsoc2008-vkeybd/backends/keymapper/remap-dialog.cpp
===================================================================
--- scummvm/branches/gsoc2008-vkeybd/backends/keymapper/remap-dialog.cpp	2008-08-18 14:47:08 UTC (rev 33989)
+++ scummvm/branches/gsoc2008-vkeybd/backends/keymapper/remap-dialog.cpp	2008-08-18 15:13:55 UTC (rev 33990)
@@ -118,9 +118,6 @@
 }
 
 void RemapDialog::reflowLayout() {
-	int labelWidth = g_gui.evaluator()->getVar("remap_popup_labelW");
-	_kmPopUp->changeLabelWidth(labelWidth);
-
 	int scrollbarWidth, buttonHeight;
 	if (g_gui.getWidgetSize() == GUI::kBigWidgetSize) {
 		buttonHeight = GUI::kBigButtonHeight;
@@ -134,14 +131,16 @@
 	int areaW = g_gui.evaluator()->getVar("remap_keymap_area.w");
 	int areaH = g_gui.evaluator()->getVar("remap_keymap_area.h");
 	int spacing = g_gui.evaluator()->getVar("remap_spacing");
-	_colCount = g_gui.evaluator()->getVar("remap_col_count");
-	if (_colCount <= 0) 
-		error("remap_col_count must be >= 0");
+	int labelWidth = g_gui.evaluator()->getVar("remap_label_width");
+	int buttonWidth = g_gui.evaluator()->getVar("remap_button_width");
+	int colWidth = labelWidth + buttonWidth + spacing;
+	_colCount = (areaW - scrollbarWidth) / colWidth;
 	_rowCount = (areaH + spacing) / (buttonHeight + spacing);
-	if (_rowCount <= 0) 
+	if (_colCount <= 0 || _rowCount <= 0) 
 		error("Remap dialog too small to display any keymaps!");
-	int colWidth = (areaW - scrollbarWidth - _colCount * spacing) / _colCount;
 
+	_kmPopUp->changeLabelWidth(labelWidth);
+
 	_scrollBar->resize(areaX + areaW - scrollbarWidth, areaY, scrollbarWidth, areaH);
 	_scrollBar->_entriesPerPage = _rowCount;
 	_scrollBar->_numEntries = 1;
@@ -162,10 +161,10 @@
 		} else {
 			widg = _keymapWidgets[i];
 		}
-		uint x = areaX + (i % _colCount) * (colWidth + spacing);
+		uint x = areaX + (i % _colCount) * colWidth;
 		uint y = areaY + (i / _colCount) * (buttonHeight + spacing);
-		widg.actionText->resize(x, y + textYOff, colWidth / 2, kLineHeight);
-		widg.keyButton->resize(x + colWidth / 2, y, colWidth / 2, buttonHeight);
+		widg.actionText->resize(x, y + textYOff, labelWidth, kLineHeight);
+		widg.keyButton->resize(x + labelWidth, y, buttonWidth, buttonHeight);
 	}
 	while (oldSize > newSize) {
 		ActionWidgets widg = _keymapWidgets.remove_at(--oldSize);
@@ -238,6 +237,8 @@
 void RemapDialog::loadKeymap() {
 	_currentActions.clear();
 	if (_activeKeymaps->size() > 0 && _kmPopUp->getSelected() == 0) {
+		// load active keymaps
+
 		List<const HardwareKey*> freeKeys (_keymapper->getHardwareKeySet()->getHardwareKeys());
 
 		// add most active keymap's keys

Modified: scummvm/branches/gsoc2008-vkeybd/gui/theme-config.cpp
===================================================================
--- scummvm/branches/gsoc2008-vkeybd/gui/theme-config.cpp	2008-08-18 14:47:08 UTC (rev 33989)
+++ scummvm/branches/gsoc2008-vkeybd/gui/theme-config.cpp	2008-08-18 15:13:55 UTC (rev 33990)
@@ -374,13 +374,13 @@
 "scummsaveload_extinfo.visible=true\n"
 "\n"
 "# Keymapper remap dialog\n"
-"remap=(w / 4) (h / 4) (w / 2) (h / 2)\n"
+"remap=(10) (10) (w - 20) (h - 20)\n"
 "remap_spacing=10\n"
-"remap_popup=remap_spacing remap_spacing (prev.w - remap_spacing * 2) (kLineHeight + 2)\n"
-"remap_popup_labelW=kButtonWidth\n"
-"remap_col_count=2\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_close_button=((remap.w - kButtonWidth) / 2) (prev.y + prev.h + remap_spacing) kButtonWidth 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"


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list