From f73afe16f1613fd8f833f472ed53b78dbe8445f2 Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Sun, 19 Apr 1998 12:19:24 +0000 Subject: [PATCH] Truncate labels in the splash screen if they are too long to be displayed without resizing the window; this should fix the problems with 100dpi fonts. --Sven --- ChangeLog | 6 ++++++ app/app_procs.c | 17 +++++++++++++++++ gimp_tips.txt | 7 ++++--- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 13e8dea4dd..4c90f567e3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sun Apr 19 14:16:44 MEST 1998 Sven Neumann + + * app/app_procs.c: truncate labels in the splash screen if they + are too long to be displayed without resizing the window; this + should fix the problems with 100dpi fonts + Sat Apr 18 22:19:10 PDT 1998 Manish Singh * app/gimprc.c: don't dereference NULL pointer when a gimprc diff --git a/app/app_procs.c b/app/app_procs.c index dfe56be353..8422f37b54 100644 --- a/app/app_procs.c +++ b/app/app_procs.c @@ -142,6 +142,7 @@ static int logo_height = 0; static int logo_area_width = 0; static int logo_area_height = 0; static int show_logo = SHOW_NEVER; +static int max_label_length = MAXPATHLEN; static int splash_logo_load_size (GtkWidget *window) @@ -276,6 +277,12 @@ splash_text_draw (GtkWidget *widget) ((logo_area_width - gdk_string_width (font, AUTHORS)) / 2), (0.80 * logo_area_height), AUTHORS); + /* + * This is a hack: we try to compute a good guess for the maximum number + * of charcters that will fit into the splash-screen using the given font + */ + max_label_length = (float)strlen (AUTHORS) * + ( (float)logo_area_width / (float)gdk_string_width (font, AUTHORS) ); } static void @@ -396,6 +403,8 @@ app_init_update_status(char *label1val, char *label2val, float pct_progress) { + char *temp; + if(no_interface == FALSE && no_splash == FALSE && win_initstatus) { GdkRectangle area = {0, 0, -1, -1}; @@ -407,6 +416,14 @@ app_init_update_status(char *label1val, if(label2val && strcmp(label2val, GTK_LABEL(label2)->label)) { + while ( strlen (label2val) > max_label_length ) + { + temp = strchr (label2val, '/'); + if (temp == NULL) /* for sanity */ + break; + temp++; + label2val = temp; + } gtk_label_set(GTK_LABEL(label2), label2val); } if(pct_progress >= 0 diff --git a/gimp_tips.txt b/gimp_tips.txt index 6bbde5fcb5..39ea36e2d6 100644 --- a/gimp_tips.txt +++ b/gimp_tips.txt @@ -87,9 +87,10 @@ Click and drag on a ruler to place a Guide on an image. All dragged selections will snap to the guides. You can remove guides by dragging them off the image with the Move tool. -GIMP supports gzip compression on the fly. Just add .gz (or .bz2, -if you habe bzip2 installed) to the filename and your image will be -saved compressed. Of course loading compressed images works too. +The GIMP supports gzip compression on the fly. Just add +'.gz' (or '.bz2', if you habe bzip2 installed) to the filename +and your image will be saved compressed. Of course loading +compressed images works too. Pressing and holding the Shift key before making a selection allows you to add to the current selection instead of replacing it. Using