Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vertical displacement after jump with table of contents #1180

Closed
SebastianMusic opened this issue Oct 5, 2024 · 24 comments
Closed

Vertical displacement after jump with table of contents #1180

SebastianMusic opened this issue Oct 5, 2024 · 24 comments

Comments

@SebastianMusic
Copy link

SebastianMusic commented Oct 5, 2024

Hello just i downloaded sioyek through homebrew as an alternative to zathura, and it works way better in general but i found an annoying issue pretty quickly. i dont know if this is a bug or if its a setting i have to change.

When i start sioyek i get a lot of whitespace above my first page. when i then center my screen with "zz" and try to jump to a different page using the "t" for table of contents i do not get placed perfectly on the page. it is always slightly off

The first image provided is the empty space at the top of my first page when starting sioyek which might contribute to the issue. and the second image is immediatly after a jump using table of contents which places me off center.

Screenshot 2024-10-05 at 16 29 26 Screenshot 2024-10-05 at 16 30 55
@ahrm
Copy link
Owner

ahrm commented Oct 5, 2024

Normally we center the table of contents in the screen, there is an option to make it align to the top of the screen in the development branch, see this issue: #630.

@SebastianMusic
Copy link
Author

SebastianMusic commented Oct 5, 2024

Thank you for the speedy reply. I just tested this with the dev branch and i think i may have miscommunicated myself. I do not want to place the heading of what i am jumping to at the top of my screen. I want to jump to the page where that header is. so i want the page to be perfectly centered like when you do "zz" on a page. The way you do in zathura if you have tried that viewer.

Because i have bound J and K to next and previous page. if my page gets uncentered because of a jump then it becomes very disorienting when i do next and previous page.

So if its either possible to bind J and K to go to next or previous page and center it.
Or if its possible to when i use 't' to jump it also centers the page i am jumping to and not the header

@ahrm
Copy link
Owner

ahrm commented Oct 5, 2024

Does using something like this in the development branch help your case? (keys_user.config) :

goto_toc;goto_top_of_page t

So if its either possible to bind J and K to go to next or previous page and center it.

It is possible using a similar method:

next_page;goto_top_of_page J

@SebastianMusic
Copy link
Author

goto_toc;goto_top_of_page t

did not work

but binding

next_page;goto_top_of_page J
previous_page;goto_top_of_page K

worked great thank you! i did not know i could chain commands with the semicolon :)

@ahrm
Copy link
Owner

ahrm commented Oct 5, 2024

did not work

Did you try on the development branch?

@SebastianMusic
Copy link
Author

Yes, i have not tried it on the stable branch though.

@ahrm
Copy link
Owner

ahrm commented Oct 5, 2024

Did you restart sioyek after changing the key config?

@SebastianMusic
Copy link
Author

SebastianMusic commented Oct 5, 2024

Yes, i have tried a bit now and i still cant get it to work. i have shut of and restarted sioyek multiple times. I am on the newest MacOS release btw if that changes anything

@ahrm
Copy link
Owner

ahrm commented Oct 5, 2024

What if you do something like this:

goto_toc;toggle_dark_mode t

Does toggle_dark_mode work?

@SebastianMusic
Copy link
Author

SebastianMusic commented Oct 5, 2024

Yes dark mode works and it toggles instantly. i assume the other keybind does not work since it centers me at the same time as it opens the table of contents. that is probably why it does not center me when i confirm which of the index i want to jump to.

Is it possible to make a keybind as to perform the "go to top of page" command after i have selected the index i want to go to?

@ahrm
Copy link
Owner

ahrm commented Oct 5, 2024

That should be the case in the development branch (in the main branch there was a bug where the second commadn triggered immediately but it should be fixed in the development branch).

@SebastianMusic
Copy link
Author

Is there a way to confirm my version sioyek inside of sioyek? As to make sure i am actually on the dev branch? I have switched to the dev branch but i might have previous installations which are being run instead.

@ahrm
Copy link
Owner

ahrm commented Oct 5, 2024

Do you have access to some new commands in the command menu (e.g. add_freetext_bookmark)?

@SebastianMusic
Copy link
Author

No i do not. So it is i who have not properly switched over to the dev branch. This is my first time attempting to build anything from source so please pardon me for this mistake. Thank you for your help i will try to properly build the dev version

@SebastianMusic
Copy link
Author

When building the dev branch am i supposed to run the same command i did for the main branch?

i have tried a bit now and i can not get the dev branch to be compiled. But i can manage to compile the main branch.
I try to compile the dev branch, I navigate into the build directory and there is no sioyek.app file. Whereas when i do so inside of the main branch, and run the same commands there does appear a sioyek.app file in the build directory. Am i meant to run some different command when compiling from the development branch?

here is what i run to try to compile

chmod +x build_mac.sh

brew install 'qt@5' freeglut mesa harfbuzz

export PATH="/opt/homebrew/opt/qt@5/bin:$PATH"
#: The above is needed to make =qmake= from =qt= be found.
#: Find the path using =brew info 'qt@5'=.

MAKE_PARALLEL=8 ./build_mac.sh

@ahrm
Copy link
Owner

ahrm commented Oct 5, 2024

It is pretty much the same but we need qt6 instead of qt5.

@SebastianMusic
Copy link
Author

i tried running this now

chmod +x build_mac.sh

brew install 'qt@6' freeglut mesa harfbuzz

export PATH="/opt/homebrew/opt/qt@5/bin:$PATH"


MAKE_PARALLEL=8 ./build_mac.sh

It gets compiled and ends up in my sioyek directory, but not in the builds folder. Also when i move it to my application folder and try to run it i get that i can't because "it may be damaged or incomplete"

This is the last output i get before i presumbly get some sort of error.
Screenshot 2024-10-05 at 21 21 34

@ahrm
Copy link
Owner

ahrm commented Oct 5, 2024

See this comment thread: #1156 (comment)

@SebastianMusic
Copy link
Author

That did not work for me unfortunately. Is the compiled sioyek from the development branch supposed to end up in a builds folder like the main branch? Since if it is then it might indicate some issue with the complation process rather than after it. As i have recompiled the main branch and that works well.

@ahrm
Copy link
Owner

ahrm commented Oct 5, 2024

Is the compiled sioyek from the development branch supposed to end up in a builds folder like the main branch

Yes, unfortunately I don't have a mac machine right now so I can't help you directly, maybe this helps: #887 (comment). (especially the part about signing).

@SebastianMusic
Copy link
Author

No worries thank you for all the help i really appreciate it. i will try to get it working tomorrow :)

@jinjiaodawang
Copy link
Contributor

@SebastianMusic you may look at
#967 (comment)

@SebastianMusic
Copy link
Author

Thanks for the tip! @jinjiaodawang but that did not work on my machine unfortunatly. It might have something to do with me being on the latest version of MacOS. Which might have broken something in the dev branch. I will have to tinker some more once i get ahead of my school work. Again thanks for the help :)

@SebastianMusic
Copy link
Author

i could not for the life of me get it to build from source, but i managed to download this alpha release, and that seems to work very well. i just had to sign it like when you build from source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants