Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
zathura
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
114
Issues
114
List
Boards
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pwmt
zathura
Commits
9f3f5b34
Commit
9f3f5b34
authored
Feb 22, 2017
by
Deven Lahoti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add vertical centering option
parent
0ca4789d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
2 deletions
+19
-2
doc/man/zathurarc.5.rst
doc/man/zathurarc.5.rst
+7
-0
zathura/config.c
zathura/config.c
+2
-0
zathura/zathura.c
zathura/zathura.c
+10
-2
No files found.
doc/man/zathurarc.5.rst
View file @
9f3f5b34
...
...
@@ -943,6 +943,13 @@ En/Disables horizontally centered zooming.
* Value type: Boolean
* Default value: false
vertical-center
^^^^^^^^^^^
Center the screen at the vertical midpoint of the page by default.
* Value type: Boolean
* Default value: false
zoom-max
^^^^^^^^
Defines the maximum percentage that the zoom level can be.
...
...
zathura/config.c
View file @
9f3f5b34
...
...
@@ -198,6 +198,8 @@ config_load_default(zathura_t* zathura)
girara_setting_add
(
gsession
,
"advance-pages-per-row"
,
&
bool_value
,
BOOLEAN
,
false
,
_
(
"Advance number of pages per row"
),
NULL
,
NULL
);
bool_value
=
false
;
girara_setting_add
(
gsession
,
"zoom-center"
,
&
bool_value
,
BOOLEAN
,
false
,
_
(
"Horizontally centered zoom"
),
NULL
,
NULL
);
bool_value
=
false
;
girara_setting_add
(
gsession
,
"vertical-center"
,
&
bool_value
,
BOOLEAN
,
false
,
_
(
"Vertically center pages"
),
NULL
,
NULL
);
bool_value
=
true
;
girara_setting_add
(
gsession
,
"link-hadjust"
,
&
bool_value
,
BOOLEAN
,
false
,
_
(
"Align link target to the left"
),
NULL
,
NULL
);
bool_value
=
true
;
...
...
zathura/zathura.c
View file @
9f3f5b34
...
...
@@ -1382,9 +1382,17 @@ position_set(zathura_t* zathura, double position_x, double position_y)
double
comppos_x
,
comppos_y
;
unsigned
int
page_id
=
zathura_document_get_current_page_number
(
zathura
->
document
);
bool
vertical_center
=
false
;
girara_setting_get
(
zathura
->
ui
.
session
,
"vertical-center"
,
&
vertical_center
);
/* xalign = 0.5: center horizontally (with the page, not the document) */
/* yalign = 0.0: align page an viewport edges at the top */
page_number_to_position
(
zathura
->
document
,
page_id
,
0
.
5
,
0
.
0
,
&
comppos_x
,
&
comppos_y
);
if
(
vertical_center
)
{
/* yalign = 0.0: align page an viewport edges at the top */
page_number_to_position
(
zathura
->
document
,
page_id
,
0
.
5
,
0
.
0
,
&
comppos_x
,
&
comppos_y
);
}
else
{
/* yalign = 0.5: center vertically */
page_number_to_position
(
zathura
->
document
,
page_id
,
0
.
5
,
0
.
5
,
&
comppos_x
,
&
comppos_y
);
}
/* automatic horizontal adjustment */
zathura_adjust_mode_t
adjust_mode
=
zathura_document_get_adjust_mode
(
zathura
->
document
);
...
...
Write
Preview
Markdown
is supported
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