Fix bars at side/top/bottom of image in full-screen player (#1397).
authorCarl Hetherington <cth@carlh.net>
Tue, 6 Nov 2018 15:00:30 +0000 (15:00 +0000)
committerCarl Hetherington <cth@carlh.net>
Tue, 6 Nov 2018 15:00:30 +0000 (15:00 +0000)
src/tools/dcpomatic_player.cc
src/wx/film_viewer.cc
src/wx/film_viewer.h

index 7008495..ff30ee6 100644 (file)
@@ -763,6 +763,7 @@ private:
                _info->Show (_mode != Config::PLAYER_MODE_FULL);
                _overall_panel->SetBackgroundColour (_mode == Config::PLAYER_MODE_FULL ? wxColour(0, 0, 0) : wxNullColour);
                ShowFullScreen (_mode == Config::PLAYER_MODE_FULL);
+               _viewer->set_pad_black (_mode != Config::PLAYER_MODE_WINDOW);
 
                if (_mode == Config::PLAYER_MODE_DUAL) {
                        _dual_screen = new wxFrame (this, wxID_ANY, wxT(""));
index ccff350..f8707f9 100644 (file)
@@ -86,6 +86,7 @@ FilmViewer::FilmViewer (wxWindow* p)
        , _closed_captions_dialog (new ClosedCaptionsDialog(p))
        , _outline_content (false)
        , _eyes (EYES_LEFT)
+       , _pad_black (false)
 #ifdef DCPOMATIC_VARIANT_SWAROOP
        , _in_watermark (false)
 #endif
@@ -354,16 +355,16 @@ FilmViewer::paint_panel ()
 
        if (_out_size.width < _panel_size.width) {
                /* XXX: these colours are right for GNOME; may need adjusting for other OS */
-               wxPen p (wxColour (240, 240, 240));
-               wxBrush b (wxColour (240, 240, 240));
+               wxPen   p (_pad_black ? wxColour(0, 0, 0) : wxColour(240, 240, 240));
+               wxBrush b (_pad_black ? wxColour(0, 0, 0) : wxColour(240, 240, 240));
                dc.SetPen (p);
                dc.SetBrush (b);
                dc.DrawRectangle (_out_size.width, 0, _panel_size.width - _out_size.width, _panel_size.height);
        }
 
        if (_out_size.height < _panel_size.height) {
-               wxPen p (wxColour (240, 240, 240));
-               wxBrush b (wxColour (240, 240, 240));
+               wxPen   p (_pad_black ? wxColour(0, 0, 0) : wxColour(240, 240, 240));
+               wxBrush b (_pad_black ? wxColour(0, 0, 0) : wxColour(240, 240, 240));
                dc.SetPen (p);
                dc.SetBrush (b);
                int const gap = (_panel_size.height - _out_size.height) / 2;
@@ -746,3 +747,9 @@ FilmViewer::seek_by (DCPTime by, bool accurate)
 {
        seek (_video_position + by, accurate);
 }
+
+void
+FilmViewer::set_pad_black (bool p)
+{
+       _pad_black = p;
+}
index ef124fa..b0dbf56 100644 (file)
@@ -78,6 +78,7 @@ public:
        boost::optional<int> dcp_decode_reduction () const;
        void set_outline_content (bool o);
        void set_eyes (Eyes e);
+       void set_pad_black (bool p);
 
        void slow_refresh ();
 
@@ -153,6 +154,10 @@ private:
 
        bool _outline_content;
        Eyes _eyes;
+       /** true to pad the viewer panel with black, false to use
+           the normal window background colour.
+       */
+       bool _pad_black;
 
 #ifdef DCPOMATIC_VARIANT_SWAROOP
        bool _in_watermark;