Skip to content

Conversation

@anig1scur
Copy link
Contributor

So that you could get one note from dock by title directly

image

Copy link
Owner

@vixalien vixalien left a comment

Choose a reason for hiding this comment

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

A better approach would be to add another property named title to the Note (it's in util.ts).

Then you can easily bind the note's title to the note's content, by doing something similar to this in the constructor of the Note:

this.bind_property_full("title", this, "content", flags, (_, content) => {
 // return the first n-chars of the content, or the first line
  }, null);

Then you can create yet another binding from the note's title to the note window's title

Copy link
Owner

@vixalien vixalien left a comment

Choose a reason for hiding this comment

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

Thank you!!

@anig1scur anig1scur requested a review from vixalien October 23, 2024 14:38
src/window.ts Outdated
GObject.BindingFlags.SYNC_CREATE,
(_, title) => {
if (!title) {
return [true, "Untitled Note"];
Copy link
Owner

Choose a reason for hiding this comment

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

I feel like "Sticky Note" may be better here.

Also, wrap the string in a _("string") so that it may get picked up by gettext (the translation infrastructure).

Suggested change
return [true, "Untitled Note"];
return [true, _("Sticky Note")];

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done !

@vixalien
Copy link
Owner

Thank you!

I still need to test this locally, but looks good

@vixalien vixalien merged commit 6c40104 into vixalien:main Oct 30, 2024
0 of 2 checks passed
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

Successfully merging this pull request may close these issues.

2 participants