Radio buttons are now diamonds.
This commit is contained in:
parent
236f6b4e39
commit
3580565ca6
2 changed files with 41 additions and 15 deletions
10
dvx/dvxApp.c
10
dvx/dvxApp.c
|
|
@ -840,12 +840,12 @@ static void drawPopupLevel(AppContextT *ctx, DisplayT *d, const BlitOpsT *ops, c
|
||||||
drawVLine(d, ops, cx + 2, cy - 1, 2, fg);
|
drawVLine(d, ops, cx + 2, cy - 1, 2, fg);
|
||||||
drawVLine(d, ops, cx + 3, cy - 2, 2, fg);
|
drawVLine(d, ops, cx + 3, cy - 2, 2, fg);
|
||||||
} else if (item->type == MenuItemRadioE) {
|
} else if (item->type == MenuItemRadioE) {
|
||||||
// Filled circle bullet (5x5)
|
// Filled diamond bullet (5x5)
|
||||||
drawHLine(d, ops, cx - 1, cy - 2, 3, fg);
|
drawHLine(d, ops, cx, cy - 2, 1, fg);
|
||||||
drawHLine(d, ops, cx - 2, cy - 1, 5, fg);
|
drawHLine(d, ops, cx - 1, cy - 1, 3, fg);
|
||||||
drawHLine(d, ops, cx - 2, cy, 5, fg);
|
drawHLine(d, ops, cx - 2, cy, 5, fg);
|
||||||
drawHLine(d, ops, cx - 2, cy + 1, 5, fg);
|
drawHLine(d, ops, cx - 1, cy + 1, 3, fg);
|
||||||
drawHLine(d, ops, cx - 1, cy + 2, 3, fg);
|
drawHLine(d, ops, cx, cy + 2, 1, fg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -175,19 +175,45 @@ void widgetRadioPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const Bitmap
|
||||||
uint32_t bg = w->bgColor ? w->bgColor : colors->contentBg;
|
uint32_t bg = w->bgColor ? w->bgColor : colors->contentBg;
|
||||||
int32_t boxY = w->y + (w->h - CHECKBOX_BOX_SIZE) / 2;
|
int32_t boxY = w->y + (w->h - CHECKBOX_BOX_SIZE) / 2;
|
||||||
|
|
||||||
// Draw radio box
|
// Draw diamond-shaped radio box
|
||||||
BevelStyleT bevel;
|
int32_t bx = w->x;
|
||||||
bevel.highlight = colors->windowShadow;
|
int32_t mid = CHECKBOX_BOX_SIZE / 2;
|
||||||
bevel.shadow = colors->windowHighlight;
|
uint32_t hi = colors->windowShadow;
|
||||||
bevel.face = bg;
|
uint32_t sh = colors->windowHighlight;
|
||||||
bevel.width = 1;
|
|
||||||
drawBevel(d, ops, w->x, boxY, CHECKBOX_BOX_SIZE, CHECKBOX_BOX_SIZE, &bevel);
|
|
||||||
|
|
||||||
// Draw filled dot if selected
|
// Fill interior
|
||||||
|
for (int32_t i = 0; i < CHECKBOX_BOX_SIZE; i++) {
|
||||||
|
int32_t dist = i < mid ? i : CHECKBOX_BOX_SIZE - 1 - i;
|
||||||
|
int32_t left = mid - dist;
|
||||||
|
int32_t right = mid + dist;
|
||||||
|
|
||||||
|
if (right > left) {
|
||||||
|
drawHLine(d, ops, bx + left + 1, boxY + i, right - left - 1, bg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Diamond border — upper-left edges get highlight, lower-right get shadow
|
||||||
|
for (int32_t i = 0; i < mid; i++) {
|
||||||
|
int32_t left = mid - i;
|
||||||
|
int32_t right = mid + i;
|
||||||
|
drawHLine(d, ops, bx + left, boxY + i, 1, hi);
|
||||||
|
drawHLine(d, ops, bx + right, boxY + i, 1, sh);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int32_t i = mid; i < CHECKBOX_BOX_SIZE; i++) {
|
||||||
|
int32_t left = mid - (CHECKBOX_BOX_SIZE - 1 - i);
|
||||||
|
int32_t right = mid + (CHECKBOX_BOX_SIZE - 1 - i);
|
||||||
|
drawHLine(d, ops, bx + left, boxY + i, 1, hi);
|
||||||
|
drawHLine(d, ops, bx + right, boxY + i, 1, sh);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Draw filled diamond if selected
|
||||||
if (w->parent && w->parent->type == WidgetRadioGroupE &&
|
if (w->parent && w->parent->type == WidgetRadioGroupE &&
|
||||||
w->parent->as.radioGroup.selectedIdx == w->as.radio.index) {
|
w->parent->as.radioGroup.selectedIdx == w->as.radio.index) {
|
||||||
rectFill(d, ops, w->x + 3, boxY + 3,
|
for (int32_t i = -2; i <= 2; i++) {
|
||||||
CHECKBOX_BOX_SIZE - 6, CHECKBOX_BOX_SIZE - 6, fg);
|
int32_t span = 3 - (i < 0 ? -i : i);
|
||||||
|
drawHLine(d, ops, bx + mid - span, boxY + mid + i, span * 2 + 1, fg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t labelX = w->x + CHECKBOX_BOX_SIZE + CHECKBOX_GAP;
|
int32_t labelX = w->x + CHECKBOX_BOX_SIZE + CHECKBOX_GAP;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue