Invalidate char_pixel_* on possible font change
authorJulien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr>
Sat, 20 Aug 2016 14:01:15 +0000 (16:01 +0200)
committerJulien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr>
Sat, 20 Aug 2016 14:01:15 +0000 (16:01 +0200)
So that the padding and other elements always correctly depend on the
font instead of the default GTK font (which might have a wildly
different size from the fixed size fonts of Ardour's custom theme).

gtk2_ardour/ardour_button.cc

index fbc6defdc1b947597a77e221c7baffd0f41458d7..df6311604ade2d73a73e783b99d5f50eb54b2f1d 100644 (file)
@@ -965,6 +965,11 @@ ArdourButton::on_style_changed (const RefPtr<Gtk::Style>&)
 {
        _update_colors = true;
        CairoWidget::set_dirty ();
+       _char_pixel_width = 0;
+       _char_pixel_height = 0;
+       if (is_realized()) {
+               queue_resize ();
+       }
 }
 
 void