Skip to content
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

app: presentation tweaks and improvements #25

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Ramen2X
Copy link
Member

@Ramen2X Ramen2X commented Dec 13, 2024

This PR includes some general presentation tweaks and improvements:

  • Sets the global application title to "SI Editor" and reuses it for the window title (previously, only the window title was set to "SI Editor").
  • Appends the currently opened Interleaf file name to the window title.
  • Adds an asterisk indicator to the filename in the title if the file has pending unsaved changes.
  • Properly clears/initializes the screen when making a new file (previously, the media panel elements would remain).

@itsmattkc
Copy link
Collaborator

itsmattkc commented Dec 13, 2024

Good additions, though Qt has a more automated way of adding * to the title that's probably preferable:

Call setWindowTitle() with a [*] somewhere in the string, and then call setWindowModified() and Qt will automatically add/remove the asterisk. This is also useful because at some point we can check windowModified() to confirm/prevent closing an unsaved file.

app/main.cpp Outdated Show resolved Hide resolved
@Ramen2X
Copy link
Member Author

Ramen2X commented Dec 13, 2024

On the topic of automating things with Qt, I just noticed that we don't necessarily have to manually handle trimming directories if we make use of QFileInfo and use its methods to get the clean filename, like it's used here:

v->SetSubtitle(QFileInfo(s).fileName());

This would probably be more "correct", but even if we were to do this, we'd still have to manually trim the embedded media paths to get the Object filenames in the SI for the extraction functionality. So unless there were some way to encapsulate those in a QFileInfo object as well, I wonder if keeping the custom function makes sense. We could also go back to inlining the trimming logic in the extraction function only, like it is in master.

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