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

org-tree-slide-content-margin-top is ignored when org-tree-slide-header is nil #51

Open
jgru opened this issue Feb 4, 2022 · 6 comments

Comments

@jgru
Copy link

jgru commented Feb 4, 2022

Dear Takaaki,

the variable org-tree-slide-content-margin-top is ignored, when the is not shown by setting org-tree-slide-header to nil.
I would like, that blank lines are introduced even, when the header is hidden, so that the slide content is a bit more centered.
Do you have an idea, how to fix this?

Thank you for provideing org-tree-slide btw, it's a great package.

Best regards
jgru

@takaxp
Copy link
Owner

takaxp commented Feb 4, 2022

A workaround only for this case, please copy paste this code to your init.el.

(with-eval-after-load "org-tree-slide"
  (defun org-tree-slide--slide-in (blank-lines)
  "Apply slide in.  The slide will be moved from BLANK-LINES below to top."
  (let ((min-line -1))
    (setq min-line org-tree-slide-content-margin-top)
    (while (< min-line blank-lines)
      (org-tree-slide--set-slide-header blank-lines)
      (sit-for org-tree-slide-slide-in-waiting)
      (setq blank-lines (1- blank-lines))))))

If this could work in your side, then I'll think to integrate this feature in the next update.

@jgru
Copy link
Author

jgru commented Feb 4, 2022

Thank you very much for your quick reply.
This solution works, when org-tree-slide-slide-in-effect is set to t.
It it is set to nil however, it does not work. Therefore, I changed it to:

(with-eval-after-load "org-tree-slide"
  (defun org-tree-slide--slide-in (blank-lines)
  "Position the slide will be moved from BLANK-LINES below to top."
  (org-tree-slide--set-slide-header org-tree-slide-content-margin-top)))

Do you have a tip on improving this, since it is kind of an ugly hack?

Furthermore, I wonder, how I could preserve the asterisks of the org-heading? (Those disappear, when using this approach)

Thanks again!

@takaxp
Copy link
Owner

takaxp commented Feb 4, 2022

I think your proposed approach is nice because I did similar way in org-tree-slide--show-slide-header.

Regarding the issue on showing asterisks, could you kindly provide a screenshot in this thread?

@jgru
Copy link
Author

jgru commented Feb 4, 2022

I think your proposed approach is nice because I did similar way in org-tree-slide--show-slide-header.

Glad to hear!

Regarding the issue on showing asterisks, could you kindly provide a screenshot in this thread?

Sure. Here is a screenshot:
Screenshot from 2022-02-04 17-35-13
(Note: org-superstar-mode enabled, but the issue is also present without it.)

I would like to display the bullet (or the asterisks respectively) with the top-margin as well.
Do you have an idea, how this could be accomplished?

Thanks already in advance!

@takaxp
Copy link
Owner

takaxp commented Feb 4, 2022

Honestly speaking, it is really hard to show the asterisk in a sliding header because it is the key element to introduce the sliding effect. At this moment, unfortunately I cannot come up with a good idea to show the asterisk with sliding in effect. I'll think the way to achieve it somehow.

@jgru
Copy link
Author

jgru commented Feb 8, 2022

Honestly speaking, it is really hard to show the asterisk in a sliding header because it is the key element to introduce the sliding effect. At this moment, unfortunately I cannot come up with a good idea to show the asterisk with sliding in effect. I'll think the way to achieve it somehow.

Thanks for your reply. Anyways, thanks for thinking about it. I think it would be a good addition!

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

2 participants