mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-29 12:55:59 +01:00
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:
parent
7e46030848
commit
e31857a082
2 changed files with 5 additions and 4 deletions
|
@ -54,6 +54,7 @@ static const char DEFAULT_TEXT[] = "[No Name]";
|
||||||
/* additional settings */
|
/* additional settings */
|
||||||
#define SHOW_SCROLLBARS 0
|
#define SHOW_SCROLLBARS 0
|
||||||
#define ADJUST_OPEN ADJUST_BESTFIT
|
#define ADJUST_OPEN ADJUST_BESTFIT
|
||||||
|
#define RECOLOR_OPEN 0
|
||||||
|
|
||||||
/* shortcuts */
|
/* shortcuts */
|
||||||
Shortcut shortcuts[] = {
|
Shortcut shortcuts[] = {
|
||||||
|
|
|
@ -406,7 +406,7 @@ init_zathura()
|
||||||
/* other */
|
/* other */
|
||||||
Zathura.Global.mode = NORMAL;
|
Zathura.Global.mode = NORMAL;
|
||||||
Zathura.Global.viewing_mode = NORMAL;
|
Zathura.Global.viewing_mode = NORMAL;
|
||||||
Zathura.Global.recolor = FALSE;
|
Zathura.Global.recolor = RECOLOR_OPEN;
|
||||||
Zathura.Global.adjust_mode = ADJUST_OPEN;
|
Zathura.Global.adjust_mode = ADJUST_OPEN;
|
||||||
|
|
||||||
Zathura.State.filename = (char*) DEFAULT_TEXT;
|
Zathura.State.filename = (char*) DEFAULT_TEXT;
|
||||||
|
@ -1225,9 +1225,9 @@ sc_adjust_window(Argument* argument)
|
||||||
double page_width;
|
double page_width;
|
||||||
double page_height;
|
double page_height;
|
||||||
|
|
||||||
if(argument->n == ADJUST_WIDTH)
|
if(argument->n == ADJUST_BESTFIT)
|
||||||
adjustment = gtk_scrolled_window_get_vadjustment(Zathura.UI.view);
|
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);
|
adjustment = gtk_scrolled_window_get_hadjustment(Zathura.UI.view);
|
||||||
else
|
else
|
||||||
return;
|
return;
|
||||||
|
@ -1245,7 +1245,7 @@ sc_adjust_window(Argument* argument)
|
||||||
page_height = swap;
|
page_height = swap;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(argument->n == ADJUST_WIDTH)
|
if(argument->n == ADJUST_BESTFIT)
|
||||||
Zathura.PDF.scale = (view_size / page_height) * 100;
|
Zathura.PDF.scale = (view_size / page_height) * 100;
|
||||||
else
|
else
|
||||||
Zathura.PDF.scale = (view_size / page_width) * 100;
|
Zathura.PDF.scale = (view_size / page_width) * 100;
|
||||||
|
|
Loading…
Reference in a new issue