Hand-apply 077d2abb480a883119783db3f957f175e22e543b from master; stop more flickering...
authorCarl Hetherington <cth@carlh.net>
Wed, 29 Apr 2015 14:22:29 +0000 (15:22 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 29 Apr 2015 14:22:29 +0000 (15:22 +0100)
ChangeLog
TO_PORT
src/wx/video_panel.cc
src/wx/wx_util.cc
src/wx/wx_util.h

index 183ebc3418afb41b62c099eb441af600614da073..c6ba37bdf5ac8f41d1bf58680df53d0bc4110cd6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-04-29  c.hetherington  <cth@carlh.net>
+
+       * Hand-apply 291179175729b62e17a9c322cd27ae134d1310d9 from master;
+       stop more flickering when dragging in the timeline on OS X.
+
 2015-04-22  c.hetherington  <cth@carlh.net>
 
        * Add P3 colour conversion preset.
diff --git a/TO_PORT b/TO_PORT
index b0957b3052d70ba0a40532072bf928a71eea3ad0..af1f4d145cfd2df16088fa826c7ef3313694669c 100644 (file)
--- a/TO_PORT
+++ b/TO_PORT
@@ -1,5 +1,3 @@
-
-291179175729b62e17a9c322cd27ae134d1310d9
 8d92cce7d2885afa13ee4cb6f546dbf43942124b
 c994839239e84a1f62865ed82fdc090900a66b03
 1114df4c0d2167f6b7b394bfbf85890cd0a4a3e3
index 67c369de2ddf9db63ebdb919a9d8decc8c26461e..bc2faf1b30b27f07bbab39de2aac599457f31947 100644 (file)
@@ -246,16 +246,20 @@ VideoPanel::film_content_changed (int property)
                setup_description ();
        } else if (property == VideoContentProperty::COLOUR_CONVERSION) {
                if (!vcs) {
-                       _colour_conversion->SetLabel (wxT (""));
+                       checked_set (_colour_conversion, wxT (""));
                } else if (vcs->colour_conversion ()) {
                        optional<size_t> preset = vcs->colour_conversion().get().preset ();
                        vector<PresetColourConversion> cc = Config::instance()->colour_conversions ();
-                       _colour_conversion->SetLabel (preset ? std_to_wx (cc[preset.get()].name) : _("Custom"));
+                       if (preset) {
+                               checked_set (_colour_conversion, std_to_wx (cc[preset.get()].name));
+                       } else {
+                               checked_set (_colour_conversion, _("Custom"));
+                       }
                        _enable_colour_conversion->SetValue (true);
                        _colour_conversion->Enable (true);
                        _colour_conversion_button->Enable (true);
                } else {
-                       _colour_conversion->SetLabel (_("None"));
+                       checked_set (_colour_conversion, _("None"));
                        _enable_colour_conversion->SetValue (false);
                        _colour_conversion->Enable (false);
                        _colour_conversion_button->Enable (false);
@@ -264,12 +268,12 @@ VideoPanel::film_content_changed (int property)
                if (fcs) {
                        string p = Filter::ffmpeg_string (fcs->filters ());
                        if (p.empty ()) {
-                               _filters->SetLabel (_("None"));
+                               checked_set (_filters, _("None"));
                        } else {
                                if (p.length() > 25) {
                                        p = p.substr (0, 25) + "...";
                                }
-                               _filters->SetLabel (std_to_wx (p));
+                               checked_set (_filters, p);
                        }
                }
        } else if (property == VideoContentProperty::VIDEO_FADE_IN) {
@@ -317,10 +321,10 @@ VideoPanel::setup_description ()
 {
        VideoContentList vc = _parent->selected_video ();
        if (vc.empty ()) {
-               _description->SetLabel ("");
+               checked_set (_description, wxT (""));
                return;
        } else if (vc.size() > 1) {
-               _description->SetLabel (_("Multiple content selected"));
+               checked_set (_description, _("Multiple content selected"));
                return;
        }
 
@@ -331,7 +335,7 @@ VideoPanel::setup_description ()
                d += "\n ";
        }
 
-       _description->SetLabel (std_to_wx (d));
+       checked_set (_description, d);
        _sizer->Layout ();
 }
 
index 0119799d26aaa3d0c8ff17dde466169877d6fd78..cd3d39c67d129ddd05967fd2cf3b522d75c418d9 100644 (file)
@@ -195,6 +195,14 @@ checked_set (wxStaticText* widget, string value)
        }
 }
 
+void
+checked_set (wxStaticText* widget, wxString value)
+{
+       if (widget->GetLabel() != value) {
+               widget->SetLabel (value);
+       }
+}
+
 void
 checked_set (wxCheckBox* widget, bool value)
 {
index eeb3fee4321a76c6e5e18029b93651bffc70f6cc..f55ecbd5272a0fc0c2043730fdd763d6fbd926e2 100644 (file)
@@ -75,6 +75,7 @@ extern void checked_set (wxTextCtrl* widget, std::string value);
 extern void checked_set (wxCheckBox* widget, bool value);
 extern void checked_set (wxRadioButton* widget, bool value);
 extern void checked_set (wxStaticText* widget, std::string value);
+extern void checked_set (wxStaticText* widget, wxString value);
 
 extern int wx_get (wxChoice* widget);
 extern int wx_get (wxSpinCtrl* widget);