]> git.sesse.net Git - ccbs/commitdiff
Allow a mix of long and short names in the display of the chosen songs.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 20 Feb 2005 19:05:49 +0000 (19:05 +0000)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 20 Feb 2005 19:05:49 +0000 (19:05 +0000)
bigscreen/groupscreen.cpp

index cd6c86edccdb596660452a30fbd2096de61ae758..dacefbcbccc7f64b0992abb4f19bf4f6567b8a4c 100644 (file)
@@ -152,7 +152,13 @@ void GroupScreen::draw(unsigned char *buf)
                        unsigned this_width = my_draw_text(text, NULL, 22.0);
                        if (j->chosen) {
                                my_draw_text_deferred(td, text, 22.0, x + max_num_width - this_width, y);
                        unsigned this_width = my_draw_text(text, NULL, 22.0);
                        if (j->chosen) {
                                my_draw_text_deferred(td, text, 22.0, x + max_num_width - this_width, y);
-                               my_draw_text_deferred(td, (mode == 0) ? j->song.title : j->song.short_title, 12.0, x + max_num_width + 10, y);
+
+                               // draw the long name if we can, otherwise use the short one
+                               if (my_draw_text(j->song.title, NULL, 12.0) > width[col]) {
+                                       my_draw_text_deferred(td, j->song.short_title, 12.0, x + max_num_width + 10, y);
+                               } else {
+                                       my_draw_text_deferred(td, j->song.title, 12.0, x + max_num_width + 10, y);
+                               }
                        } else {
                                my_draw_text_deferred(td, text, 22.0, x + width[col] / 2 - this_width / 2, y);
                        }
                        } else {
                                my_draw_text_deferred(td, text, 22.0, x + width[col] / 2 - this_width / 2, y);
                        }