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
c75eaf4c
Commit
c75eaf4c
authored
Jan 13, 2012
by
Sebastian Ramacher
Browse files
center the pages (Closes: #85, #87)
parent
10b50068
Changes
4
Show whitespace changes
Inline
Side-by-side
document.c
View file @
c75eaf4c
...
...
@@ -262,8 +262,7 @@ zathura_document_open(zathura_t* zathura, const char* path, const char* password
int
offset
=
0
;
zathura_db_get_fileinfo
(
zathura
->
database
,
document
->
file_path
,
&
document
->
current_page_number
,
&
offset
,
&
document
->
scale
);
if
(
document
->
scale
<=
0
)
{
if
(
document
->
scale
<=
FLT_EPSILON
)
{
girara_warning
(
"document info: '%s' has non positive scale"
,
document
->
file_path
);
document
->
scale
=
1
;
}
...
...
shortcuts.c
View file @
c75eaf4c
...
...
@@ -455,7 +455,7 @@ sc_toggle_index(girara_session_t* session, girara_argument_t* UNUSED(argument),
}
if
(
gtk_widget_get_visible
(
GTK_WIDGET
(
zathura
->
ui
.
index
)))
{
girara_set_view
(
session
,
zathura
->
ui
.
page_view
);
girara_set_view
(
session
,
zathura
->
ui
.
page_view
_alignment
);
gtk_widget_hide
(
GTK_WIDGET
(
zathura
->
ui
.
index
));
girara_mode_set
(
zathura
->
ui
.
session
,
zathura
->
modes
.
normal
);
}
else
{
...
...
zathura.c
View file @
c75eaf4c
...
...
@@ -166,6 +166,13 @@ zathura_init(int argc, char* argv[])
GtkAdjustment
*
view_hadjustment
=
gtk_scrolled_window_get_hadjustment
(
GTK_SCROLLED_WINDOW
(
zathura
->
ui
.
session
->
gtk
.
view
));
g_signal_connect
(
G_OBJECT
(
view_hadjustment
),
"value-changed"
,
G_CALLBACK
(
cb_view_vadjustment_value_changed
),
zathura
);
/* page view alignment */
zathura
->
ui
.
page_view_alignment
=
gtk_alignment_new
(
0
.
5
,
0
.
5
,
0
,
0
);
if
(
!
zathura
->
ui
.
page_view_alignment
)
{
goto
error_free
;
}
gtk_container_add
(
GTK_CONTAINER
(
zathura
->
ui
.
page_view_alignment
),
zathura
->
ui
.
page_view
);
gtk_widget_show
(
zathura
->
ui
.
page_view
);
/* statusbar */
...
...
@@ -238,6 +245,9 @@ error_free:
g_object_unref
(
zathura
->
ui
.
page_view
);
}
if
(
zathura
->
ui
.
page_view_alignment
)
{
g_object_unref
(
zathura
->
ui
.
page_view_alignment
);
}
error_out:
...
...
@@ -394,7 +404,7 @@ document_open(zathura_t* zathura, const char* path, const char* password)
g_free
(
value
);
page_view_set_mode
(
zathura
,
pages_per_row
);
girara_set_view
(
zathura
->
ui
.
session
,
zathura
->
ui
.
page_view
);
girara_set_view
(
zathura
->
ui
.
session
,
zathura
->
ui
.
page_view
_alignment
);
/* threads */
zathura
->
sync
.
render_thread
=
render_init
(
zathura
);
...
...
zathura.h
View file @
c75eaf4c
...
...
@@ -51,6 +51,7 @@ typedef struct zathura_s
GdkColor
recolor_light_color
;
/**> Light color for recoloring */
}
colors
;
GtkWidget
*
page_view_alignment
;
GtkWidget
*
page_view
;
/**> Widget that contains all rendered pages */
GtkWidget
*
index
;
/**> Widget to show the index of the document */
}
ui
;
...
...
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