[Kde-games-devel] Re: Review Request: new libkdegames class KGameBasicWindow to replace KXmlGuiWindow on mobile formfactors

Stefan Majewsky majewsky at gmx.net
Fri Jul 22 23:04:20 CEST 2011


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://svn.reviewboard.kde.org/r/6744/
-----------------------------------------------------------

(Updated July 22, 2011, 9:04 p.m.)


Review request for KDE Games and usability.


Changes
-------

The build system has been adapted so that KGameBasicWindow can now be included in or excluded from the build, with the latter being the default (so that nothing changes for desktop users). Also, some conveniences have been added to the interface building API (the addStandardGroups() method and KStandard(Game)Action-based overloads for addAction()), and KActionMenus are now automatically assimilated into nested toolbars.


Summary (updated)
-------

General outline: Many games present only a small set of menuitems and toolbar actions to the user. Even on mobile form factors, all relevant actions can in many cases easily fit in the toolbar, thus removing the need for the (touch-unfriendly) and redundant menubar. On the implementation side, it would be beneficial to replace KXmlGuiWindow, which provides important features to desktop apps, but overcomplicates the problem for apps as simple as most games.

Solution: The new KGameBasicWindow class provides a hard-coded toolbar arrangement, in which only one toolbar is created at the top of the window. The most relevant actions are placed here directly, like one expects for a toolbar. Less used actions (like those commonly found in the "Settings" and "Help" menu) can be placed in a hierarchy, but only one level of the hierarchy is made visible at once in the toolbar.

For example, if the user wants to open the handbook, he finds the "Help" button on the toolbar. Upon clicking it, the toolbar changes and displays all actions in the "Help" group (plus a "Back" button). After selecting the "Handbook" action (and thus opening the handbook), the toolbar automatically returns to its default setup and presents the "important" actions again.

Implementation: KGameBasicWindow is a new class in libkdegames. Besides this new class, the only change is in KGameDifficulty, whose init() function may now take not only KXmlGuiWindows, but also KGameBasicWindows. This change is trivial because KGameBasicWindow provides an action collection, too. The build of KGameBasicWindow is toggled by the CMake flag "-DKDEGAMESMOBILE=ON", which is "OFF" by default (for all desktop users).

What's missing? The standard dialog for editing shortcuts could be made available, I do not consider this top priority because keyboard shortcuts are not that relevant on mobile formfactors.


Diffs (updated)
-----

  /trunk/KDE/kdegames/CMakeLists.txt 1242082 
  /trunk/KDE/kdegames/kdiamond/src/CMakeLists.txt 1242082 
  /trunk/KDE/kdegames/kdiamond/src/mainwindow.h 1242082 
  /trunk/KDE/kdegames/kdiamond/src/mainwindow.cpp 1242082 
  /trunk/KDE/kdegames/libkdegames/CMakeLists.txt 1242082 
  /trunk/KDE/kdegames/libkdegames/includes/CMakeLists.txt 1242082 
  /trunk/KDE/kdegames/libkdegames/includes/KGameBasicWindow PRE-CREATION 
  /trunk/KDE/kdegames/libkdegames/kgamebasicwindow.h PRE-CREATION 
  /trunk/KDE/kdegames/libkdegames/kgamebasicwindow.cpp PRE-CREATION 
  /trunk/KDE/kdegames/libkdegames/kgamedifficulty.h 1242082 
  /trunk/KDE/kdegames/libkdegames/kgamedifficulty.cpp 1242082 

Diff: http://svn.reviewboard.kde.org/r/6744/diff


Testing
-------

As usual, my guinea pig is KDiamond. The needed changes are included in this patch. Everything works fine here. Patch has also been tested on a WeTab tablet (with ToolBarPosition=bottom) and got positive feedback from users.


Screenshots
-----------

Side-by-side comparison of KXmlGuiWindow (back) and KGameBasicWindow (front) for KDiamond (not in screenshot: KActionMenu behind "New" button is now automatically assimilated into the nested toolbar paradigm)
  http://svn.reviewboard.kde.org/r/6744/s/616/
Overview of available toolbar states for KDiamond: main category, Settings subcategory, Help subcategory (not in screenshot: nested toolbar behind KActionMenu has replaced popup menu)
  http://svn.reviewboard.kde.org/r/6744/s/617/


Thanks,

Stefan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kde-games-devel/attachments/20110722/f9182fb7/attachment.htm 


More information about the kde-games-devel mailing list