Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Center banner with properties and combine text with image #407

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

Merged

Conversation

Stebalien
Copy link
Contributor

@Stebalien Stebalien commented Nov 5, 2022

This patch contains two (entangled) fixes:

  1. Center the banner with text properties.
  2. Display both the image and text banner at the same time, letting the frame pick the right one for the display type.

The first change, centering with text properties, ensures that the text is smoothly centered without flickering, even if the dashboard is displayed in multiple windows at the same time (each window will center independently).

I'm inserting both the text and image banner at the same time to ensure that we always get the correct banner. Before this change, creating the dashboard buffer before creating a GUI frame would display a text banner.

Known issue: This patch still has to pick whether to center by the image or by the text banner. It does this at redisplay time using a display conditional, but it gets a bit confused when switching back and forth between a terminal frame and a GUI frame.

fixes #386
fixes #197
related #388 (icons still aren't handled)

This patch contains two (entangled) fixes:

1. Center the banner with text properties.
2. Display both the image and text banner at the same time, letting the
frame pick the right one for the display type.

The first change, centering with text properties, ensures that the text
is smoothly centered without flickering, even if the dashboard is
displayed in multiple windows at the same time (each window will center
independently).

I'm inserting both the text and image banner at the same time to ensure
that we always get the correct banner. Before this change, creating the
dashboard buffer before creating a GUI frame would display a text banner.

Known issue: This patch still has to pick whether to center by the image
or by the text banner. It does this at redisplay time using a display
conditional, but it gets a bit confused when switching back and forth
between a terminal frame and a GUI frame.

fixes emacs-dashboard#386
partially fixes emacs-dashboard#388 (icons still aren't handled)
@jcs090218
Copy link
Member

jcs090218 commented Nov 5, 2022

Cool, I think this patch would also resolve issue #197?

I am currently having a disability to work with my PC. Would someone like to test and review this patch?

Just randomly pining some maintainers here, @JesusMtnez @ricardoricho

@Stebalien
Copy link
Contributor Author

Cool, I think this patch would also resolve issue #197?

Yes, it should fix that as well (added to the list).

@Stebalien
Copy link
Contributor Author

It may also fix #292?

@JesusMtnez
Copy link
Contributor

I have enabled the CI for the PR, but I can not tested locally. I have reviewed the code and looks good to me. If it is OK for you, @jcs090218 @ricardoricho , we could merge it. Feel free to approve if you agree with it.

Copy link
Contributor

@ricardoricho ricardoricho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great PR, I just have a few comments but everything looks good. The only doubt I have is about the recentf-list.

@JesusMtnez
Copy link
Contributor

@ricardoricho @jcs090218 did you have any change to test it?

@jcs090218
Copy link
Member

I would to like to test it before we merge this! I will probably do it next weekend (hopefully). If @ricardoricho tested and it works, feel free to merge it! ;)

@jcs090218
Copy link
Member

It works! Nice job! ❤️ 👍

@jcs090218 jcs090218 merged commit 48860b1 into emacs-dashboard:master Nov 16, 2022
@seagle0128
Copy link
Contributor

seagle0128 commented Nov 17, 2022

This PR introduced the error: (void-function image-supported-file-p), and dashboard-center-line was removed to break my Emacs 28.2, on both Windows and macOS.😢

@jcs090218
Copy link
Member

Ah... okay. I think the function image-supported-file-p only exists after 29.1. @Stebalien Can you make a patch to handle this?

Why are you using the function dashboard-center-line? I don't think that's intended to be used externally.

@seagle0128
Copy link
Contributor

@jcs090218 I used dashboard-center-line to customize some functionalities. It is not a big problem. dashboard-insert-center is the alternative. Please fix the issue of image-supported-file-p.

seagle0128 added a commit to seagle0128/.emacs.d that referenced this pull request Nov 17, 2022
@Stebalien
Copy link
Contributor Author

Fix in #409.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Center content before GUI loads Resize hook affects all frames
5 participants