diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-01-16 00:37:22 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-01-19 00:44:06 +0100 |
| commit | 17d9f8ba001eb14c3bbaf5cc5ebc37c5c0e1edb9 (patch) | |
| tree | 3549c87c08916fbd07c667377268d1e27c4ae2f1 /src/wx | |
| parent | ef2eb8521358684042807dfcec62ce0e5639ec8d (diff) | |
Add option to force short screen layout (#2946).
Diffstat (limited to 'src/wx')
| -rw-r--r-- | src/wx/full_config_dialog.cc | 12 | ||||
| -rw-r--r-- | src/wx/wx_util.cc | 4 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/wx/full_config_dialog.cc b/src/wx/full_config_dialog.cc index 0291d4fa6..2b7eaac9d 100644 --- a/src/wx/full_config_dialog.cc +++ b/src/wx/full_config_dialog.cc @@ -1567,6 +1567,10 @@ private: table->Add (_only_servers_encode, 1, wxEXPAND | wxLEFT, DCPOMATIC_SIZER_GAP); table->AddSpacer (0); + _layout_for_short_screen = new CheckBox(_panel, _("Layout for short screen")); + table->Add(_layout_for_short_screen, 1, wxEXPAND | wxLEFT, DCPOMATIC_SIZER_GAP); + table->AddSpacer (0); + { add_label_to_sizer (table, _panel, _("Maximum number of frames to store per thread"), true, 0, wxLEFT | wxRIGHT | wxALIGN_CENTRE_VERTICAL); auto s = new wxBoxSizer (wxHORIZONTAL); @@ -1659,6 +1663,7 @@ private: _video_display_mode->Bind (wxEVT_CHOICE, boost::bind(&AdvancedPage::video_display_mode_changed, this)); _show_experimental_audio_processors->bind(&AdvancedPage::show_experimental_audio_processors_changed, this); _only_servers_encode->bind(&AdvancedPage::only_servers_encode_changed, this); + _layout_for_short_screen->bind(&AdvancedPage::layout_for_short_screen_changed, this); _frames_in_memory_multiplier->Bind (wxEVT_SPINCTRL, boost::bind(&AdvancedPage::frames_in_memory_multiplier_changed, this)); _dcp_metadata_filename_format->Changed.connect (boost::bind (&AdvancedPage::dcp_metadata_filename_format_changed, this)); _dcp_asset_filename_format->Changed.connect (boost::bind (&AdvancedPage::dcp_asset_filename_format_changed, this)); @@ -1691,6 +1696,7 @@ private: } checked_set (_show_experimental_audio_processors, config->show_experimental_audio_processors ()); checked_set (_only_servers_encode, config->only_servers_encode ()); + checked_set (_layout_for_short_screen, config->layout_for_short_screen()); checked_set (_log_general, config->log_types() & LogEntry::TYPE_GENERAL); checked_set (_log_warning, config->log_types() & LogEntry::TYPE_WARNING); checked_set (_log_error, config->log_types() & LogEntry::TYPE_ERROR); @@ -1731,6 +1737,11 @@ private: Config::instance()->set_only_servers_encode (_only_servers_encode->GetValue()); } + void layout_for_short_screen_changed() + { + Config::instance()->set_layout_for_short_screen(_layout_for_short_screen->GetValue()); + } + void dcp_metadata_filename_format_changed () { Config::instance()->set_dcp_metadata_filename_format(_dcp_metadata_filename_format->get()); @@ -1788,6 +1799,7 @@ private: wxSpinCtrl* _frames_in_memory_multiplier = nullptr; CheckBox* _show_experimental_audio_processors = nullptr; CheckBox* _only_servers_encode = nullptr; + CheckBox* _layout_for_short_screen = nullptr; NameFormatEditor* _dcp_metadata_filename_format = nullptr; NameFormatEditor* _dcp_asset_filename_format = nullptr; CheckBox* _log_general = nullptr; diff --git a/src/wx/wx_util.cc b/src/wx/wx_util.cc index e82ca8e1b..b1cd873fc 100644 --- a/src/wx/wx_util.cc +++ b/src/wx/wx_util.cc @@ -834,6 +834,10 @@ wx::report_problem() bool layout_for_short_screen(wxWindow* reference) { + if (Config::instance()->layout_for_short_screen()) { + return true; + } + auto const sn = wxDisplay::GetFromWindow(reference); return sn >= 0 && wxDisplay(sn).GetClientArea().height <= 800; } |
