summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-04-29 15:22:29 +0100
committerCarl Hetherington <cth@carlh.net>2015-04-29 15:22:29 +0100
commitd43aadb0bbb5cbdebbc5c95cb3065ed0aa49296a (patch)
treebede96d010ba2c10a368a8a4d02ae44db6896cbf /src
parent56cdff7fbb1f9c55f9ad3076fcb885e4005189ce (diff)
Hand-apply 077d2abb480a883119783db3f957f175e22e543b from master; stop more flickering when dragging in the timeline in OS X.
Diffstat (limited to 'src')
-rw-r--r--src/wx/video_panel.cc20
-rw-r--r--src/wx/wx_util.cc8
-rw-r--r--src/wx/wx_util.h1
3 files changed, 21 insertions, 8 deletions
diff --git a/src/wx/video_panel.cc b/src/wx/video_panel.cc
index 67c369de2..bc2faf1b3 100644
--- a/src/wx/video_panel.cc
+++ b/src/wx/video_panel.cc
@@ -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 ();
}
diff --git a/src/wx/wx_util.cc b/src/wx/wx_util.cc
index 0119799d2..cd3d39c67 100644
--- a/src/wx/wx_util.cc
+++ b/src/wx/wx_util.cc
@@ -196,6 +196,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)
{
if (widget->GetValue() != value) {
diff --git a/src/wx/wx_util.h b/src/wx/wx_util.h
index eeb3fee43..f55ecbd52 100644
--- a/src/wx/wx_util.h
+++ b/src/wx/wx_util.h
@@ -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);