Skip to content

Commit ccea4fd

Browse files
authored
Merge pull request #56 from keith-packard/ui-tweaks
UI tweaks
2 parents e6a3f9d + 623a62b commit ccea4fd

File tree

6 files changed

+81
-72
lines changed

6 files changed

+81
-72
lines changed

Xkw/Thermo.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -401,11 +401,7 @@ SetValues (Widget gcur, Widget greq, Widget gnew, Arg *args, Cardinal *count)
401401
redraw = TRUE;
402402
}
403403
if (!redraw && req->thermo.current != cur->thermo.current)
404-
{
405-
cairo_t *cr = get_cairo(new);
406-
drawMercury (new, cr, cur->thermo.current, req->thermo.current);
407-
cairo_destroy(cr);
408-
}
404+
Redisplay(gnew, NULL, NULL);
409405
return redraw;
410406
}
411407

kmcarlo/MonteCarlo.ad.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
*cards.rowMajor: True
3333

3434
*message.justify: left
35-
*message.label: Monte Carlo, Version @KGAMES_VERSION@
35+
*message.label: Keith's Monte Carlo, Version @KGAMES_VERSION@
3636
*cards.borderWidth: 0
3737
*menuBar.layout: vertical { \
3838
5 < -5 >\

kmcarlo/mc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
#include <Xkw/CardsUtil.h>
4444
#include <Xkw/Message.h>
4545
#include "MonteCarlo-res.h"
46+
#include "kgames.h"
4647

4748
Widget toplevel;
4849
Widget frame;
@@ -281,7 +282,7 @@ NewGame (void)
281282
FirstDeal();
282283
CardInitHistory();
283284
DisplayStacks();
284-
Message(message, "MonteCarlo version 0.9");
285+
Message(message, "Keith's Monte Carlo, Version " KGAMES_VERSION_STRING);
285286
}
286287

287288
static void

kmontana/montana.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
# include <Xkw/CardsUtil.h>
4545
# include <Xkw/Message.h>
4646
# include "KMontana-res.h"
47+
# include "kgames.h"
4748

4849
Widget toplevel;
4950
Widget frame;
@@ -405,7 +406,7 @@ NewGame (void)
405406
FirstDeal ();
406407
CardInitHistory ();
407408
DisplayStacks ();
408-
Message (message, "Keith's Montana version 1.0");
409+
Message (message, "Keith's Montana, Version " KGAMES_VERSION_STRING);
409410
Message (dealDisplay, "No deals.");
410411
}
411412

xmille/Mille.ad.in

Lines changed: 70 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,42 @@
1-
*score*Font: monospace-12
1+
#
2+
# Color theme:
3+
#
4+
# Overall background: #337744 (green)
5+
# Passive foreground: #fffff0
6+
# Active background: #fffff0
7+
# Active foreground: #000000
8+
# Accent colors: #774433 (brown), #334477 (blue)
9+
#
10+
11+
*Foreground: #000000
12+
*Background: #fffff0
13+
*message.Background: #fffff0
14+
*message.Foreground: #000000
15+
*errors.Background: #fffff0
16+
*errors.Foreground: #000000
17+
18+
*Layout.Background: #337744
19+
20+
*Label.Foreground: #fffff0
21+
*Label.Background: #337744
22+
23+
*menuBar.Background: #337744
24+
25+
*MilleCards.Background: #337744
26+
*MilleCards.internalBorderWidth: 3
27+
28+
*humanHand.Background: #774433
29+
30+
*Thermo.mercuryColor: #334477
31+
32+
*MilleCards.borderWidth: 0
33+
*Label.borderWidth: 0
34+
*Layout.borderWidth: 0
35+
*Thermo.borderWidth: 0
36+
*score.borderWidth: 0
37+
*menuBar.borderWidth: 0
38+
39+
*Command.ShapeStyle: oval
240

341
*layout.translations: #augment \n\
442
<Key>1: milleReasonable(1)\n\
@@ -33,8 +71,8 @@
3371
<Btn3Up>: stop(discard)
3472

3573
*layout.layout: vertical {\
36-
MenuBarBorderWidth = 1\
37-
HumanHandBorderWidth = 1\
74+
MenuBarBorderWidth = 0\
75+
HumanHandBorderWidth = 0\
3876
-$MenuBarBorderWidth \
3977
horizontal { \
4078
-$MenuBarBorderWidth menuBar < +inf -100% * > -$MenuBarBorderWidth \
@@ -48,24 +86,25 @@ horizontal { \
4886
computerPlay < -$PlayHorzShrink * +1 -$PlayVertShrink > \
4987
horizontal { \
5088
vertical { \
51-
computerMiles < +1 -100% * +1 >\
89+
computerMiles < +inf -100% * >\
5290
horizontal { \
53-
vertical { \
54-
message < +inf -inf * > \
55-
errors < +inf -inf * >\
56-
0 < +inf > \
57-
}\
5891
0 < +inf > \
5992
vertical { \
60-
deckCount < +inf -100% * +inf >\
61-
deck < -100% * +inf -100% > \
62-
0 < +1 > \
93+
0 < +inf > \
94+
deckCount < +inf -100% * >\
95+
deck < -100% * -100% > \
96+
0 < +inf > \
6397
} \
98+
0 < +inf > \
6499
} \
65-
humanMiles < +1 -100% * +1 > \
100+
humanMiles < +inf -100% * > \
101+
} \
102+
2 < -inf > \
103+
vertical { \
104+
score < +1 * +inf -1 > \
105+
message < +inf -inf * > \
106+
errors < +inf -inf * >\
66107
} \
67-
10 < -inf > \
68-
score < +1 * +1 > \
69108
} \
70109
humanPlay < -$PlayHorzShrink * +1 -$PlayVertShrink > \
71110
horizontal { \
@@ -85,75 +124,44 @@ horizontal { \
85124
} \
86125
}
87126

88-
*layout.Background: light gray
89-
90-
*menuBar.Background: cadet blue
91127
*MenuButton.shapeStyle: oval
92128
*fileMenuButton.leftBitmap: menu12
93129
*fileMenuButton.label: File
94130
*fileMenuButton.menuName: fileMenu
95131

132+
*message.label:
133+
*errors.label:
134+
96135
*fileMenu.restore.label: Restore from File
97136
*fileMenu.save.label: Save to File
98137
*fileMenu.quit.label: Quit
99138

100-
*deckCount.Background: light gray
101-
*deckCount.borderWidth: 0
102-
103-
*errors.Background: light gray
104-
*errors.borderWidth: 0
105-
139+
*score*Font: monospace-12
106140
*score.editType: edit
107141
*score.resize: both
108142
*score.translations:
109143
*score.baseTranslations:
110-
*message.Background: light gray
111-
*message.borderWidth: 0
112-
113-
*MilleCards.Background: light gray
114-
*MilleCards.internalBorderWidth: 3
115144

116-
*Thermo.borderWidth: 1
117-
*Thermo.mercuryColor: blue
118145
*Thermo.minimum: 0
119146
*Thermo.maximum: 1000
120147
*Thermo.minorStep: 25
121148
*Thermo.majorStep: 100
122149
*Thermo.vertical: false
123150
*Thermo.width: 500
124151

125-
*computerPlay.borderWidth: 0
126152
*computerPlay.rowsHint: true
127-
*computerPlay.rowOffset: 5
128-
129-
*computerSafeties.borderWidth: 0
153+
*computerPlay.rows: 7
130154

131-
*computerSafetyLabel.Background: light gray
132155
*computerSafetyLabel.label: Computer Safeties
133-
*computerSafetyLabel.borderWidth: 0
134-
135-
*deck.borderWidth: 0
136156

137-
*message.label:
138-
139-
*errors.label:
140-
141-
*Command.ShapeStyle: oval
142-
143-
*humanPlay.borderWidth: 0
144157
*humanPlay.rowsHint: true
145-
*humanPlay.rowOffset: 5
158+
*humanPlay.rows: 7
146159

147-
*humanSafeties.borderWidth: 0
148-
149-
*humanSafetyLabel.Background: light gray
150160
*humanSafetyLabel.label: Player Safeties
151-
*humanSafetyLabel.borderWidth: 0
152-
153-
*humanHand.Background: gray50
154161

155162
*yesOrNoShell.allowShellResize: true
156-
*yesOrNoLabel.borderWidth: 0
163+
*yesOrNoOk.label: OK
164+
*yesOrNoNo.label: No
157165

158166
*yesOrNoDialog.translations: #override\n\
159167
<Key>y: milleYes()\n\
@@ -162,7 +170,11 @@ horizontal { \
162170
*yesOrNoDialog.layout: vertical {\
163171
Spacing = (50 % of height yesOrNoLabel) \
164172
$Spacing < +inf -inf > \
165-
yesOrNoLabel \
173+
horizontal { \
174+
$Spacing < +inf -inf > \
175+
yesOrNoLabel \
176+
$Spacing < +inf -inf > \
177+
} \
166178
$Spacing < +inf -inf > \
167179
horizontal { \
168180
$Spacing < -inf > \
@@ -174,11 +186,10 @@ horizontal { \
174186
$Spacing < +inf -inf > \
175187
}
176188

177-
*yesOrNoOk.label: OK
178-
*yesOrNoNo.label: No
179-
180189
*promptedShell.allowShellResize: true
181190
*promptedValue*editType: edit
191+
*promptedOk.label: OK
192+
*promptedCancel.label: Cancel
182193

183194
*promptedDialog.layout: vertical {\
184195
Spacing = (20 % of height promptedLabel) \
@@ -190,6 +201,7 @@ horizontal { \
190201
promptedValue < +inf * +inf > \
191202
$Spacing < -inf > \
192203
} \
204+
$Spacing < +inf -inf > \
193205
horizontal { \
194206
$Spacing < -inf > \
195207
promptedOk \
@@ -199,7 +211,3 @@ horizontal { \
199211
} \
200212
$Spacing < +inf -inf > \
201213
}
202-
203-
*promptedDialog.promptedLabel.borderWidth: 0
204-
*promptedDialog.promptedOk.label: OK
205-
*promptedDialog.promptedCancel.label: Cancel

xmille/uiXt.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -623,10 +623,13 @@ make_hand (char *name, Widget parent, int rows, int cols, Bool overlap_rows)
623623
XtSetArg (args[i], XtNcardHeight, HEIGHT * scale); i++;
624624
XtSetArg (args[i], XtNnumRows, rows); i++;
625625
XtSetArg (args[i], XtNnumCols, cols); i++;
626+
XtSetArg (args[i], XtNinternalBorderWidth, WIDTH * scale / 20); i++;
626627
if (!overlap_rows) {
627-
XtSetArg (args[i], XtNrowOffset, HEIGHT * scale + WIDTH * scale/10); i++;
628+
XtSetArg (args[i], XtNrowOffset, HEIGHT * scale + WIDTH * scale/20); i++;
629+
} else {
630+
XtSetArg (args[i], XtNrowOffset, WIDTH * scale/20); i++;
628631
}
629-
XtSetArg (args[i], XtNcolOffset, WIDTH * scale + WIDTH * scale/10); i++;
632+
XtSetArg (args[i], XtNcolOffset, WIDTH * scale + WIDTH * scale/20); i++;
630633
display_x = 0;
631634
display_y = 0;
632635
if (rows == 1)

0 commit comments

Comments
 (0)