Skip to content

Commit

Permalink
Placeholder text for tag name
Browse files Browse the repository at this point in the history
- Switch to setting placeholder text for the tag name field
- Add fallback for empty tag name field
  • Loading branch information
Nginearing authored Nov 18, 2024
1 parent 139836d commit 4c7e221
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tagstudio/src/qt/modals/build_tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def set_subtags(self):
def set_tag(self, tag: Tag):
logger.info("setting tag", tag=tag)

self.name_field.setText(tag.name)
self.name_field.setPlaceholderText(tag.name)
self.shorthand_field.setText(tag.shorthand or "")
# TODO: Implement aliases
# self.aliases_field.setText("\n".join(tag.aliases))
Expand All @@ -208,8 +208,10 @@ def build_tag(self) -> Tag:
color = self.color_field.currentData() or TagColor.DEFAULT

tag = self.tag

tag.name = self.name_field.text()
if self.name_field.text() == "":
tag.name = self.tag.name
else:
tag.name = self.name_field.text()
tag.shorthand = self.shorthand_field.text()
tag.color = color

Expand Down

0 comments on commit 4c7e221

Please sign in to comment.