nothingislost / obsidian-hover-editor

Transform the Page Preview hover into a working editor instance
MIT License
543 stars 21 forks source link

Initial popover height max: The hovered window does not reach the bottom of the view #282

Open merlinuwe opened 2 months ago

merlinuwe commented 2 months ago

Thanks for your great plugin.

Is there a max for the initial popover height setting?

The higher value I give, the more the windows starts at the top, that's what I expect. At 1200 px. the window starts at the top. But the bottom of the hovered windows does not reach to the bottom.

Settings

image


400px

image


800px

image


1200px

image

Could you please enhance this maximal possible value?

pjeby commented 2 months ago

Huh. Well, I'm gonna have to ping @nothingislost on this one, because it's something in InteractJS doing it. Initially it sets the height as requested, but then an InteractJS "move" event occurs, and then it resizes. I'm pretty sure the purpose of the resizing is to keep it within the screen boundaries, but the calculation is coming up with 703.3333px for some reason (at least on my machine) instead of the actual screen height. I don't know where it's getting that from, it seems to be calculated somewhere deep inside InteractJS.

pjeby commented 2 months ago

Huh. I found a bit of the code that restricts the maximum size to 2/3rds of the window size (height and width). Not sure what that's about. As a workaround, you can edit your main.js and change the offsetHeight/1.5 and offsetWidth/1.5 to remove the /1.5 part, which will make the maximum the size of the window rather than 2/3rds of the window.

merlinuwe commented 2 months ago

Thank you very much for this tip, it works:

image

yarub123 commented 1 week ago

@merlinuwe unrelated but what theme is this?

merlinuwe commented 1 week ago

Magic user theme with "moon" selected.

https://github.com/drbap/magicuser-theme-for-obsidian