giuspen / cherrytree

cherrytree
https://www.giuspen.net/cherrytree/
Other
3.43k stars 466 forks source link

CodeBox size ignored #1257

Open LittiGit opened 4 years ago

LittiGit commented 4 years ago

0.99.15 Windows10 portable

The setting of the size (pixels or percent) of a codebox is ignored. Codebox is displayed maximized. Seems it starts well (<1s) then becomes maximum.

Same document opened in 0.39.4 looks OK.

Change theme doesn't help.

Anyone else with this problem? Any other setting necessary?

giuspen commented 4 years ago

You have to untick auto expand of codeboxes in preferences dialog tab rich text

Zer0CoOLoL commented 4 years ago

Guispen, yes but if check expand codebox then there is a scroll bar appears and everything will not fit into the window (which is very convenient) and anyway size changing doesn't work unfortunately :( P.S. Thank you very much for your work!

visionpentest commented 2 months ago

I've been investigating the codebox resizing issue and have some observations and suggestions:

  1. Width Adjustment:

    • Disabling "auto expand codebox" improves the width experience.
    • Setting codebox_width_pixels to true in the config (or clicking the percent sign in codebox settings) allows for percentage-based width adjustment.
  2. Height Adjustment:

    • Height seems to be set in pixels, not percentages.
    • There's no equivalent boolean for height as there is for width.
    • The auto-expand feature works well vertically but also expands horizontally, which isn't always desirable.
  3. Proposed Solution:

    • Implement a toggle for word wrap in codeboxes.
    • This would allow the auto-expand to work for height while preventing horizontal scrolling.
  4. Current Limitations:

    • Without word wrap, users must manually set the height in pixels for each codebox to avoid the default 100-pixel height.
  5. Code Location:

    • The relevant code appears to be in src/ct/ct_actions_others.cc.

This solution would likely address both my needs and those of the original poster, providing a more flexible and user-friendly codebox experience.