allow big block to be shrunk in size as well as expanded (suprisingly complex!)
authorPaul Davis <paul@linuxaudiosystems.com>
Thu, 27 Dec 2012 18:49:12 +0000 (18:49 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Thu, 27 Dec 2012 18:49:12 +0000 (18:49 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@13740 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/audio_clock.cc
gtk2_ardour/audio_clock.h

index c1d256fd02747076418eb28e2f0071c5aad0fc0f..015e328307fcfd41a0bbe582762a3430a1377e53 100644 (file)
@@ -80,6 +80,7 @@ AudioClock::AudioClock (const string& clock_name, bool transient, const string&
        , foreground_attr (0)
        , first_height (0)
        , first_width (0)
+       , style_resets_first (true)
        , layout_height (0)
        , layout_width (0)
        , info_height (0)
@@ -550,8 +551,15 @@ AudioClock::on_size_request (Gtk::Requisition* req)
                req->height += separator_height;
        }
 
-       first_height = req->height;
-       first_width = req->width;
+       if (_fixed_width) {
+               first_height = req->height;
+               first_width = req->width;
+       } else {
+               if (first_width == 0) {
+                       first_height = req->height;
+                       first_width = req->width;
+               }
+       }
 }
 
 void
@@ -2213,8 +2221,13 @@ void
 AudioClock::on_style_changed (const Glib::RefPtr<Gtk::Style>& old_style)
 {
        CairoWidget::on_style_changed (old_style);
-       first_width = 0;
-       first_height = 0;
+       if (style_resets_first) {
+               first_width = 0;
+               first_height = 0;
+       }
+       if (!_fixed_width) {
+               style_resets_first = false;
+       }
        set_font ();
        set_colors ();
 }
index dae6bb1ae47f2d47570bf8f1e5fd551ee5b655bc..81fd9172d9277cea9df49f4dd844f1aacfb2fcbd 100644 (file)
@@ -121,6 +121,7 @@ class AudioClock : public CairoWidget, public ARDOUR::SessionHandlePtr
 
        int first_height;
        int first_width;
+        bool style_resets_first;
        int layout_height;
        int layout_width;
        int info_height;