Automatically recolor document on startup

This commit adds an additional setting that is used
to control the recoloring of the document on startup.
This commit is contained in:
Moritz Lipp 2010-04-12 09:36:14 +02:00
parent 7e46030848
commit e31857a082
2 changed files with 5 additions and 4 deletions

View File

@ -54,6 +54,7 @@ static const char DEFAULT_TEXT[] = "[No Name]";
/* additional settings */
#define SHOW_SCROLLBARS 0
#define ADJUST_OPEN ADJUST_BESTFIT
#define RECOLOR_OPEN 0
/* shortcuts */
Shortcut shortcuts[] = {

View File

@ -406,7 +406,7 @@ init_zathura()
/* other */
Zathura.Global.mode = NORMAL;
Zathura.Global.viewing_mode = NORMAL;
Zathura.Global.recolor = FALSE;
Zathura.Global.recolor = RECOLOR_OPEN;
Zathura.Global.adjust_mode = ADJUST_OPEN;
Zathura.State.filename = (char*) DEFAULT_TEXT;
@ -1225,9 +1225,9 @@ sc_adjust_window(Argument* argument)
double page_width;
double page_height;
if(argument->n == ADJUST_WIDTH)
if(argument->n == ADJUST_BESTFIT)
adjustment = gtk_scrolled_window_get_vadjustment(Zathura.UI.view);
else if(argument->n == ADJUST_BESTFIT)
else if(argument->n == ADJUST_WIDTH)
adjustment = gtk_scrolled_window_get_hadjustment(Zathura.UI.view);
else
return;
@ -1245,7 +1245,7 @@ sc_adjust_window(Argument* argument)
page_height = swap;
}
if(argument->n == ADJUST_WIDTH)
if(argument->n == ADJUST_BESTFIT)
Zathura.PDF.scale = (view_size / page_height) * 100;
else
Zathura.PDF.scale = (view_size / page_width) * 100;