#endif
-HTMLDialog::HTMLDialog (wxWindow* parent, wxString title, wxString html)
+HTMLDialog::HTMLDialog (wxWindow* parent, wxString title, wxString html, bool ok)
: wxDialog (parent, wxID_ANY, title)
{
auto sizer = new wxBoxSizer (wxVERTICAL);
/* Add some resources that are used by HTML passed into this dialog */
wxMemoryFSHandler::AddFile(
"me.jpg",
- wxBitmap(std_to_wx(boost::filesystem::path(resources_path() / "me.jpg").string()), wxBITMAP_TYPE_JPEG), wxBITMAP_TYPE_JPEG
+ wxBitmap(bitmap_path("me.jpg"), wxBITMAP_TYPE_JPEG), wxBITMAP_TYPE_JPEG
);
auto h = new wxHtmlWindow (this);
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);
SetSize (800, -1);
/* Set height */
- SetSize (h->GetInternalRepresentation()->GetWidth(), h->GetInternalRepresentation()->GetHeight() + 64);
+ SetSize (h->GetInternalRepresentation()->GetWidth(), h->GetInternalRepresentation()->GetHeight() + 256);
+
+ if (ok) {
+ auto buttons = CreateSeparatedButtonSizer(wxOK);
+ if (buttons) {
+ sizer->Add(buttons, wxSizerFlags().Expand().DoubleBorder());
+ }
+ }
}