[zathura] [issue273] [PATCH] Fix the "n=" shortcut to zoom to size n

2012-12-06 Thread Benoît Knecht
No matter what the value of n was, the "n=" shortcut would set the zoom value to 100%. It is now set to n% instead. See issue #273 . Reported-by: Kamil Smardzewski --- config.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.c b/c

[zathura] [PATCH] Reverse scroll-wrap's logic

2012-12-06 Thread Benoît Knecht
When set to true, it used to _not_ wrap around the begining/end. Now it wraps if set to true, and it doesn't if set to false. --- shortcuts.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shortcuts.c b/shortcuts.c index d13f625..130f18f 100644 --- a/shortcuts.c +++ b

[zathura] [PATCH] Also wrap when scrolling with 'j' and 'k'

2012-12-06 Thread Benoît Knecht
The scroll-wrap option used to only change the behavior of 'J' and 'K' (i.e. moving one page forward/backward). Now, if scroll-wrap is true and the top of the first page is shown, pressing 'k' will show the bottom of the last page; conversely, when at the bottom of the last page, pressing 'j' wil

[zathura] [PATCH] Update and correct French translation

2012-12-06 Thread Benoît Knecht
. # Stéphane Aulery , 2012. +# Benoît Knecht , 2012. msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: http://bugs.pwmt.org\n"; "POT-Creation-Date: 2012-11-21 23:42+0100\n" -"PO-Revision-Date: 2012-08-07 22:54+\n&quo

[zathura] [PATCH] Correct misspellings of the word "synctex"

2012-12-06 Thread Benoît Knecht
Both in the documentation and in function names, "synctex" was sometimes spelled "syntex" or "syntec". --- main.c|2 +- zathura.1.rst |6 +++--- zathura.c |2 +- zathura.h |4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/main.c b/main.c index

Re: [zathura] [issue273] [PATCH] Fix the "n=" shortcut to zoom to size n

2012-12-06 Thread Benoît Knecht
Sebastian Ramacher wrote: > On 2012-12-06 20:32:21, Sebastian Ramacher wrote: > > Thanks for the patch. Applied > > Also thanks for the other patches. I've applied them too. Great, thanks a lot! Cheers, -- Benoît Knecht ___

[zathura] [PATCH] Add new shortcut function to display links

2012-12-07 Thread Benoît Knecht
This is useful when the text of the link doesn't match its target. The default key is set to 'F'. See issue 266 . Reported-by: Iron --- callbacks.c | 36 + callbacks.h |9 +++ config.c|3 +++ links.c | 22 +++

Re: [zathura] [PATCH] Add new shortcut function to display links

2012-12-07 Thread Benoît Knecht
Benoît Knecht wrote: > This is useful when the text of the link doesn't match its target. The > default key is set to 'F'. > > See issue 266 <http://bugs.pwmt.org/issue266>. > > Reported-by: Iron > --- > callbacks.c | 36 +-

Re: [zathura] [PATCH] Add new shortcut function to display links

2012-12-07 Thread Benoît Knecht
Sebastian Ramacher wrote: > On 2012-12-08 00:30:55, Benoît Knecht wrote: > > It's the same patch as the one I submitted to the bug tracker [1] (but > > rebased on the latest develop branch, not sure it makes any difference > > here). I'm submitting it to the mailin

[zathura] [PATCH] Document display_link shortcut and its key binding

2012-12-07 Thread Benoît Knecht
Update the zathura(1) and zathurarc(5) man pages. --- zathura.1.rst |2 ++ zathurarc.5.rst |1 + 2 files changed, 3 insertions(+) diff --git a/zathura.1.rst b/zathura.1.rst index aa2d5ad..cd980b4 100644 --- a/zathura.1.rst +++ b/zathura.1.rst @@ -82,6 +82,8 @@ o, O Open document f

[zathura] [PATCH] Update the shortcut functions list in documentation

2012-12-08 Thread Benoît Knecht
Also alphabetize the shortcut functions declarations in code, to make it easier to keep the documentation and code in sync. --- config.c|4 ++-- zathurarc.5.rst |6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/config.c b/config.c index 73327ed..8ba4f71 1006

[zathura] [PATCH] Declare missing shortcut functions and document them

2012-12-08 Thread Benoît Knecht
"focus_inputbar" and "toggle_page_mode" were defined in code but not declared as shortcut functions (and thus could not be mapped to different keys by the user using "map"). --- config.c|2 ++ zathurarc.5.rst |2 ++ 2 files changed, 4 insertions(+) diff --git a/config.c b/config.c

[zathura] [PATCH] Always free the GtkTreePath in sc_navigate_index

2012-12-09 Thread Benoît Knecht
--- shortcuts.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shortcuts.c b/shortcuts.c index 9d70fbc..ea00fab 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -895,6 +895,7 @@ sc_navigate_index(girara_session_t* session, girara_argument_t* argument, do {

[zathura] [PATCH] Initialize GdkRectangle structs in cb_view_vadjustment_value_changed

2012-12-13 Thread Benoît Knecht
Initializing page_rect makes Valgrind happy; it was complaining before, even though all the values were properly initialized, but it's more obvious this way. Initialize the other two structs in the same way for consitency. --- callbacks.c | 30 +- 1 file changed, 17

[zathura] [PATCH 1/3] Add document method to compute the size of a cell

2012-12-13 Thread Benoît Knecht
A document is laid out on a homogeneous gtk table/grid. This new method, zathura_document_get_cell_size, computes the size of the cells in that table/grid, at the current scale. --- document.c | 28 document.h |9 + 2 files changed, 37 insertions(+) diff

[zathura] [PATCH 2/3] Add function to get the size of the laid out document

2012-12-13 Thread Benoît Knecht
zathura_get_document_size computes the size of the document to be displayed (in pixels), given the size of the individual cells. It takes padding between the cells into account. --- utils.c | 37 + utils.h | 17 + 2 files changed, 54 insertio

[zathura] [PATCH 3/3] Account for scrollbars when fitting page into window

2012-12-13 Thread Benoît Knecht
The width of the vertical scrollbar (if there is one) needs to be substracted from the width of the GtkScrolledWindow in order to obtain the correct dimensions of the view area. See issue 27 . It also deals better with documents where pages don't all have the same si

[zathura] [PATCH] Wrap long comment introduced in 27d7973

2012-12-13 Thread Benoît Knecht
--- document.h |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/document.h b/document.h index b4dc6fa..113344e 100644 --- a/document.h +++ b/document.h @@ -170,7 +170,9 @@ void* zathura_document_get_data(zathura_document_t* document); void zathura_document_set_data(zathu

[zathura] [PATCH 2/2] Update French translation

2012-12-13 Thread Benoît Knecht
//bugs.pwmt.org\n"; "POT-Creation-Date: 2012-12-14 00:04+0100\n" -"PO-Revision-Date: 2012-12-06 11:48+0100\n" +"PO-Revision-Date: 2012-12-14 00:08+0100\n" "Last-Translator: Benoît Knecht \n" "Language-Team: French (http://www.transifex.com/projects/p/z

[zathura] [PATCH] Fix fence post error in page-widget's redraw_rect()

2012-12-14 Thread Benoît Knecht
A rectangle whose horizontal coordinates are x1 on the left and x2 on the right, (x2 + 1) - x1 pixels wide, not x2 - x1. This error caused the search result highlighting to leave a one-pixel-wide border behind, on the right and bottom side of the result. See issue 242

[zathura] [PATCH] Fix fence post error in page-widget's redraw_rect()

2012-12-14 Thread Benoît Knecht
A rectangle whose horizontal coordinates are x1 on the left and x2 on the right is (x2 + 1) - x1 pixels wide, not x2 - x1. This error caused the search result highlighting to leave a one-pixel-wide border behind, on the right and bottom side of the result. See issue 242

Re: [zathura] [PATCH] Fixed reverse searching behaviour to be more like less/vi

2012-12-16 Thread Benoît Knecht
onst int num_pages = > zathura_document_get_number_of_pages(zathura->document); >const int cur_page = > zathura_document_get_current_page_number(zathura->document); > - int diff = argument->n == FORWARD ? 1 : -1; > + int diff; > + switch (zathura_document_get_search_direction(zathura->document)) { > + case FORWARD: > + diff = argument->n == FORWARD ? 1 : -1; > + break; > + case BACKWARD: > + diff = argument->n == FORWARD ? -1 : 1; > + break; > + } > >zathura_page_t* target_page = NULL; >int target_idx = 0; Cheers, -- Benoît Knecht ___ zathura mailing list zathura@lists.pwmt.org http://lists.pwmt.org/mailman/listinfo/zathura

Re: [zathura] [PATCH] Fixed reverse searching behaviour to be more like less/vi

2012-12-17 Thread Benoît Knecht
idx = 0; > diff --git a/zathura.h b/zathura.h > index 9aa807c..e435259 100644 > --- a/zathura.h > +++ b/zathura.h > @@ -87,6 +87,7 @@ struct zathura_s > bool recolor_keep_hue; /**< Keep hue when recoloring */ > bool recolor; /**< Recoloring mode switch */ >

Re: [zathura] replace g_content_type_guess with libmagic

2013-01-29 Thread Benoît Knecht
these strings should be capitalized (they all are in girara, not so much in zathura but they should be). Cheers, -- Benoît Knecht ___ zathura mailing list zathura@lists.pwmt.org http://lists.pwmt.org/mailman/listinfo/zathura

Re: [zathura] replace g_content_type_guess with libmagic

2013-01-29 Thread Benoît Knecht
Sebastian Ramacher wrote: > On 2013-01-29 21:11:02, Benoît Knecht wrote: > > Hi Diego, > > > > Diego Joss wrote: > > > I have had issues with with g_content_type_guess guessing wrong on > > > some pdfs (it would return "text/plain" or > &

Re: [zathura] replace g_content_type_guess with libmagic

2013-01-30 Thread Benoît Knecht
Diego Joss wrote: > Benoît Knecht: > > Sebastian Ramacher wrote: > >> Benoît Knecht wrote: > >> > It would also be great if you could do localization on the message > >> > strings (using "_()"). It doesn't look like any of the girara_warning

[zathura] [PATCH] Show proper header for creation/modification dates

2013-03-15 Thread Benoît Knecht
Dates were wrongly given an author or title type, leading to the 'info' command displaying these dates under mislabeled headers. --- pdf.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdf.c b/pdf.c index 0f86370..11f23a4 100644 --- a/pdf.c +++ b/pdf.c @@ -573,7 +573,7 @@

[zathura] [PATCH] Add a '--page' option to open at the specified page

2013-03-17 Thread Benoît Knecht
If '--page [number]' (or '-P [number]') is given on the command-line, the document is opened at the specified page number. Negative numbers are allowed, and denote a page number starting from the end of the document. See issue 275 . Reported-by: bob --- callbacks.

[zathura] [PATCH 2/2] Update French translation

2013-03-17 Thread Benoît Knecht
//bugs.pwmt.org\n"; "POT-Creation-Date: 2013-03-17 10:22+\n" -"PO-Revision-Date: 2013-01-13 14:13+\n" -"Last-Translator: Benoît Knecht \n" +"PO-Revision-Date: 2013-03-17 11:30+0100\n" +"Last-Translator: Benoît Knecht \n" "La

Re: [zathura] [PATCH] Add a '--page' option to open at the specified page

2013-03-17 Thread Benoît Knecht
Moritz Lipp wrote: > On 2013-03-17 10:56:43, Benoît Knecht wrote: > > If '--page [number]' (or '-P [number]') is given on the command-line, > > the document is opened at the specified page number. Negative numbers > > are allowed, and denote a page number

[zathura] [PATCH] Add 'q' and 'BackSpace' shortcuts in fullscreen mode

2013-03-17 Thread Benoît Knecht
Incidentally, the default fullscreen shortcut doesn't seem to work on my system (it does the same as alone). If this behavior can be confirmed by others, it should probably be removed. ___ zathura mailing list zathura@lists.pwmt.org http://lists.pwmt.or

[zathura] [PATCH] Add 'q' and 'BackSpace' shortcuts in fullscreen mode

2013-03-17 Thread Benoît Knecht
Now by default, 'q' quits zathura even in fullscreen mode, and 'BackSpace' does the reverse of 'space', i.e. go back one page. --- config.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/config.c b/config.c index 5eafc0d..2dd64df 100644 --- a/config.c +++ b/config.c @@ -254,6 +254,7 @@ c

Re: [zathura] [PATCH] Add 'q' and 'BackSpace' shortcuts in fullscreen mode

2013-03-17 Thread Benoît Knecht
Sebastian Ramacher wrote: > On 2013-03-17 12:26:33, Benoît Knecht wrote: > > Incidentally, the default fullscreen shortcut doesn't seem to > > work on > > my system (it does the same as alone). If this behavior can be > > confirmed by others, it should probabl

[zathura] [PATCH] Use signals to readjust_view_after_zooming()

2013-03-20 Thread Benoît Knecht
Instead of guesstimating the values of the scrollbars adjustments after a change in zoom level, connect callbacks to the "changed" GtkAdjustment event (which is emitted when the bounds or page_size of the adjustment change, e.g. when the zoom level changes), and compute the new values from there.

[zathura] [PATCH] Revert commit ce6e735

2013-03-20 Thread Benoît Knecht
This wasn't correct. Padding is already accounted for: scale = (width - (pages_per_row - 1) * padding) / (pages_per_row * cell_width) If you add padding on the denominator, you end up with black margins on the sides of the window, which isn't what padding is for (i.e. insert a gap bet

Re: [zathura] [PATCH] Revert commit ce6e735

2013-03-21 Thread Benoît Knecht
Marwan Tanager wrote: > On Wed, Mar 20, 2013 at 11:03:54PM +0000, Benoît Knecht wrote: > > This wasn't correct. Padding is already accounted for: > > > > scale = (width - (pages_per_row - 1) * padding) / > > (pages_per_row * cell_width) > > >

Re: [zathura] [PATCH] Revert commit ce6e735

2013-03-21 Thread Benoît Knecht
Marwan Tanager wrote: > On Thu, Mar 21, 2013 at 09:04:57AM +0100, Benoît Knecht wrote: > > Marwan Tanager wrote: > > > On Wed, Mar 20, 2013 at 11:03:54PM +0000, Benoît Knecht wrote: > > > > This wasn't correct. Padding is already accounted for: > > >

Re: [zathura] [PATCH] Use signals to readjust_view_after_zooming()

2013-03-21 Thread Benoît Knecht
Hi Marwan, Thanks a lot for your review and feedback. Marwan Tanager wrote: > On Wed, Mar 20, 2013 at 10:17:36PM +0000, Benoît Knecht wrote: > > Instead of guesstimating the values of the scrollbars adjustments after > > a change in zoom level, connect callbacks to the "ch

Re: [zathura] [PATCH] Use signals to readjust_view_after_zooming()

2013-03-22 Thread Benoît Knecht
not updated if you (say) zoom out from page 1, and then zoom in (to whichever page is at the center of the screen). But that's not really an issue introduced by this patch, and there's a trivial fix for that. Anyway, thanks again for your precious feedback and advice, it was very much

[zathura] [PATCH RFC] Use signals to readjust_view_after_zooming()

2013-03-22 Thread Benoît Knecht
Instead of guesstimating the values of the scrollbars adjustments after a change in zoom level, connect callbacks to the "changed" GtkAdjustment event (which is emitted when the bounds or page_size of the adjustment change, e.g. when the zoom level changes), and compute the new values from there.

[zathura] [PATCH RFC v2] Use signals to readjust_view_after_zooming()

2013-03-22 Thread Benoît Knecht
Instead of guesstimating the values of the scrollbars adjustments after a change in zoom level, connect callbacks to the "changed" GtkAdjustment event (which is emitted when the bounds or page_size of the adjustment change, e.g. when the zoom level changes), and compute the new values from there.

Re: [zathura] [PATCH] Use signals to readjust_view_after_zooming()

2013-03-23 Thread Benoît Knecht
Hi Marwan, Marwan Tanager wrote: > Sorry for being late on this. No worries, and thanks again for taking the time to review this. > On Fri, Mar 22, 2013 at 11:02:57AM +0100, Benoît Knecht wrote: > > Hi Marwan, > > > > Marwan Tanager wrote: > > > This pa

[zathura] [PATCH v2] Use signals to readjust_view_after_zooming()

2013-03-23 Thread Benoît Knecht
Instead of guesstimating the values of the scrollbars adjustments after a change in zoom level, connect callbacks to the "changed" GtkAdjustment event (which is emitted when the bounds or page_size of the adjustment change, e.g. when the zoom level changes), and compute the new values from there.

[zathura] [PATCH] Don't scroll the document when focusing the inputbar

2013-03-23 Thread Benoît Knecht
Add a new adjust mode that is set when focusing the inputbar and disables adjusting the vertical scrollbar. As a result, focusing the inputbar doesn't scroll the document, leading to better results when changing pages from the inputbar (e.g. using bookmarks). Reported-by: Marwan Tanager --- call

Re: [zathura] [PATCH] Revert commit ce6e735

2013-03-23 Thread Benoît Knecht
gs a bit worse when show-scrollbars is false. Hopefully we can fix the actual issue soon, but I think we should first undo this. -- Benoît Knecht ___ zathura mailing list zathura@lists.pwmt.org http://lists.pwmt.org/mailman/listinfo/zathura

Re: [zathura] [PATCH] Don't scroll the document when focusing the inputbar

2013-03-23 Thread Benoît Knecht
Sebastian Ramacher wrote: > On 2013-03-23 10:07:17, Benoît Knecht wrote: > > Add a new adjust mode that is set when focusing the inputbar and > > disables adjusting the vertical scrollbar. As a result, focusing the > > inputbar doesn't scroll the document, lead

[zathura] [PATCH v3] Use signals to readjust_view_after_zooming()

2013-03-23 Thread Benoît Knecht
Instead of guesstimating the values of the scrollbars adjustments after a change in zoom level, connect callbacks to the "changed" GtkAdjustment event (which is emitted when the bounds or page_size of the adjustment change, e.g. when the zoom level changes), and compute the new values from there.

Re: [zathura] unable to save a pdf

2013-05-16 Thread Benoît Knecht
really has not. What do you mean? Is the file not created at all? Or is it created but empty? > Has anybody encountered such a problem/found a solution? I just tried with zathura 0.2.1 on Debian, and it worked just fine. Cheers, -- Benoît Knecht ___ za