2 * Copyright (C) 2017 Robin Gareus <robin@gareus.org>
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 #include "stripable_colorpicker.h"
23 using namespace ARDOUR_UI_UTILS;
25 StripableColorDialog::StripableColorDialog ()
27 signal_response().connect (sigc::mem_fun (*this, &StripableColorDialog::finish_color_edit));
30 StripableColorDialog::~StripableColorDialog ()
36 StripableColorDialog::reset ()
43 StripableColorDialog::popup (boost::shared_ptr<ARDOUR::Stripable> s)
45 if (_stripable == s) {
46 /* keep modified color */
53 get_colorsel()->set_has_opacity_control (false);
54 get_colorsel()->set_has_palette (true);
56 Gdk::Color c = gdk_color_from_rgba (_stripable->presentation_info().color ());
58 get_colorsel()->set_previous_color (c);
59 get_colorsel()->set_current_color (c);
65 StripableColorDialog::finish_color_edit (int response)
67 if (_stripable && response == RESPONSE_OK) {
68 _stripable->presentation_info().set_color (gdk_color_to_rgba (get_colorsel()->get_current_color()));