mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2025-01-01 08:06:00 +01:00
Calculate current page number only if scrolling
This commit is contained in:
parent
07cb63c89d
commit
a4b4c91dae
4 changed files with 7 additions and 2 deletions
|
@ -84,7 +84,8 @@ cb_view_vadjustment_value_changed(GtkAdjustment* GIRARA_UNUSED(adjustment), gpoi
|
||||||
|
|
||||||
if (gdk_rectangle_intersect(&view_rect, &page_rect, NULL) == TRUE) {
|
if (gdk_rectangle_intersect(&view_rect, &page_rect, NULL) == TRUE) {
|
||||||
page->visible = true;
|
page->visible = true;
|
||||||
if (updated == false && gdk_rectangle_intersect(¢er, &page_rect, NULL) == TRUE) {
|
if (zathura->global.update_page_number == true && updated == false
|
||||||
|
&& gdk_rectangle_intersect(¢er, &page_rect, NULL) == TRUE) {
|
||||||
zathura->document->current_page_number = page_id;
|
zathura->document->current_page_number = page_id;
|
||||||
updated = true;
|
updated = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -433,6 +433,7 @@ sc_scroll(girara_session_t* session, girara_argument_t* argument,
|
||||||
gdouble value = gtk_adjustment_get_value(adjustment);
|
gdouble value = gtk_adjustment_get_value(adjustment);
|
||||||
gdouble max = gtk_adjustment_get_upper(adjustment) - view_size;
|
gdouble max = gtk_adjustment_get_upper(adjustment) - view_size;
|
||||||
unsigned int padding = zathura->global.page_padding;
|
unsigned int padding = zathura->global.page_padding;
|
||||||
|
zathura->global.update_page_number = true;
|
||||||
|
|
||||||
float scroll_step = 40;
|
float scroll_step = 40;
|
||||||
girara_setting_get(session, "scroll-step", &scroll_step);
|
girara_setting_get(session, "scroll-step", &scroll_step);
|
||||||
|
|
|
@ -141,6 +141,7 @@ zathura_init(int argc, char* argv[])
|
||||||
|
|
||||||
/* global settings */
|
/* global settings */
|
||||||
zathura->global.recolor = false;
|
zathura->global.recolor = false;
|
||||||
|
zathura->global.update_page_number = true;
|
||||||
|
|
||||||
/* load plugins */
|
/* load plugins */
|
||||||
zathura_document_plugins_load(zathura);
|
zathura_document_plugins_load(zathura);
|
||||||
|
@ -618,6 +619,7 @@ page_set(zathura_t* zathura, unsigned int page_id)
|
||||||
}
|
}
|
||||||
|
|
||||||
zathura->document->current_page_number = page_id;
|
zathura->document->current_page_number = page_id;
|
||||||
|
zathura->global.update_page_number = false;
|
||||||
|
|
||||||
page_offset_t offset;
|
page_offset_t offset;
|
||||||
page_calculate_offset(page, &offset);
|
page_calculate_offset(page, &offset);
|
||||||
|
|
|
@ -86,6 +86,7 @@ typedef struct zathura_s
|
||||||
{
|
{
|
||||||
unsigned int page_padding; /**< Padding between the pages */
|
unsigned int page_padding; /**< Padding between the pages */
|
||||||
bool recolor; /**< Recoloring mode switch */
|
bool recolor; /**< Recoloring mode switch */
|
||||||
|
bool update_page_number; /**< Update current page number */
|
||||||
} global;
|
} global;
|
||||||
|
|
||||||
struct
|
struct
|
||||||
|
|
Loading…
Reference in a new issue