-
Notifications
You must be signed in to change notification settings - Fork 500
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
Hide Note List menu text does not change #1802
Comments
Hi @josh-nz, unfortunately i cannot reproduce this bug. But we can try suggested trick with Int type. Please check this build: |
No, that build does not fix the issue. I've also just tried resizing the window and the notes list and toggling the option, in case it was something to do with my window and notes list sizing. In all cases the issue is present for me. If you'd like to me try a build with extra logging, I'd be happy to attach the logs here. |
OK, next try: |
That build works. I tested at my regular window size and at near full screen (the fill screen window tiling option), and with the notes list at my normal height and non-visible (dragged the notes list bottom bar all the way to the top). In all cases the menu toggled correctly between hide and show. Out of curiosity, what was the fix? |
The problem is that I was testing the default configuration where the notes list is on the side. You can see the commit with the fix above. |
Ah, I had totally forgotten you can choose top or side for the notes list location, otherwise I would have mentioned it. It was the very first thing I changed to make it look more like how I was used to from nvALT. Thanks for the fix. |
Description
The text in the
View
menu does not update based on the visibility of the note lsit.To Reproduce
When the note list is visible, the
View
menu shows the optionHide Note List
.Click this option and the note list hides.
View the menu option again - it still says
Hide Note List
Expected behavior
I expect with the note list hidden, the menu text will say
Show Note List
.FSNotes version
6.9.8 (651)
macOS/iOS version
15.1.1
Additional context
The
Show Note List
text is defined in the localization file, and the menu looks set to update to the correct resource:https://github.com/search?q=repo%3Aglushchenko%2Ffsnotes%20%22hide%20note%20list%22&type=code
I suspect the bug is coming from
isVisibleNoteList()
here:fsnotes/FSNotes/ViewController.swift
Line 2046 in 0227f3e
The
View
menu optionHide Sidebar
correctly toggles the menu text, and the main difference between theisVisibleSidebar()
function and theisVisibleNoteList()
one is that the former casts the width to anInt
before comparing to zero. So perhaps thewidth
property inisVisibleNoteList()
is return a fractional double so it's not equal to zero, or some other similar double/int comparison is failing. I'm not familiar with Swift and what it does with implicit type conversions.I suspect casting the result of:
to an
Int
might fix this issue. Eg:The text was updated successfully, but these errors were encountered: