diff --git a/src/belvuApp/belvu.cpp b/src/belvuApp/belvu.cpp index 41cefb90145cca49b4e6c7bfd54028ca7b449182..bd5f4f5581b05a0896eb4ef4828499d306f802c1 100644 --- a/src/belvuApp/belvu.cpp +++ b/src/belvuApp/belvu.cpp @@ -4251,6 +4251,12 @@ static void parseMulAnnotationLine(BelvuContext *bc, const char *seqLine) { g_array_append_val(bc->organismArr, aln); g_array_sort(bc->organismArr, organism_order); + + /* Set the max organism name length */ + int organismLen = strlen(aln->organism); + + if (organismLen > bc->maxOrganismLen) + bc->maxOrganismLen = organismLen ; } if (strchr(cp, '/') && strchr(cp, '-')) diff --git a/src/belvuApp/belvuWindow.cpp b/src/belvuApp/belvuWindow.cpp index 6c3b8985b58a2a97185678c0e2f3413907c01e71..f618fe48e8c8faa4968e2be137d90a57d32de483 100644 --- a/src/belvuApp/belvuWindow.cpp +++ b/src/belvuApp/belvuWindow.cpp @@ -3543,9 +3543,12 @@ static void createOrganismWindow(BelvuContext *bc) /* Set layout size big enough to fit all organisms */ gdouble width = 0, height = 0; getFontCharSize(drawing, drawing->style->font_desc, &width, &height); - width *= (bc->maxNameLen + 1); + width *= (bc->maxOrganismLen + 1); height *= (bc->organismArr->len + 1); gtk_layout_set_size(GTK_LAYOUT(drawing), width, height); + + /* Add some padding in the main window for space around the layout etc. */ + gtk_window_set_default_size(GTK_WINDOW(bc->orgsWindow), width + 20, height + 20) ; /* Set default background color */ GdkColor *bgColor = getGdkColor(BELCOLOR_BACKGROUND, bc->defaultColors, FALSE, FALSE); diff --git a/src/belvuApp/belvu_.hpp b/src/belvuApp/belvu_.hpp index 2e9b2b3e481c547882bf96c49328fc4ff74ad253..93e6bd4cfa67374d8b27de1651ff3f162a151135 100644 --- a/src/belvuApp/belvu_.hpp +++ b/src/belvuApp/belvu_.hpp @@ -351,6 +351,7 @@ typedef struct BelvuContextStruct int maxLen; /* number of columns in alignment */ int maxTreeWidth; int maxNameLen; /* Max string length of any sequence name */ + int maxOrganismLen; /* Max string length of any organism name */ int maxStartLen; /* Max string length of any sequence start */ int maxEndLen; /* Max string length of any sequence end */ int maxScoreen; /* Max string length of any sequence score */