Reset toolbar label widths on DPI change (may fix
authorCarl Hetherington <carl@carlh.net>
Mon, 14 Nov 2011 11:31:27 +0000 (11:31 +0000)
committerCarl Hetherington <carl@carlh.net>
Mon, 14 Nov 2011 11:31:27 +0000 (11:31 +0000)
#4433).

git-svn-id: svn://localhost/ardour2/branches/3.0@10577 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/ardour_ui.cc
gtk2_ardour/ardour_ui.h
gtk2_ardour/ardour_ui_ed.cc

index f113c1ce1b8d84bf30084bd7d9622c4e29d62c1c..811ebc2fdd93928c2855dba2ae4f1a45f732cdf5 100644 (file)
@@ -339,6 +339,8 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
 
        _process_thread = new ProcessThread ();
        _process_thread->init ();
+
+       DPIReset.connect (sigc::mem_fun (*this, &ARDOUR_UI::resize_text_widgets));
 }
 
 /** @return true if a session was chosen and `apply' clicked, otherwise false if `cancel' was clicked */
@@ -1065,7 +1067,7 @@ ARDOUR_UI::update_cpu_load ()
 {
        char buf[64];
 
-       /* If this text is changed, the set_size_request_to_display_given_text call in ARDOUR_UI::build_menu_bar
+       /* If this text is changed, the set_size_request_to_display_given_text call in ARDOUR_UI::resize_text_widgets
           should also be changed.
        */
 
@@ -1082,7 +1084,7 @@ ARDOUR_UI::update_buffer_load ()
        uint32_t const playback = _session ? _session->playback_load () : 100;
        uint32_t const capture = _session ? _session->capture_load () : 100;
 
-       /* If this text is changed, the set_size_request_to_display_given_text call in ARDOUR_UI::build_menu_bar
+       /* If this text is changed, the set_size_request_to_display_given_text call in ARDOUR_UI::resize_text_widgets
           should also be changed.
        */
        
index f42f936f3284b6d96ba8eee6a62986dbdb24251a..3eeab1c85fce15e4054c68f4925f4fdca9c2c72d 100644 (file)
@@ -739,6 +739,8 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
 
        void successful_graph_sort ();
        bool _feedback_exists;
+
+       void resize_text_widgets ();
 };
 
 #endif /* __ardour_gui_h__ */
index 4f954c8edc236b961ef66a0f515a15c1e05fecfd..8063f495b3a102856373b4c0c4c2b355bff5a0f1 100644 (file)
@@ -548,13 +548,13 @@ ARDOUR_UI::build_menu_bar ()
        cpu_load_box.set_name ("CPULoad");
        cpu_load_label.set_name ("CPULoad");
        cpu_load_label.set_use_markup ();
-       set_size_request_to_display_given_text (cpu_load_label, "DSP: 100.0%", 2, 2);
 
        buffer_load_box.add (buffer_load_label);
        buffer_load_box.set_name ("BufferLoad");
        buffer_load_label.set_name ("BufferLoad");
        buffer_load_label.set_use_markup ();
-       set_size_request_to_display_given_text (buffer_load_label, "Buffers: p:100% c:100%", 2, 2);
+
+       resize_text_widgets ();
 
        sample_rate_box.add (sample_rate_label);
        sample_rate_box.set_name ("SampleRate");
@@ -828,3 +828,10 @@ ARDOUR_UI::toggle_global_port_matrix (ARDOUR::DataType t)
                }
        }
 }
+
+void
+ARDOUR_UI::resize_text_widgets ()
+{
+       set_size_request_to_display_given_text (cpu_load_label, "DSP: 100.0%", 2, 2);
+       set_size_request_to_display_given_text (buffer_load_label, "Buffers: p:100% c:100%", 2, 2);
+}