mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-11-15 03:03:45 +01:00
Set adjust_open and map zoom command
This commit is contained in:
parent
ad0d890303
commit
37b591905b
@ -56,7 +56,7 @@ char* uri_command = "firefox '%s'"; /* uri */
|
|||||||
|
|
||||||
/* additional settings */
|
/* additional settings */
|
||||||
gboolean show_scrollbars = FALSE;
|
gboolean show_scrollbars = FALSE;
|
||||||
#define ADJUST_OPEN ADJUST_BESTFIT
|
int adjust_open = ADJUST_BESTFIT;
|
||||||
#define SELECTION_STYLE POPPLER_SELECTION_GLYPH
|
#define SELECTION_STYLE POPPLER_SELECTION_GLYPH
|
||||||
#define GOTO_MODE GOTO_LABELS /* GOTO_DEFAULT, GOTO_LABELS, GOTO_OFFSET */
|
#define GOTO_MODE GOTO_LABELS /* GOTO_DEFAULT, GOTO_LABELS, GOTO_OFFSET */
|
||||||
|
|
||||||
@ -185,6 +185,7 @@ SpecialCommand special_commands[] = {
|
|||||||
/* settings */
|
/* settings */
|
||||||
Setting settings[] = {
|
Setting settings[] = {
|
||||||
/* name, variable, type, render, re-init, description */
|
/* name, variable, type, render, re-init, description */
|
||||||
|
{"adjust_open", &(adjust_open), 'i', FALSE, FALSE, "Command to open URIs"},
|
||||||
{"browser", &(uri_command), 's', FALSE, FALSE, "Command to open URIs"},
|
{"browser", &(uri_command), 's', FALSE, FALSE, "Command to open URIs"},
|
||||||
{"completion_bgcolor", &(completion_bgcolor), 's', FALSE, TRUE, "Completion background color"},
|
{"completion_bgcolor", &(completion_bgcolor), 's', FALSE, TRUE, "Completion background color"},
|
||||||
{"completion_fgcolor", &(completion_fgcolor), 's', FALSE, TRUE, "Completion foreground color"},
|
{"completion_fgcolor", &(completion_fgcolor), 's', FALSE, TRUE, "Completion foreground color"},
|
||||||
@ -244,6 +245,7 @@ ShortcutName shortcut_names[] = {
|
|||||||
{"toggle_index", sc_toggle_index},
|
{"toggle_index", sc_toggle_index},
|
||||||
{"toggle_inputbar", sc_toggle_inputbar},
|
{"toggle_inputbar", sc_toggle_inputbar},
|
||||||
{"toggle_statusbar", sc_toggle_statusbar},
|
{"toggle_statusbar", sc_toggle_statusbar},
|
||||||
|
{"zoom", sc_zoom},
|
||||||
};
|
};
|
||||||
|
|
||||||
/* argument names */
|
/* argument names */
|
||||||
@ -261,9 +263,12 @@ ArgumentName argument_names[] = {
|
|||||||
{"full_up", FULL_UP},
|
{"full_up", FULL_UP},
|
||||||
{"half_down", HALF_DOWN},
|
{"half_down", HALF_DOWN},
|
||||||
{"half_up", HALF_UP},
|
{"half_up", HALF_UP},
|
||||||
|
{"in", ZOOM_IN},
|
||||||
{"insert", INSERT},
|
{"insert", INSERT},
|
||||||
{"left", LEFT},
|
{"left", LEFT},
|
||||||
{"next", NEXT},
|
{"next", NEXT},
|
||||||
|
{"original", ZOOM_ORIGINAL},
|
||||||
|
{"out", ZOOM_OUT},
|
||||||
{"previous", PREVIOUS},
|
{"previous", PREVIOUS},
|
||||||
{"right", RIGHT},
|
{"right", RIGHT},
|
||||||
{"select", SELECT},
|
{"select", SELECT},
|
||||||
|
27
zathura.c
27
zathura.c
@ -365,6 +365,7 @@ void sc_toggle_inputbar(Argument*);
|
|||||||
void sc_toggle_fullscreen(Argument*);
|
void sc_toggle_fullscreen(Argument*);
|
||||||
void sc_toggle_statusbar(Argument*);
|
void sc_toggle_statusbar(Argument*);
|
||||||
void sc_quit(Argument*);
|
void sc_quit(Argument*);
|
||||||
|
void sc_zoom(Argument*);
|
||||||
|
|
||||||
/* inputbar shortcut declarations */
|
/* inputbar shortcut declarations */
|
||||||
void isc_abort(Argument*);
|
void isc_abort(Argument*);
|
||||||
@ -537,6 +538,7 @@ void
|
|||||||
init_settings()
|
init_settings()
|
||||||
{
|
{
|
||||||
Zathura.State.filename = (char*) default_text;
|
Zathura.State.filename = (char*) default_text;
|
||||||
|
Zathura.Global.adjust_mode = adjust_open;
|
||||||
|
|
||||||
gtk_window_set_default_size(GTK_WINDOW(Zathura.UI.window), default_width, default_height);
|
gtk_window_set_default_size(GTK_WINDOW(Zathura.UI.window), default_width, default_height);
|
||||||
}
|
}
|
||||||
@ -555,7 +557,6 @@ init_zathura()
|
|||||||
Zathura.Global.mode = NORMAL;
|
Zathura.Global.mode = NORMAL;
|
||||||
Zathura.Global.viewing_mode = NORMAL;
|
Zathura.Global.viewing_mode = NORMAL;
|
||||||
Zathura.Global.recolor = 0;
|
Zathura.Global.recolor = 0;
|
||||||
Zathura.Global.adjust_mode = ADJUST_OPEN;
|
|
||||||
Zathura.Global.goto_mode = GOTO_MODE;
|
Zathura.Global.goto_mode = GOTO_MODE;
|
||||||
Zathura.Global.show_index = FALSE;
|
Zathura.Global.show_index = FALSE;
|
||||||
|
|
||||||
@ -2137,6 +2138,12 @@ sc_quit(Argument* argument)
|
|||||||
cb_destroy(NULL, NULL);
|
cb_destroy(NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
sc_zoom(Argument* argument)
|
||||||
|
{
|
||||||
|
bcmd_zoom(NULL, argument);
|
||||||
|
}
|
||||||
|
|
||||||
/* inputbar shortcut declarations */
|
/* inputbar shortcut declarations */
|
||||||
void
|
void
|
||||||
isc_abort(Argument* argument)
|
isc_abort(Argument* argument)
|
||||||
@ -3006,8 +3013,22 @@ cmd_set(int argc, char** argv)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
int *x = (int*) (settings[i].variable);
|
int *x = (int*) (settings[i].variable);
|
||||||
if(argv[1])
|
|
||||||
*x = atoi(argv[1]);
|
int id = -1;
|
||||||
|
int arg_c;
|
||||||
|
for(arg_c = 0; arg_c < LENGTH(argument_names); arg_c++)
|
||||||
|
{
|
||||||
|
if(!strcmp(argv[1], argument_names[arg_c].name))
|
||||||
|
{
|
||||||
|
id = argument_names[arg_c].argument;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(id == -1)
|
||||||
|
id = atoi(argv[1]);
|
||||||
|
|
||||||
|
*x = id;
|
||||||
}
|
}
|
||||||
else if(settings[i].type == 'f')
|
else if(settings[i].type == 'f')
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user