[Kde-games-devel] Re: Patch for KMainWindow: managing fixed central widget

Dave Corrie kde at davecorrie.com
Thu May 22 14:08:26 CEST 2003


On Wednesday 21 May 2003 10:29 am, Nicolas Hadacek wrote:
> On Wednesday 21 May 2003 10:56 am, Benjamin Meyer wrote:
> > On Tuesday 20 May 2003 5:37 am, Nicolas Hadacek wrote:
> > > Hi,
> > >
> > > I propose the attached patch to allow KMainWindow to correctly
> > > manage fixed-size central widget. This can be used by at least
> > > several games. There is probably a better solution for this
> > > problem but this is a bit tricky to fix, at least for me...
> >
> > Which games were you thinking of?  Can't it be solved by some other
> > means such as scallable graphics?
>
> kmines, ksirtet & co, kreversi at least.

I had this problem in kshisen too. It's possible to work-around this 
without modifying Q/KMainWindow, but it's not that pretty. Of course, 
the ideal solution is to fix QMainWindow, but I can understand the 
desire for a more immediate solution.

KShisen (KDE_3_1_BRANCH) uses a workaround. Although you cannot manually 
change the size of the board, if the (fixed-size) board is too large 
for the users screen, then the board is scaled so that it does. (If you 
want to test this out without switching to 640x480 mode, replace the 
calls to kapp->desktop()->width() etc. in Board::setSize() in 
board.cpp.)

> yes you can probably solve that by using scalable graphics but
> 1) I don't really want to do that

Did you miss the second half of this sentence? :-)

'I don't really want to do that because ...' :

> 2) I can be tricky because in most case you want to keep the same
> aspect ratio.

In kshisen (HEAD) we overcome that by drawing the tiles as big as 
possible (whilst still maintaining the aspect ratio) and padding the 
remaining area with the background pixmap.

> 3) perharps a personnal feeling but when you have some size which
> fits you, you probably don't want to change it by accidently resizing
> the window.

I can understand that feeling. Personally so long as I can control the 
zoom level, I don't mind it if I accidently resize the window and when 
correcting it I end up with a size 2 pixels different to the original.

Cheers,

Dave


More information about the kde-games-devel mailing list