summaryrefslogtreecommitdiff
path: root/gtk2_ardour/engine_dialog.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2007-08-27 12:33:55 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2007-08-27 12:33:55 +0000
commit5172282a44d477d21a85eacd1ede8242885bb6b5 (patch)
tree0431283fe1ce4cd3d23ae7663ac57d79738d136a /gtk2_ardour/engine_dialog.cc
parent45199451e0af09e33a02479aa7383f98186f4dcd (diff)
make sure device names in audio setup dialog are not truncated
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2349 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/engine_dialog.cc')
-rw-r--r--gtk2_ardour/engine_dialog.cc17
1 files changed, 16 insertions, 1 deletions
diff --git a/gtk2_ardour/engine_dialog.cc b/gtk2_ardour/engine_dialog.cc
index 4fbbcc4188..02b7bf67c4 100644
--- a/gtk2_ardour/engine_dialog.cc
+++ b/gtk2_ardour/engine_dialog.cc
@@ -750,11 +750,26 @@ EngineControl::driver_changed ()
{
string driver = driver_combo.get_active_text();
vector<string>& strings = devices[driver];
-
+ string::size_type maxlen = 0;
+ int maxindex = -1;
+ int n = 0;
+
+ for (vector<string>::iterator i = strings.begin(); i != strings.end(); ++i, ++n) {
+ if ((*i).length() > maxlen) {
+ maxlen = (*i).length();
+ maxindex = n;
+ }
+ }
+
set_popdown_strings (interface_combo, strings);
set_popdown_strings (input_device_combo, strings);
set_popdown_strings (output_device_combo, strings);
+ const guint32 FUDGE = 18; // Combo's are stupid - they steal space from the entry for the button interface_combo
+ set_size_request_to_display_given_text (interface_combo, strings[maxindex].c_str(), 5+FUDGE, 5);
+ set_size_request_to_display_given_text (input_device_combo, strings[maxindex].c_str(), 5+FUDGE, 5);
+ set_size_request_to_display_given_text (output_device_combo, strings[maxindex].c_str(), 5+FUDGE, 5);
+
if (!strings.empty()) {
interface_combo.set_active_text (strings.front());
input_device_combo.set_active_text (strings.front());