summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-10-01 22:42:09 +0200
committerDaniel Friesel <derf@finalrewind.org>2011-10-01 22:42:09 +0200
commitf55de5185347da52e7cd282491afdc7114418e50 (patch)
tree1d95f3da940a39f84c53c96b7a9ae5a887792dee
parenteff624290d52d526e4db834b40aff08f1c1db069 (diff)
downloadfeh-f55de5185347da52e7cd282491afdc7114418e50.zip
index.c, thumbnail.c: Fix alignment issues
-rw-r--r--src/index.c14
-rw-r--r--src/thumbnail.c4
2 files changed, 17 insertions, 1 deletions
diff --git a/src/index.c b/src/index.c
index 580585d..d9e068a 100644
--- a/src/index.c
+++ b/src/index.c
@@ -153,6 +153,10 @@ void init_index_mode(void)
get_index_string_dim(file, fn, &fw, &fh);
if (fw > text_area_w)
text_area_w = fw;
+ if (fh > text_area_h) {
+ text_area_h = fh + 5;
+ tot_thumb_h = opt.thumb_h + text_area_h;
+ }
}
if (text_area_w > opt.thumb_w)
text_area_w += 5;
@@ -186,6 +190,10 @@ void init_index_mode(void)
get_index_string_dim(file, fn, &fw, &fh);
if (fw > text_area_w)
text_area_w = fw;
+ if (fh > text_area_h) {
+ text_area_h = fh + 5;
+ tot_thumb_h = opt.thumb_h + text_area_h;
+ }
}
if (text_area_w > opt.thumb_w)
text_area_w += 5;
@@ -214,6 +222,10 @@ void init_index_mode(void)
get_index_string_dim(file, fn, &fw, &fh);
if (fw > text_area_w)
text_area_w = fw;
+ if (fh > text_area_h) {
+ text_area_h = fh + 5;
+ tot_thumb_h = opt.thumb_h + text_area_h;
+ }
}
if (text_area_w > opt.thumb_w)
@@ -438,7 +450,7 @@ void get_index_string_dim(feh_file *file, Imlib_Font fn, int *fw, int *fh)
int line_w, line_h;
char fake_file = 0;
gib_list *line, *lines;
- static int max_w = 0, total_h = 0;
+ int max_w = 0, total_h = 0;
if (!opt.index_info)
return;
diff --git a/src/thumbnail.c b/src/thumbnail.c
index f7a31c6..86d254b 100644
--- a/src/thumbnail.c
+++ b/src/thumbnail.c
@@ -265,6 +265,10 @@ void init_thumbnail_mode(void)
get_index_string_dim(file, td.font_main, &fw, &fh);
if (fw > td.text_area_w)
td.text_area_w = fw;
+ if (fh > td.text_area_h) {
+ td.text_area_h = fh + 5;
+ td.thumb_tot_h = opt.thumb_h + td.text_area_h;
+ }
}
if (td.text_area_w > opt.thumb_w)
td.text_area_w += 5;