yanghaoxie / transient-posframe

GNU General Public License v3.0
30 stars 5 forks source link

Allows auto-resizing of the posframe. #3

Open JimDBh opened 3 years ago

JimDBh commented 3 years ago

This uses the "refresh" property when creating a posframe. I set it to a large number yet it still can resize the transient posframe quite well.

Please let me know if there are any concerns with this. Thanks!

yanghaoxie commented 3 years ago

Thank you very much! I never notice that posframe has this feature. However, I have the following questions, could you please explain them for me?

  1. I think in order to get the refresh feature to work, the values of min-width and min-height should be relatively small. I think maybe we should explain this a little in the document.
  2. When I enable this feature, I noticed that the transient-posframe is not at the frame center as I set, instead the top left corner of the transient-posframe is at the frame center, which makes the transient-posframe shift to the bottom right. Do you notice a similar phenomenon? If you do, could you please help me understand this?
JimDBh commented 3 years ago

Thank you very much! I never notice that posframe has this feature. However, I have the following questions, could you please explain them for me?

My pleasure. Glad if it helps!

  1. I think in order to get the refresh feature to work, the values of min-width and min-height should be relatively small. I think maybe we should explain this a little in the document.

Absolutely. I am personally OK with the min-width setting, but I set min-height to 1 for adaptive size.

  1. When I enable this feature, I noticed that the transient-posframe is not at the frame center as I set, instead the top left corner of the transient-posframe is at the frame center, which makes the transient-posframe shift to the bottom right. Do you notice a similar phenomenon? If you do, could you please help me understand this?

I notice this too if I set min-width to a small value. I think this is because posframe does not re-position the window after resizing? I am not sure whether this is something posframe should do, or can do, though.

However by setting min-width to a reasonable value (like 80), it is not a big problem. Personally I am OK with the window being a bit too wide, but not too high.

yanghaoxie commented 3 years ago

Sorry for the late reply. BTW, happy Chinese new year. I investigate folloing behaviour a bit.

posframe does not re-position the window after resizing...

I noticed that by setting the value of refresh in posframe-show, I can get ivy-posframe reposition correctly. Therefore, I think maybe we can make transient-posframe behaviours correctly, too.

However, I am very busy recently, I think I will investigate this more later. If you like, maybe you can try to investigate ivy-posframe, too. :sweat_smile: .