gtk: fix window width (#1069)

GTK window width cannot be smaller than the longest torrent title

Source: https://trac.transmissionbt.com/ticket/6128

Co-authored-by: Charles Kerr <ckerr@github.com>
This commit is contained in:
Akatsuki 2020-04-25 04:15:57 +08:00 committed by GitHub
parent c0c463d660
commit f6030b1d79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 4 deletions

View File

@ -408,7 +408,7 @@ static void get_size_compact(TorrentCellRenderer* cell, GtkWidget* widget, gint*
if (width != NULL)
{
*width = xpad * 2 + icon_size.width + GUI_PAD + name_size.width + GUI_PAD + BAR_WIDTH + GUI_PAD + stat_size.width;
*width = xpad * 2 + icon_size.width + GUI_PAD + BAR_WIDTH + GUI_PAD + stat_size.width;
}
if (height != NULL)
@ -420,8 +420,6 @@ static void get_size_compact(TorrentCellRenderer* cell, GtkWidget* widget, gint*
g_object_unref(icon);
}
#define MAX3(a, b, c) MAX(a, MAX(b, c))
static void get_size_full(TorrentCellRenderer* cell, GtkWidget* widget, gint* width, gint* height)
{
int xpad;
@ -465,7 +463,7 @@ static void get_size_full(TorrentCellRenderer* cell, GtkWidget* widget, gint* wi
if (width != NULL)
{
*width = xpad * 2 + icon_size.width + GUI_PAD + MAX3(name_size.width, prog_size.width, stat_size.width);
*width = xpad * 2 + icon_size.width + GUI_PAD + MAX(prog_size.width, stat_size.width);
}
if (height != NULL)