secure-77 / Perlite

A web-based markdown viewer optimized for Obsidian
https://perlite.secure77.de/
MIT License
968 stars 81 forks source link

Default column width change #87

Closed NotGovernor closed 1 year ago

NotGovernor commented 1 year ago

I played around with it until I found some default values that look decent; but I dont know if you want to do it this way. I'll submit it just in case you do. No worries if you want to reject it.

(sorry for the messy PR earlier)

secure-77 commented 1 year ago

Thx for the PR, but the values doesn't fit for WQHD (it looks to small then)

I would suggest to implement something like the following:

if no value is stored in the local storage (this means the user doesn't have already adjust the panel size by himself) we set the value of the panels to one sixth of the window via perlite.js

  // panel sizes
  if (localStorage.getItem('leftSizePanel')) {
    $('.workspace-split.mod-horizontal.mod-left-split').css("width", localStorage.getItem('leftSizePanel'))
  } else {
    $('.workspace-split.mod-horizontal.mod-left-split').css("width", window.innerWidth / 6)
  }

  if (localStorage.getItem('rightSizePanel')) {
    $('.workspace-split.mod-horizontal.mod-right-split').css("width", localStorage.getItem('rightSizePanel'))
  } else {
    $('.workspace-split.mod-horizontal.mod-right-split').css("width", window.innerWidth / 6)
  };

this should then fit for WQHD, Full HD and even non HD screens.