mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-11-13 10:53:45 +01:00
fix gtk_widget_get_requisition deprecation warning in GTK3
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
parent
1d5efad36a
commit
3629e3acd2
10
shortcuts.c
10
shortcuts.c
@ -169,10 +169,16 @@ sc_adjust_window(girara_session_t* session, girara_argument_t* argument,
|
|||||||
GTK_SCROLLED_WINDOW(session->gtk.view));
|
GTK_SCROLLED_WINDOW(session->gtk.view));
|
||||||
|
|
||||||
if (vscrollbar != NULL) {
|
if (vscrollbar != NULL) {
|
||||||
|
int scroll_width;
|
||||||
|
#if (GTK_MAJOR_VERSION == 3)
|
||||||
|
gtk_widget_get_preferred_width(GTK_WIDGET(vscrollbar), NULL, &scroll_width);
|
||||||
|
#else
|
||||||
GtkRequisition requisition;
|
GtkRequisition requisition;
|
||||||
gtk_widget_get_requisition(vscrollbar, &requisition);
|
gtk_widget_get_requisition(vscrollbar, &requisition);
|
||||||
if (0 < requisition.width && (unsigned)requisition.width < width) {
|
scroll_width = requisition.width;
|
||||||
width -= requisition.width;
|
#endif
|
||||||
|
if (0 < scroll_width && (unsigned)scroll_width < width) {
|
||||||
|
width -= scroll_width;
|
||||||
scale = (double)(width - (pages_per_row - 1) * padding) /
|
scale = (double)(width - (pages_per_row - 1) * padding) /
|
||||||
(double)(pages_per_row * cell_width);
|
(double)(pages_per_row * cell_width);
|
||||||
zathura_document_set_scale(zathura->document, scale);
|
zathura_document_set_scale(zathura->document, scale);
|
||||||
|
Loading…
Reference in New Issue
Block a user