Show poll's multiple answer radios as checkboxes
This commit is contained in:
parent
6f5e0b051a
commit
9ee1e4347b
1 changed files with 19 additions and 3 deletions
|
|
@ -1168,7 +1168,11 @@ void Poll::paintRadio(
|
||||||
auto pen = regular->p;
|
auto pen = regular->p;
|
||||||
pen.setWidth(st.thickness);
|
pen.setWidth(st.thickness);
|
||||||
p.setPen(pen);
|
p.setPen(pen);
|
||||||
p.drawEllipse(rect);
|
if (_flags & PollData::Flag::MultiChoice) {
|
||||||
|
p.drawRoundedRect(rect, st::buttonRadius, st::buttonRadius);
|
||||||
|
} else {
|
||||||
|
p.drawEllipse(rect);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (checkmark > 0.) {
|
if (checkmark > 0.) {
|
||||||
const auto removeFull = (st.diameter / 2 - st.thickness);
|
const auto removeFull = (st.diameter / 2 - st.thickness);
|
||||||
|
|
@ -1178,7 +1182,13 @@ void Poll::paintRadio(
|
||||||
pen.setWidth(st.thickness);
|
pen.setWidth(st.thickness);
|
||||||
p.setPen(pen);
|
p.setPen(pen);
|
||||||
p.setBrush(color);
|
p.setBrush(color);
|
||||||
p.drawEllipse(rect.marginsRemoved({ removeNow, removeNow, removeNow, removeNow }));
|
if (_flags & PollData::Flag::MultiChoice) {
|
||||||
|
p.drawRoundedRect(
|
||||||
|
rect.marginsRemoved({ removeNow, removeNow, removeNow, removeNow }),
|
||||||
|
st::buttonRadius, st::buttonRadius);
|
||||||
|
} else {
|
||||||
|
p.drawEllipse(rect.marginsRemoved({ removeNow, removeNow, removeNow, removeNow }));
|
||||||
|
}
|
||||||
const auto &icon = outbg ? (selected ? st::historyPollOutChosenSelected : st::historyPollOutChosen) : (selected ? st::historyPollInChosenSelected : st::historyPollInChosen);
|
const auto &icon = outbg ? (selected ? st::historyPollOutChosenSelected : st::historyPollOutChosen) : (selected ? st::historyPollInChosenSelected : st::historyPollInChosen);
|
||||||
icon.paint(p, left + (st.diameter - icon.width()) / 2, top + (st.diameter - icon.height()) / 2, width());
|
icon.paint(p, left + (st.diameter - icon.width()) / 2, top + (st.diameter - icon.height()) / 2, width());
|
||||||
}
|
}
|
||||||
|
|
@ -1251,7 +1261,13 @@ void Poll::paintFilling(
|
||||||
: st::historyPollChoiceRight;
|
: st::historyPollChoiceRight;
|
||||||
const auto cleft = aleft - st::historyPollPercentSkip - icon.width();
|
const auto cleft = aleft - st::historyPollPercentSkip - icon.width();
|
||||||
const auto ctop = ftop - (icon.height() - thickness) / 2;
|
const auto ctop = ftop - (icon.height() - thickness) / 2;
|
||||||
p.drawEllipse(cleft, ctop, icon.width(), icon.height());
|
if (_flags & PollData::Flag::MultiChoice) {
|
||||||
|
p.drawRoundedRect(
|
||||||
|
QRect{ cleft, ctop, icon.width(), icon.height() },
|
||||||
|
st::buttonRadius, st::buttonRadius);
|
||||||
|
} else {
|
||||||
|
p.drawEllipse(cleft, ctop, icon.width(), icon.height());
|
||||||
|
}
|
||||||
icon.paint(p, cleft, ctop, width);
|
icon.paint(p, cleft, ctop, width);
|
||||||
//barleft += icon.width() - radius;
|
//barleft += icon.width() - radius;
|
||||||
//barwidth -= icon.width() - radius;
|
//barwidth -= icon.width() - radius;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue