Guess UI scale for copy-config dialog

This dialog shows before the new user wizard,
where a user would configure HDPI/UI scaling.
This commit is contained in:
Robin Gareus 2023-09-25 17:07:15 +02:00
parent 9f475d5427
commit d7c611e025
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
5 changed files with 54 additions and 38 deletions

View file

@ -215,6 +215,10 @@ static const gchar *_record_mode_strings[] = {
static bool
ask_about_configuration_copy (string const & old_dir, string const & new_dir, int version)
{
/* guess screen scaling */
UIConfiguration::instance ().set_font_scale (1024 * guess_default_ui_scale ());
UIConfiguration::instance ().reset_dpi ();
ArdourMessageDialog msg (string_compose (
_("%1 %2.x has discovered configuration files from %1 %3.x.\n\n"
"Would you like these files to be copied and used for %1 %2.x?\n\n"
@ -367,6 +371,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
record_mode_strings = I18N (_record_mode_strings);
if (ARDOUR::handle_old_configuration_files (boost::bind (ask_about_configuration_copy, _1, _2, _3))) {
{
/* "touch" the been-here-before path now that config has been migrated */
PBD::ScopedFileDescriptor fout (g_open (been_here_before_path ().c_str(), O_CREAT|O_TRUNC|O_RDWR, 0666));