clean up patch change/sysex headers.
[ardour.git] / gtk2_ardour / color_theme_manager.cc
index be0278ef9b4746779f0552f879c2511aba708b43..013a0764d0360748dec3c9aca1d5aeb125e24d0d 100644 (file)
@@ -61,11 +61,10 @@ ColorThemeManager::ColorThemeManager ()
        , palette_window (0)
        , color_theme_label (_("Color Theme"))
 {
-       set_spacing (12);
-
        std::map<string,string> color_themes;
 
        get_color_themes (color_themes);
+       int n = 0;
 
        if (color_themes.size() > 1) {
                theme_list = TreeStore::create (color_theme_columns);
@@ -105,8 +104,9 @@ ColorThemeManager::ColorThemeManager ()
                hbox->set_spacing (6);
                hbox->pack_start (color_theme_label, false, false);
                hbox->pack_start (*align, true, true);
-               pack_start (*hbox, PACK_SHRINK);
                hbox->show_all ();
+               table.attach (*hbox, 0, 3, n, n + 1);
+               ++n;
        }
 
        reset_button.signal_clicked().connect (sigc::mem_fun (*this, &ColorThemeManager::reset_canvas_colors));
@@ -146,8 +146,9 @@ ColorThemeManager::ColorThemeManager ()
 
        notebook.set_size_request (400, 400);
 
-       pack_start (notebook, true, true);
-       pack_start (reset_button, false, false);
+       table.attach (notebook, 0, 3, n, n + 1);
+       ++n;
+       table.attach (reset_button, 0, 3, n, n + 1);
 
        color_dialog.get_colorsel()->set_has_opacity_control (true);
        color_dialog.get_colorsel()->set_has_palette (true);
@@ -161,10 +162,18 @@ ColorThemeManager::ColorThemeManager ()
        setup_modifiers ();
 
        UIConfiguration::instance().ColorsChanged.connect (sigc::mem_fun (*this, &ColorThemeManager::colors_changed));
+}
 
-       show_all ();
+
+ColorThemeManager::~ColorThemeManager ()
+{
+       if (palette_group) { 
+               palette_group->clear (true);  
+               delete palette_group;
+       }
 }
 
+
 void
 ColorThemeManager::setup_modifiers ()
 {
@@ -311,7 +320,6 @@ ColorThemeManager::build_palette_canvas (ArdourCanvas::Canvas& canvas, ArdourCan
        for (uint32_t y = 0; y < height - box_size && color_num < color_limit; y += box_size) {
                for (uint32_t x = 0; x < width - box_size && color_num < color_limit; x += box_size) {
                        ArdourCanvas::Rectangle* r = new ArdourCanvas::Rectangle (&group, ArdourCanvas::Rect (x, y, x + box_size, y + box_size));
-
                        string name = nc[color_num++].name;
 
                        UIConfiguration::Colors::iterator c = colors.find (name);
@@ -595,9 +603,16 @@ ColorThemeManager::set_state_from_config ()
 }
 
 void
-ColorThemeManager::add_to_page (OptionEditorPage* page)
+ColorThemeManager::add_to_page (OptionEditorPage* p)
 {
-       add_widget_to_page (page, this);
+       int const n = p->table.property_n_rows();
+       int m = n + 1;
+       if (!_note.empty ()) {
+               ++m;
+       }
+       p->table.resize (m, 3);
+       p->table.attach (box, 1, 3, n, n + 1, FILL | EXPAND, SHRINK, 0, 0);
+       maybe_add_note (p, n + 1);
 }
 
 Gtk::Widget&