optional<string>
-find_release_notes(optional<string> current)
+find_release_notes(bool dark, optional<string> current)
{
auto last = Config::instance()->last_release_notes_version();
if (!current) {
Config::instance()->set_last_release_notes_version(*current);
- const string header = String::compose("<h1>DCP-o-matic %1 release notes</h1>", *current);
+ string const colour = dark ? "white" : "black";
+ auto const span = String::compose("<span style=\"color: %1\">", colour);
+
+ const string header = String::compose("<h1>%1DCP-o-matic %2 release notes</span></h1>", span, *current);
if (!last) {
- return header +
+ return header + span +
_("In this version there are changes to the way that subtitles are positioned. "
"Positioning should now be more correct, with respect to the standards, but you "
"should check any subtitles in your project to make sure that they are placed "
- "where you want them.");
+ "where you want them.")
+ + "</span>";
}
return {};
#include <string>
-extern boost::optional<std::string> find_release_notes(boost::optional<std::string> current = boost::optional<std::string>());
+extern boost::optional<std::string> find_release_notes(bool dark, boost::optional<std::string> current = boost::optional<std::string>());
UpdateChecker::instance()->run ();
}
- auto release_notes = find_release_notes();
+ auto release_notes = find_release_notes(gui_is_dark());
if (release_notes) {
auto notes = new HTMLDialog(nullptr, _("Release notes"), std_to_wx(*release_notes), true);
notes->Centre();
h->SetPage (html);
sizer->Add (h, 1, wxEXPAND | wxALL, 6);
+ if (gui_is_dark()) {
+ h->SetHTMLBackgroundColour(*wxBLACK);
+ }
+
h->Bind (wxEVT_HTML_LINK_CLICKED, boost::bind(&HTMLDialog::link_clicked, this, _1));
SetSizer (sizer);
{
for (auto version: { "2.16.19", "2.16.20", "2.18.0", "2.18.1devel6" }) {
Config::instance()->unset_last_release_notes_version();
- auto notes = find_release_notes(string(version));
+ auto notes = find_release_notes(true, string(version));
BOOST_CHECK(notes.get_value_or("").find("In this version there are changes to the way that subtitles are positioned.") != string::npos);
}
}
{
for (auto version: { "2.16.19", "2.16.20", "2.18.0", "2.18.1devel6" }) {
Config::instance()->set_last_release_notes_version("2.16.19");
- auto notes = find_release_notes(string(version));
+ auto notes = find_release_notes(false, string(version));
BOOST_CHECK(!static_cast<bool>(notes));
}
}