History

button/checkbox: stick to 0/1

Sigrid Haflínudóttir committed 6 years ago

Commit e63eebc1 parent fd272a81 file · +4 −2Browse files

Unified · Split

uiglue.c+4−2
@@ -88,7 +88,9 @@ ui_write(UI *ui, int type, char *s) · 87 unmodified lines
8888 }
8989
9090 if (ui->zone != nil) {
91− if (ui->type != UIButton && ui->type != UICheckBox) {
91+ if (ui->type == UIButton || ui->type == UICheckBox) {
92+ *ui->zone = v > 0 ? 1 : 0;
93+ } else {
9294 if (v < ui->min) {
9395 if (failoor)
9496 return -1;
@@ -98,8 +100,8 @@ ui_write(UI *ui, int type, char *s) · 3 unmodified lines
98100 return -1;
99101 v = ui->max;
100102 }
103+ *ui->zone = v;
101104 }
102− *ui->zone = v;
103105 }
104106
105107 return 0;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t