Move Gtkmm2ext widgets into libwidget
[ardour.git] / libs / gtkmm2ext / cairo_packer.cc
index c701a9aca923c8397c74ac35ab1b8b8ad24adc1a..2f7b46f47d5507795f22460db8ea2937ed1446b1 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012 Paul Davis 
+    Copyright (C) 2012 Paul Davis
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -27,9 +27,9 @@ CairoPacker::draw_background (Gtk::Widget& w, GdkEventExpose*)
        int x, y;
        Gtk::Widget* window_parent;
        Glib::RefPtr<Gdk::Window> win = Gtkmm2ext::window_to_draw_on (w, &window_parent);
-       
+
        if (win) {
-               
+
                Cairo::RefPtr<Cairo::Context> context = win->create_cairo_context();
                w.translate_coordinates (*window_parent, 0, 0, x, y);
 
@@ -65,6 +65,13 @@ CairoHPacker::on_expose_event (GdkEventExpose* ev)
        return HBox::on_expose_event (ev);
 }
 
+void
+CairoHPacker::on_size_allocate (Gtk::Allocation& alloc)
+{
+       get_parent()->queue_draw();
+       HBox::on_size_allocate (alloc);
+}
+
 CairoVPacker::CairoVPacker ()
 {
 }
@@ -83,6 +90,13 @@ CairoVPacker::on_realize ()
        CairoWidget::provide_background_for_cairo_widget (*this, get_bg());
 }
 
+void
+CairoVPacker::on_size_allocate (Gtk::Allocation& alloc)
+{
+       get_parent()->queue_draw();
+       VBox::on_size_allocate (alloc);
+}
+
 Gdk::Color
 CairoVPacker::get_bg () const
 {