fix: mobile poll row border radius

This commit is contained in:
Evangelos Paterakis 2022-12-06 06:17:31 +02:00
parent 8f30b48b88
commit 37b5c7376e
No known key found for this signature in database
GPG key ID: FE5185F095BFC8C9

View file

@ -30,7 +30,7 @@ public class Tooth.Widgets.VoteBox: Box {
}
public string generate_css_style(int percentage) {
return @".ttl-poll-$(percentage).ttl-poll-winner { background: linear-gradient(to right, alpha(@accent_bg_color, .5) $(percentage)%, transparent 0%); } .ttl-poll-$(percentage) { background: linear-gradient(to right, alpha(@view_fg_color, .1) $(percentage)%, transparent 0%); }";
return @".ttl-poll-$(percentage).ttl-poll-winner { background: linear-gradient(to right, alpha(@accent_bg_color, .5) $(percentage)%, transparent 0%); } .ttl-poll-$(percentage) { background: linear-gradient(to right, alpha(@view_fg_color, .1) $(percentage)%, transparent 0%); }.ttl-poll-row:first-child{border-top-left-radius: 12px;border-top-right-radius: 12px;}.ttl-poll-row:last-child{border-bottom-left-radius: 12px;border-bottom-right-radius: 12px;}";
}
void update(){
@ -58,6 +58,8 @@ public class Tooth.Widgets.VoteBox: Box {
//creates the entries of poll
foreach (API.PollOption p in poll.options){
var row = new Adw.ActionRow ();
row.add_css_class("ttl-poll-row");
//if it is own poll
if(poll.expired || poll.voted){
// If multiple, Checkbox else radioButton