← Back to team overview

widelands-dev team mailing list archive

Re: [Merge] lp:~widelands-dev/widelands/align-align into lp:widelands

 

Review: Approve code review

Did a complete Code review again.
lets get this in:

@bunnybot merge

Diff comments:

> 
> === modified file 'src/ui_basic/progressbar.cc'
> --- src/ui_basic/progressbar.cc	2017-01-25 18:55:59 +0000
> +++ src/ui_basic/progressbar.cc	2017-02-24 10:22:08 +0000
> @@ -84,12 +84,12 @@
>  		dst.fill_rect(Rectf(0.f, h, get_w(), get_h() - h), color);
>  	}
>  
> -	// Print the state in percent
> -	// TODO(unknown): use UI_FNT_COLOR_BRIGHT when merged
> -	uint32_t percent = static_cast<uint32_t>(fraction * 100);
> +	// Print the state in percent without decimal points.
>  	const std::string progress_text =
> -	   (boost::format("<font color=%1$s>%2$i%%</font>") % "ffffff" % percent).str();
> -	dst.blit(Vector2f(get_w() / 2.f, get_h() / 2.f), UI::g_fh1->render(as_uifont(progress_text)),
> -	         BlendMode::UseAlpha, UI::Align::kCenter);
> +		(boost::format("<font color=%s>%u%%</font>") % UI_FONT_CLR_BRIGHT.hex_value() % floor(fraction * 100)).str();
> +	const Image* rendered_text = UI::g_fh1->render(as_uifont(progress_text));
> +	Vector2f pos(get_w() / 2, get_h() / 2);
> +	UI::center_vertically(rendered_text->height(), &pos);
> +	dst.blit(pos, rendered_text, BlendMode::UseAlpha, UI::Align::kCenter);

this is not related to aligments but uses the UI_FONT_CLR_BRIGHT, looks OK for me

>  }
>  }


-- 
https://code.launchpad.net/~widelands-dev/widelands/align-align/+merge/317871
Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/align-align.


References