Переглянути джерело

Added option -b: disable bar

master
Bert Münnich 13 роки тому
джерело
коміт
2d4264af28
6 змінених файлів з 18 додано та 6 видалено
  1. +1
    -1
      Makefile
  2. +1
    -0
      README.md
  3. +6
    -2
      options.c
  4. +1
    -0
      options.h
  5. +4
    -1
      sxiv.1
  6. +5
    -2
      window.c

+ 1
- 1
Makefile Переглянути файл

@@ -1,4 +1,4 @@
VERSION = git-20120215
VERSION = git-20120216

CC = gcc
CFLAGS = -ansi -Wall -pedantic -O2


+ 1
- 0
README.md Переглянути файл

@@ -60,6 +60,7 @@ of small previews is displayed, making it easy to choose an image to open.

sxiv supports the following command-line options:

-b Do not show info bar on bottom of window
-c Remove all orphaned cache files from thumbnail cache and exit
-d Scale all images to 100%, but fit large images into window
-F Use size-hints to make the window fixed/floating


+ 6
- 2
options.c Переглянути файл

@@ -32,7 +32,7 @@ options_t _options;
const options_t *options = (const options_t*) &_options;

void print_usage(void) {
printf("usage: sxiv [-cdFfhpqrstvZ] [-g GEOMETRY] [-n NUM] "
printf("usage: sxiv [-bcdFfhpqrstvZ] [-g GEOMETRY] [-n NUM] "
"[-z ZOOM] FILES...\n");
}

@@ -52,17 +52,21 @@ void parse_options(int argc, char **argv) {

_options.fixed_win = false;
_options.fullscreen = false;
_options.hide_bar = false;
_options.geometry = NULL;

_options.quiet = false;
_options.thumb_mode = false;
_options.clean_cache = false;

while ((opt = getopt(argc, argv, "cdFfg:hn:pqrstvZz:")) != -1) {
while ((opt = getopt(argc, argv, "bcdFfg:hn:pqrstvZz:")) != -1) {
switch (opt) {
case '?':
print_usage();
exit(EXIT_FAILURE);
case 'b':
_options.hide_bar = true;
break;
case 'c':
_options.clean_cache = true;
break;


+ 1
- 0
options.h Переглянути файл

@@ -38,6 +38,7 @@ typedef struct {
/* window: */
bool fixed_win;
bool fullscreen;
bool hide_bar;
char *geometry;

/* misc flags: */


+ 4
- 1
sxiv.1 Переглянути файл

@@ -3,7 +3,7 @@
sxiv \- Simple (or small or suckless) X Image Viewer
.SH SYNOPSIS
.B sxiv
.RB [ \-cdFfhpqrstvZ ]
.RB [ \-bcdFfhpqrstvZ ]
.RB [ \-g
.IR GEOMETRY ]
.RB [ \-n
@@ -33,6 +33,9 @@ Please note, that the fullscreen mode requires an EWMH/NetWM compliant window
manager.
.SH OPTIONS
.TP
.B \-b
Do not show info bar on bottom of window.
.TP
.B \-c
Remove all orphaned cache files from the thumbnail cache directory and exit.
.TP


+ 5
- 2
window.c Переглянути файл

@@ -121,6 +121,7 @@ void win_init(win_t *win) {
win->xwin = 0;
win->pm = 0;
win->fullscreen = false;
win->barh = 0;
win->lbar = NULL;
win->rbar = NULL;

@@ -209,8 +210,10 @@ void win_open(win_t *win) {
classhint.res_class = "sxiv";
XSetClassHint(e->dpy, win->xwin, &classhint);

win->barh = font.ascent + font.descent + 2 * V_TEXT_PAD;
win->h -= win->barh;
if (!options->hide_bar) {
win->barh = font.ascent + font.descent + 2 * V_TEXT_PAD;
win->h -= win->barh;
}

if (options->fixed_win)
win_set_sizehints(win);


Завантаження…
Відмінити
Зберегти