Reduce wasted space for Klondike and Grandfather
ClosedPublic

Authored by huftis on Sep 15 2018, 1:56 PM.

Details

Summary

Klondike and (especially) Grandfather reserves a lot of
space at the bottom of the screen for long card piles.
This results in very small cards, which makes the game
uncomfortable to play, especially on smaller screens.

This commmit reduces the space reserved at the bottom
of the screen, which automatically enlarges the cards.
Long piles don’t pose a problem, as KPat automatically
compresses the cards to fit the screen.

Even with the reduced space, the colours and numbers are
still clearly visible, also in a ‘worst case’ scenario with very
long piles. (In these two game types, only the colour
(i.e. red vs. black) matter, not the suit, so it is not a
problem if the suits of the cards aren’t visible.)

BUG: 307625
BUG: 378914

FIXED-IN: 18.08.2

Test Plan

Play Grandfather and Klondike before and after this patch.
Note that the cards are much bigger after the patch
and that the numbers and colours are still clearly visible.

Diff Detail

Repository
R410 KPatience
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
huftis created this revision.Sep 15 2018, 1:56 PM
Restricted Application added a reviewer: KDE Games. · View Herald TranscriptSep 15 2018, 1:56 PM
Restricted Application added a subscriber: kde-games-devel. · View Herald Transcript
huftis requested review of this revision.Sep 15 2018, 1:56 PM
huftis added a comment.EditedSep 15 2018, 2:00 PM

Grandfather before (start):


Grandfather after (start):

Grandfather before (~worse case):


Grandfather after (~worse case):

Klondike before (start):


Klondike after (start):

Klondike before (worse case):


Klondike after (worse case):

This comment was removed by huftis.
huftis edited the summary of this revision. (Show Details)Sep 15 2018, 2:09 PM
huftis edited the summary of this revision. (Show Details)
huftis edited the summary of this revision. (Show Details)Sep 15 2018, 2:18 PM
huftis edited the summary of this revision. (Show Details)

This does indeed look better, and I didn't saw issues at screen resolutions I could test.

One question however: Did you get those numbers simply by trial and error, or is there some meaning behind them?

This does indeed look better, and I didn't saw issues at screen resolutions I could test.

One question however: Did you get those numbers simply by trial and error, or is there some meaning behind them?

I got them by trial and error. They’re based on a tradeoff between having large cards and having enough space for long piles.

While the padding value used for Klondike is based on some calculations (i.e. it uses a multiple of play[i]->spread().y()), the padding values in all the solitaire variants seem to basically be just numbers chosen so that things look all right.

fabiank accepted this revision.Sep 20 2018, 5:58 PM

Well, considering that it does look better now, and I'm not aware how to derive any better values, I'll say ship it. Do you have commit access?

This revision is now accepted and ready to land.Sep 20 2018, 5:58 PM
This revision was automatically updated to reflect the committed changes.