From b44c92e5aed634eb4cbb2ed4aaafc57a66f275e5 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 6 Nov 2018 15:00:30 +0000 Subject: [PATCH] Fix bars at side/top/bottom of image in full-screen player (#1397). --- src/tools/dcpomatic_player.cc | 1 + src/wx/film_viewer.cc | 15 +++++++++++---- src/wx/film_viewer.h | 5 +++++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/tools/dcpomatic_player.cc b/src/tools/dcpomatic_player.cc index 7008495c6..ff30ee68b 100644 --- a/src/tools/dcpomatic_player.cc +++ b/src/tools/dcpomatic_player.cc @@ -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("")); diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index ccff35092..f8707f9b2 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -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; +} diff --git a/src/wx/film_viewer.h b/src/wx/film_viewer.h index ef124fad3..b0dbf56a3 100644 --- a/src/wx/film_viewer.h +++ b/src/wx/film_viewer.h @@ -78,6 +78,7 @@ public: boost::optional 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; -- 2.30.2