Miniature - it moves!
How it begun
When I read Quim's thread about the idea for a better Maemo chess app I knew I wanted to join the project. To me, it's all about the device and the sparkling Hildon UX. I really want a good chess app, for myself! I want to play chess online, everywhere! And I want to analyze games as (OK, maybe after =p) they happen. No more "I'll check this position later" (we all know this rarely happens).
So I finally started last friday. At this point, Quim and Andreas had already created a beautiful, content-rich wiki page. It took a while for me to digest it all, and I added information where appropiate.
Kick-starting the development
Andreas had registered a garage project, but we eventually decided to use gitorious for our repository. Gitorious' UI definitely improved over the recent months, and the possibility to have teams working on a single project - also known as not-so-extreme-dvcs-development - makes gitorious a better choice than github, at the moment.
Saturday night (what better things to do than coding some Qt - my soul will be forever lost) I had a first running example (see screenshot). Currently, Miniature can move between positions, using next/prev menu navigation (we don't need this functionality per se, but it's perhaps a good demonstration that the simple approach I took works).
So no matter the toolkit, no matter the outdated packages or the endless confusion I had with the various Qt repos at gitorious - this project is really fun! Hopefully we get to make a 0.1 release soon.
You should probably move the board to the center and scale it to fill the whole screen. You can then move the player-specific data to one side for each player. Now, that does not really "map" the players to their colors/starting position.
So, one neat thing would be to make this game portrait mode (again, centering the board and scaling it to full-screen). Then, you can have the black player's name and scores above the board (where the black player starts) and the white player's name and scores below the board (where the white player starts).
Maybe even make it so that the black player's text is flipped vertically - this way, two players can use the N900 as a chess board and play against each other while sitting vis-a-vis and not having to turn the device on every (game-)turn :)
(Just some UI ideas, I don't play chess myself.. ;)
thp, the goal is definitely to activate native portrait mode in Qt =) See the latest mock-up (our reference, so to say, where we want to go): http://wiki.maemo.org/Miniature/Developm... but also the reasoning http://talk.maemo.org/showpost.php?p=365...
Though it would be great if you could make your comment into a mock-up, too! Especially your last paragraph, two players using *one* N900, is interesting.
Hi
If you want to run your application in portrait mode then you can add these lines. The code goes in your main widget construtor.
#ifdef Q_WS_HILDON
//Includes for portrait mode support
# include <X11/Xlib.h>
# include <X11/Xatom.h>
# include <QtGui/QX11Info>
#endif
#ifndef Q_WS_HILDON
int value = 1;
Atom portraitSupport = XInternAtom(QX11Info::display(), "_HILDON_PORTRAIT_MODE_SUPPORT", false);
Atom portraitRequest = XInternAtom(QX11Info::display(), "_HILDON_PORTRAIT_MODE_REQUEST", false);
XChangeProperty(QX11Info::display(), winId(), portraitSupport, XA_CARDINAL, 32, PropModeReplace, (uchar *)&value, 1);
XChangeProperty(QX11Info::display(), winId(), portraitRequest, XA_CARDINAL, 32, PropModeReplace, (uchar *)&value, 1);
#endif
If you want to change application orientation when you rotate the device than there is a Qt extra library in extra devel that does the job.
Take a look at http://wiki.maemo.org/Maemo_Qt_Extra_Lib... for more info
gnuton, thanks a lot!
hoops replace
#ifndef Q_WS_HILDON with
#ifdef Q_WS_HILDON
mail me if you run in troubles or you need help
thanks gnuton, it works!