Reset toolbar label widths on DPI change (may fix

#4433).


git-svn-id: svn://localhost/ardour2/branches/3.0@10577 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2011-11-14 11:31:27 +00:00
parent 5de95fc822
commit aa38d43c69
3 changed files with 15 additions and 4 deletions

View 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.
*/

View 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__ */

View 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);
}