-
Notifications
You must be signed in to change notification settings - Fork 29
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
Add reference-font remove button #2017
base: main
Are you sure you want to change the base?
Add reference-font remove button #2017
Conversation
04a7038
to
9f9a837
Compare
We use at least two different things for this in Fontra:
In the context of lists, so far we only use the (+) (-) approach. So that would be more consistent with other parts of Fontra. (The "+" button could trigger a file upload dialog) On the other hand, to have a delete icon ("trash" would be preferred then), is a bit more user friendly, as it doesn't require an item to be selected first. I don't think this icon needs to be so deeply integrated into the ui-list class. Look at for example the glyph source list: it contains clickable icons. I'm leaning towards to (+) (-) solution. |
Ah yes, I see, that’s much easier, actually. Thanks for the hint |
I reversed changes in ui-list.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @giovanniTramonto (Johannes), thanks a lot that you help us with Fontra. I much appreciate that and it's great to be in contact with you this way, again.
I tested it and it works well. Please see my comments.
Hi @ollimeier! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for your update. Seems to work well. I have only a few minor change requests related to the text strings in the dialog.
I noticed that the reference font is not displayed if we add only one font. Here a quick demo:
Screen.Recording.2025-02-13.at.09.06.43.mp4
This was not introduced by you. It was there already before. We may want to have a look into that issue as a follow up.
Oh, interesting! Just tried to reproduce. For me it seems to work: reference-font.mov |
Is it possible for the "+" button to immediately do to the choose files dialog, without the in-between dialog? |
Oh, yes. This is much more practical |
@justvanrossum @giovanniTramonto This last change is so much better. Keep it simple, right! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left one comment, otherwise looks good to me.
I think this review has been resolved, I'm not sure why it isn't marked as such.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
Should the remove button perhaps also respond to the alt key, to mean "delete all"?
So currently no item gets selected after removing the selection, right? This matches the original behavior, but not wat we recently discussed. Is that your intention indeed?
@@ -531,7 +544,10 @@ export default class ReferenceFontPanel extends Panel { | |||
} | |||
|
|||
async _deleteSelectedItemHandler() { | |||
await this._deleteItemOrAll(this.filesUIList.getSelectedItemIndex()); | |||
const index = this.filesUIList.getSelectedItemIndex(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change shouldn't be needed, as this method should only be called when there is a valid selection.
I notive that the enabled/disabled state of the remove button is not updated after deletion. Maybe that is the problem?
@@ -419,7 +430,9 @@ export default class ReferenceFontPanel extends Panel { | |||
return this.controller.model; | |||
} | |||
|
|||
async _filesDropHandler(files) { | |||
async _filesHandler(files) { | |||
if (files.length === 0) return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this project we never omit braces for blocks, so this should be written like this:
if (files.length === 0) {
return;
}
Before reference-font items could only be deleted by selecting (clicking) an item and pressing delete-key after. Not self-explanatory.
Now there is a remove (-) button at the end of each line.