[Scummvm-cvs-logs] SF.net SVN: scummvm:[43426] scummvm/trunk/gui/TabWidget.cpp
lordhoto at users.sourceforge.net
lordhoto at users.sourceforge.net
Sun Aug 16 07:38:16 CEST 2009
Revision: 43426
http://scummvm.svn.sourceforge.net/scummvm/?rev=43426&view=rev
Author: lordhoto
Date: 2009-08-16 05:38:16 +0000 (Sun, 16 Aug 2009)
Log Message:
-----------
Added Ninteno DS specific hack, which takes care of tab button width problems. This actually is not a NDS specific problem, but so far the NDS seems to be the only backend, which has a custom (hardcoded) dialog, which makes problems with our theme layouts. Instead of r43423, which enabled auto width calculaction for tab buttons on all platforms, this commit limits this to the Nintendo DS backend. This takes care of possible layout changes, caused by the changes of the commit. I also added a comment with possible solutions to this problem.
Modified Paths:
--------------
scummvm/trunk/gui/TabWidget.cpp
Modified: scummvm/trunk/gui/TabWidget.cpp
===================================================================
--- scummvm/trunk/gui/TabWidget.cpp 2009-08-16 05:38:03 UTC (rev 43425)
+++ scummvm/trunk/gui/TabWidget.cpp 2009-08-16 05:38:16 UTC (rev 43426)
@@ -91,7 +91,37 @@
int numTabs = _tabs.size();
+ // HACK: Nintendo DS uses a custom config dialog. This dialog does not work with
+ // our default "Globals.TabWidget.Tab.Width" setting.
+ //
+ // TODO: Add proper handling in the theme layout for such cases.
+ //
+ // There are different solutions to this problem:
+ // - offer a "Tab.Width" setting per tab widget and thus let the Ninteno DS
+ // backend set a default value for its special dialog.
+ //
+ // - change our themes to use auto width calculaction by default
+ //
+ // - change "Globals.TabWidget.Tab.Width" to be the minimal tab width setting and
+ // rename it accordingly.
+ // Actually this solution is pretty similar to our HACK for the Nintendo DS
+ // backend. This hack enables auto width calculation by default with the
+ // "Globals.TabWidget.Tab.Width" value as minimal width for the tab buttons.
+ //
+ // - we might also consider letting every tab button having its own width.
+ //
+ // - other solutions you can think of, which are hopefully less evil ;-).
+ //
+ // Of course also the Ninteno DS' dialog should be in our layouting engine, instead
+ // of being hard coded like it is right now.
+ //
+ // There are checks for __DS__ all over this source file to take care of the
+ // aforemnetioned problem.
+#ifdef __DS__
+ if (true) {
+#else
if (g_gui.xmlEval()->getVar("Globals.TabWidget.Tab.Width") == 0) {
+#endif
if (_tabWidth == 0)
_tabWidth = 40;
// Determine the new tab width
@@ -217,6 +247,10 @@
if (_tabWidth == 0) {
_tabWidth = 40;
+#ifdef __DS__
+ }
+ if (true) {
+#endif
int maxWidth = _w / _tabs.size();
for (uint i = 0; i < _tabs.size(); ++i) {
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