(trunk gtk) make "gtr_label_set_text" public and use it everywhere instead of gtk_label_set_text()

Some of the refresh events to the main window's torrent list are caused by main window relayout caused by the toolbar's GtkLabels recalculating their size after being updated once per second. To prevent relayout in some trivial cases, I'm replacing the gtk_label_set_text() calls with gtr_label_set_text() because the latter doesn't update the label widget if the old and new text strings are the same.

There are other changes that can handle more important cases -- I'll test those out next.
This commit is contained in:
Jordan Lee
2011-01-21 16:32:27 +00:00
parent 9ce58e33ac
commit aea77bc9f6
7 changed files with 26 additions and 21 deletions

View File

@@ -940,3 +940,15 @@ gtr_paste_clipboard_url_into_entry( GtkWidget * e )
g_free( text[i] );
}
/***
****
***/
void
gtr_label_set_text( GtkLabel * lb, const char * newstr )
{
const char * oldstr = gtk_label_get_text( lb );
if( ( oldstr == NULL ) || strcmp( oldstr, newstr ) )
gtk_label_set_text( lb, newstr );
}