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
88 }88 }
89 89
90 if (ui->zone != nil) {90 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 {
92 if (v < ui->min) {94 if (v < ui->min) {
93 if (failoor)95 if (failoor)
94 return -1;96 return -1;
@@ -98,8 +100,8 @@ ui_write(UI *ui, int type, char *s) · 3 unmodified lines
98 return -1;100 return -1;
99 v = ui->max;101 v = ui->max;
100 }102 }
103 *ui->zone = v;
101 }104 }
102 *ui->zone = v;
103 }105 }
104 106
105 return 0;107 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