Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
pwmt
zathura
Commits
583017a8
Commit
583017a8
authored
May 07, 2012
by
Moritz Lipp
Browse files
Apply adjust-open only to unknown files
parent
4c25d687
Changes
2
Hide whitespace changes
Inline
Side-by-side
config.c
View file @
583017a8
...
...
@@ -131,7 +131,7 @@ config_load_default(zathura_t* zathura)
girara_setting_add
(
gsession
,
"highlight-transparency"
,
&
float_value
,
FLOAT
,
false
,
_
(
"Transparency for highlighting"
),
NULL
,
NULL
);
bool_value
=
true
;
girara_setting_add
(
gsession
,
"render-loading"
,
&
bool_value
,
BOOLEAN
,
false
,
_
(
"Render 'Loading ...'"
),
NULL
,
NULL
);
girara_setting_add
(
gsession
,
"adjust-open"
,
"
none"
,
STRING
,
false
,
_
(
"Adjust to when opening file"
),
NULL
,
NULL
);
girara_setting_add
(
gsession
,
"adjust-open"
,
"
best-fit"
,
STRING
,
false
,
_
(
"Adjust to when opening file"
),
NULL
,
NULL
);
bool_value
=
false
;
girara_setting_add
(
gsession
,
"show-hidden"
,
&
bool_value
,
BOOLEAN
,
false
,
_
(
"Show hidden files and directories"
),
NULL
,
NULL
);
bool_value
=
true
;
...
...
zathura.c
View file @
583017a8
...
...
@@ -495,7 +495,7 @@ document_open(zathura_t* zathura, const char* path, const char* password)
/* read history file */
zathura_fileinfo_t
file_info
=
{
0
,
0
,
1
,
0
,
1
,
0
,
0
};
zathura_db_get_fileinfo
(
zathura
->
database
,
file_path
,
&
file_info
);
bool
known_file
=
zathura_db_get_fileinfo
(
zathura
->
database
,
file_path
,
&
file_info
);
/* set page offset */
zathura_document_set_page_offset
(
document
,
file_info
.
page_offset
);
...
...
@@ -533,8 +533,7 @@ document_open(zathura_t* zathura, const char* path, const char* password)
/* apply open adjustment */
char
*
adjust_open
=
"best-fit"
;
zathura_document_set_adjust_mode
(
document
,
ZATHURA_ADJUST_NONE
);
if
(
girara_setting_get
(
zathura
->
ui
.
session
,
"adjust-open"
,
&
(
adjust_open
))
==
true
)
{
if
(
known_file
==
false
&&
girara_setting_get
(
zathura
->
ui
.
session
,
"adjust-open"
,
&
(
adjust_open
))
==
true
)
{
if
(
g_strcmp0
(
adjust_open
,
"best-fit"
)
==
0
)
{
zathura_document_set_adjust_mode
(
document
,
ZATHURA_ADJUST_BESTFIT
);
}
else
if
(
g_strcmp0
(
adjust_open
,
"width"
)
==
0
)
{
...
...
@@ -543,6 +542,8 @@ document_open(zathura_t* zathura, const char* path, const char* password)
zathura_document_set_adjust_mode
(
document
,
ZATHURA_ADJUST_NONE
);
}
g_free
(
adjust_open
);
}
else
{
zathura_document_set_adjust_mode
(
document
,
ZATHURA_ADJUST_NONE
);
}
/* update statusbar */
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment