quassel
quassel copied to clipboard
Add an edit menu on Mac
Adds an empty edit menu on macs, because this adds the Start dictation...
and Emoji&Symbols
entries that allow users to use those as input.
:+1: for this - I have to go to a different window to get the "Emoji & Symbols" menu, and copy and paste emoji back in to Quassel, right now. Tiny addition for a big UX win.
@ayonix what's the behaviour if you add the parent menu, but don't add a blank item (line 539)? (got a screenshot?)
If you add only the parent menu it gets weird:
- When you start the client the menu bar has no edit menu in it and you can't click on it.
- When you then focus something else and then the client again the edit menu gets added with the Emoji & Symbols item, but not the Start Dictation...
So yeah, I guess I haven't understood the menu well enough to do it properly :)
Thanks for your contribution.
I think the empty entry is a bit too hacky, though and we'll need to find a more proper way before this could be merged.
Additionally, on my El Capitan machine with Qt 4.8.7 I just get an empty menu:
Please reopen if you find a fix for these issues.
I've added some basic actions to the menu, so it won't look broken/unintended, but I can't reopen the pull request. No idea why the entries don't get added with Qt4 though, everything points to the fact that it should be added.
Qt5.6:
Qt4.8.7:
with this implementation, does this fix itself ?
OK, since this appears to work with Qt >= 5, could you please #ifdef it accordingly?
@Deph0 No, it doesn't touch the chat view.
@AlD I'd still like to confirm if this is only for me or if other people with Qt4 don't have the items either. I couldn't find anything in the documentation why this doesn't work with Qt4 but does with Qt5. If I don't find anything by this evening I will add the ifdef
.
I noticed the entries actually don't do anything, but get highlighted when you use the keyboard shortcut. Implementing a copy/paste wasn't successful so far, since we have several widgets you can select from without giving them focus, which is the easiest way I've found.
So we could either have entries that do nothing or someone with more knowledge about Qt has to implement the actions correctly.
Regarding Qt4 vs. Qt5: Naming the menu Edit
instead of &Edit
adds the desired entries on Qt4 and Qt5 for some reason...
I made these changes on a fork of mine and they seem to work fine. I'm curious what didn't work with respect to copying and pasting, because adding menu items shouldn't actually change anything, and as far as I can tell everything works as it did before, but now I can use the emoji menu and the Edit menu highlights briefly when using any of the actions, as expected.
I also removed the &s from menu items because I'm not convinced they actually did anything. Same with the tooltips - I'm not sure I've ever seen those menu items actually display a tooltip on macOS.
I've attached screenshots to show it looks sane on my machine, and I'm happy for @ayonix to sync up, or make a PR for them separately. Are there other concerns? I suspect it's specific enough with Qt 5 and macOS for the risk to be pretty minimal if it works on my machine now. I'd like to try and push this forwards.
https://github.com/quassel/quassel/compare/master...CarrotCodes:feature/edit-qt5-macos


A summary of where this PR stands:
- Qt does not have a way to bring up the "emoji picker" manually (by listening to the standard Ctrl+Cmd+Space key combo)
- Searching Google suggests you can't meaningfully implement Cut/Copy/Paste with widgets because they might do something different / you have to hook them all up manually
- Doing stuff for Qt 4 is basically not worth it at this point if it's getting dropped soon - I'm not even convinced you can get Qt 4 on recent versions of macOS properly
- Implementing "functionless" menu items prevents Cut/Copy/Paste from working only when using the mouse - they work and get highlighted as expected when using the keyboard
- The problem this is solving remains really annoying - to use emoji at all in Quassel on macOS you have to write it somewhere else and copy it in
@AlD @ayonix Is there a contextually relevant action we can implement in the Edit menu that actually works? Is doing so even worth it (the blank menu item looks a bit weird, but solves a much more annoying problem on this platform)?
Did you test this with Qt 5.6.1? https://bugreports.qt.io/browse/QTBUG-53085 / https://bugreports.qt.io/browse/QTBUG-52931 seem related.
@justjanne suggested moving the View->Search Bar to Edit->Find which seems more correct anyway, and would solve the empty item issue.