X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fcontent_sub_panel.cc;h=9c236abebfef4a1b552b5e8b5f084a283f569a1d;hb=2bf0a8aa3c5274b663b23caf74fc2b36be20cdfe;hp=8cf04b93c49112c1047a452fe471bc35a60e6bd4;hpb=c04fec82d25127fafa73c3daff87bece9aa8c8e8;p=dcpomatic.git diff --git a/src/wx/content_sub_panel.cc b/src/wx/content_sub_panel.cc index 8cf04b93c..9c236abeb 100644 --- a/src/wx/content_sub_panel.cc +++ b/src/wx/content_sub_panel.cc @@ -25,11 +25,10 @@ #include "lib/compose.hpp" #include "lib/log.h" #include -#include using std::list; using std::string; -using boost::shared_ptr; +using std::shared_ptr; #if BOOST_VERSION >= 106100 using namespace boost::placeholders; #endif @@ -45,23 +44,10 @@ ContentSubPanel::ContentSubPanel (ContentPanel* p, wxString name) _grid = new wxGridBagSizer (DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP); _sizer->Add (_grid, 0, wxALL, 8); - - _config_connection = Config::instance()->Changed.connect (boost::bind (&ContentSubPanel::config_changed, this, _1)); -} - -void -ContentSubPanel::config_changed (Config::Property p) -{ - if (p == Config::INTERFACE_COMPLEXITY) { - _grid->Clear (); - add_to_grid (); - _sizer->Layout (); - _grid->Layout (); - } } void -ContentSubPanel::setup_refer_button (wxCheckBox* button, wxStaticText* note, shared_ptr dcp, bool can_reference, wxString cannot) const +ContentSubPanel::setup_refer_button (wxCheckBox* button, wxStaticText* note, shared_ptr dcp, bool can_reference, wxString cannot) { button->Enable (can_reference); @@ -73,11 +59,24 @@ ContentSubPanel::setup_refer_button (wxCheckBox* button, wxStaticText* note, sha note->Wrap (400); - if (cannot.IsEmpty() || Config::instance()->interface_complexity() == Config::INTERFACE_SIMPLE) { + if (cannot.IsEmpty()) { note->Hide (); } else { note->Show (); } + layout (); +} + + +void +ContentSubPanel::layout () +{ + int x; + int y; + GetViewStart (&x, &y); + Scroll (0, 0); _sizer->Layout (); + Scroll (x, y); } +