Replaced -T flag with -tt; default thumbnail size

This commit is contained in:
Bert 2011-02-20 00:28:28 +01:00
parent a30901210c
commit f0f6644fae
4 changed files with 13 additions and 21 deletions

View File

@ -22,4 +22,5 @@ static const float zoom_levels[] = {
100.0, 150.0, 200.0, 400.0, 800.0 100.0, 150.0, 200.0, 400.0, 800.0
}; };
#define THUMB_SIZE 50 /* default dimension of thumbnails (width == height): */
#define THUMB_SIZE 60

6
main.c
View File

@ -411,12 +411,6 @@ void on_keypress(XKeyEvent *kev) {
case XK_Right: case XK_Right:
changed = tns_move_selection(&tns, &win, TNS_RIGHT); changed = tns_move_selection(&tns, &win, TNS_RIGHT);
break; break;
/* scroll */
case XK_bracketleft:
break;
case XK_bracketright:
break;
} }
} }

View File

@ -31,7 +31,7 @@ options_t _options;
const options_t *options = (const options_t*) &_options; const options_t *options = (const options_t*) &_options;
void print_usage() { void print_usage() {
printf("usage: sxiv [-dFfhpqrsTtvZ] [-g GEOMETRY] [-z ZOOM] FILES...\n"); printf("usage: sxiv [-dFfhpqrstvZ] [-g GEOMETRY] [-z ZOOM] FILES...\n");
} }
void print_version() { void print_version() {
@ -54,7 +54,7 @@ void parse_options(int argc, char **argv) {
_options.quiet = 0; _options.quiet = 0;
_options.recursive = 0; _options.recursive = 0;
while ((opt = getopt(argc, argv, "dFfg:hpqrsTtvZz:")) != -1) { while ((opt = getopt(argc, argv, "dFfg:hpqrstvZz:")) != -1) {
switch (opt) { switch (opt) {
case '?': case '?':
print_usage(); print_usage();
@ -86,11 +86,9 @@ void parse_options(int argc, char **argv) {
case 's': case 's':
_options.scalemode = SCALE_FIT; _options.scalemode = SCALE_FIT;
break; break;
case 'T':
_options.thumbnails = 2;
break;
case 't': case 't':
_options.thumbnails = MAX(_options.thumbnails, 1); if (_options.thumbnails < 2)
++_options.thumbnails;
break; break;
case 'v': case 'v':
print_version(); print_version();

View File

@ -218,18 +218,17 @@ int tns_scroll(tns_t *tns, tnsdir_t dir) {
old = tns->first; old = tns->first;
if (dir == TNS_DOWN && tns->first + tns->cols * tns->rows < tns->cnt) if (dir == TNS_DOWN && tns->first + tns->cols * tns->rows < tns->cnt) {
tns->first += tns->cols; tns->first += tns->cols;
else if (dir == TNS_UP && tns->first >= tns->cols)
tns->first -= tns->cols;
if (tns->first != old) {
tns_check_view(tns, True); tns_check_view(tns, True);
tns->dirty = 1; tns->dirty = 1;
return 1; } else if (dir == TNS_UP && tns->first >= tns->cols) {
} else { tns->first -= tns->cols;
return 0; tns_check_view(tns, True);
tns->dirty = 1;
} }
return tns->first != old;
} }
int tns_translate(tns_t *tns, int x, int y) { int tns_translate(tns_t *tns, int x, int y) {