2 Copyright (C) 2015-2016 Carl Hetherington <cth@carlh.net>
4 This file is part of DCP-o-matic.
6 DCP-o-matic is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 DCP-o-matic is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
21 #include "text_subtitle_appearance_dialog.h"
22 #include "lib/text_subtitle_content.h"
23 #include "lib/subtitle_content.h"
25 #include <wx/clrpicker.h>
27 using boost::shared_ptr;
29 TextSubtitleAppearanceDialog::TextSubtitleAppearanceDialog (wxWindow* parent, shared_ptr<SubtitleContent> content)
30 : TableDialog (parent, _("Subtitle appearance"), 2, 1, true)
33 add (_("Colour"), true);
34 _colour = new wxColourPickerCtrl (this, wxID_ANY);
37 _outline = new wxCheckBox (this, wxID_ANY, _("Outline"));
41 add (_("Outline colour"), true);
42 _outline_colour = new wxColourPickerCtrl (this, wxID_ANY);
43 add (_outline_colour);
47 _colour->SetColour (wxColour (_content->colour().r, _content->colour().g, _content->colour().b));
48 _outline->SetValue (_content->outline ());
49 _outline_colour->SetColour (
50 wxColour (_content->outline_colour().r, _content->outline_colour().g, _content->outline_colour().b)
55 TextSubtitleAppearanceDialog::apply ()
57 wxColour const c = _colour->GetColour ();
58 _content->set_colour (dcp::Colour (c.Red(), c.Green(), c.Blue()));
59 _content->set_outline (_outline->GetValue ());
60 wxColour const oc = _outline_colour->GetColour ();
61 _content->set_outline_colour (dcp::Colour (oc.Red(), oc.Green(), oc.Blue()));