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

Adds shortcuts for better navigating editor window #2979

Merged
merged 26 commits into from Aug 20, 2019

Conversation

@dicene
Copy link
Contributor

commented Aug 13, 2019

Brief overview of PR changes/additions

Adds CTRL+Tab and CTRL+SHIFT+Tab shortcuts that enable you to jump from section to section in
the editor window without needing to use your mouse.

Motivation for adding to Mudlet

I personally hate having to use the mouse pretty much ever. When I'm working on coding and the like, I like to be able to navigate with both hands on the keyboard. This change further enables that. Additionally, this will benefit any Visually Impaired users, by reducing the guess-work with tabbing repeatedly, and making it possible to escape the Edbee editor without needing to use a mouse.

Other info (issues closed, discussion etc)

@dicene dicene requested review from Mudlet/core-cpp as code owners Aug 13, 2019

@add-deployment-links

This comment has been minimized.

Copy link

commented Aug 13, 2019

Hey there! Thanks for helping Mudlet improve. 🌟

Test versions

You can directly test the changes here:

No need to install anything - just unzip and run.
Let us know if it works well, and if it doesn't, please give details.

@dicene

This comment has been minimized.

Copy link
Contributor Author

commented Aug 13, 2019

CTRL+Tab and CTRL+SHIFT+Tab are widely used to jump from one panel to another, and are mentioned for this purpose in the Qt Documentation as well as in Microsoft UI Design Guides.

I tried to select a reasonable tabbing order that brings you quickly through the window to the most used options, with some things needing a combination of this shortcut and normal tab. There are some cases where it might be worth considering adding further stops along the way, like adding a position at the Stylesheet editor for Buttons.

vadi2 and others added 17 commits Aug 8, 2019
Factor out drawing exits in the map into a separate method (#2941)
* WIP

* Const the variables that we can

* Format
Reorganize windows sdk (#2958)
* Move declaration of install functions

This allows us to use them singularly in a different context.
Use our own edbee with updated QsLog (#2914)
Intention is to send all improvements upstream but not be delayed by them getting merged.
Don't show SSL certificate info until we have one in Profile Preferen…
…ces (#2953)

* Don't show SSL certificate info until we have one & streamline UI

* Remove colorroles
Add a workaround for mapper creation breaking getMainWindowSize() (#2945
)

* Add a workaround for mapper creation breaking getMainWindowSize()

* Revert "Fix errors when creating new triggers (#2868)"

This reverts commit 0578c61.

* Fix typo
Raise minimum to Qt 5.11 (#2944)
* Raise minimum to Qt 5.11

* Update Travis minimum Qt build
Replace a couple of cases of std::tie with auto (#2967)
* Replace a couple of cases of std::tie with auto

* A few more
Add autocomplete toggle (#2679)
* Update tooltip, more than IRE now provide maps (#2668)

* Add autocomplete toggle to profile

* Update to a version of edbee with autocomplete toggle

* Wire in the autocomplete toggle

* Use correct host variable

* Add missing toggle call

@dicene dicene requested review from Mudlet/infrastructure as code owners Aug 13, 2019

@vadi2
Copy link
Member

left a comment

Seems to work fine for me, the only concern is that it's a custom shortcut that nobody will know about - need to make it discoverable somehow.

What do you think about the CodeFactor warning?

@dicene

This comment has been minimized.

Copy link
Contributor Author

commented Aug 16, 2019

Seems to work fine for me, the only concern is that it's a custom shortcut that nobody will know about - need to make it discoverable somehow.

What do you think about the CodeFactor warning?

Well, 1/4 of the issues found is unrelated to mode changes entirely. The other three just say "complex method". I'm not really sure there's much more that I could do to make it better though.

src/dlgTriggerEditor.cpp Outdated Show resolved Hide resolved
{
switch (mCurrentView) {
case EditorViewType::cmTriggerView:
if (QString("edbee::TextEditorComponent").compare(QApplication::focusWidget()->metaObject()->className()) == 0) {

This comment has been minimized.

Copy link
@vadi2

vadi2 Aug 16, 2019

Member

This should be a QStringLiteral as with others:

Selection_427

This comment has been minimized.

Copy link
@dicene

dicene Aug 16, 2019

Author Contributor

Fixing in commit.

Didn't fix in both functions, so I'll get another commit in.

return;
}
}
}

This comment has been minimized.

Copy link
@vadi2

vadi2 Aug 16, 2019

Member

Can you run clang-format on this entire function? Not file. Here's an example of how to use in Qt Creator in case you're not familiar (if you are, ignore!):

Peek 2019-08-16 06-18

This comment has been minimized.

Copy link
@dicene

dicene Aug 16, 2019

Author Contributor

Done in commit.
Edit: Didn't run the function on both functions(next AND previous), so I'll do that and commit again.

dicene added 3 commits Aug 16, 2019
@dicene

This comment has been minimized.

Copy link
Contributor Author

commented Aug 16, 2019

This is why I like to use my PR's as my daily driver for a while. Turns out if the first trigger pattern you have is a prompt pattern, Ctrl+Tab doesn't do anything if you're in the name field(or the other fields that Ctrl+Tab to the patterns). I'll have to set up some logic to find the first not-prompt pattern field, or to go to the first pattern's drop-down type list instead.

@dicene

This comment has been minimized.

Copy link
Contributor Author

commented Aug 16, 2019

Also, @vadi2, I share your concern that very few people aside from those that read the updatelog will actually know the shortcut exists, but I'm not entirely sure how we could increase its visibility. We could possibly put them into the "you haven't selected a trigger yet" screen, but I'm not sure that many people read that.

@vadi2

This comment has been minimized.

Copy link
Member

commented Aug 16, 2019

One thought is those 'New! Now you can do this' context-sensitive bubbles, but we don't have the framework to setup to them. The next best alternative would be tooltip(s) - don't have it much clearer than that tho.

@Mudlet/ui-review ?

@vadi2
vadi2 approved these changes Aug 20, 2019
Copy link
Member

left a comment

🤷‍♂ no feedback from there, so let's go with it as-is and add the ideas on discoverability in a later update.

For one https://wiki.mudlet.org/w/Manual:Editor will need to be updated, but I don't remember the website I made it with.

@vadi2 vadi2 merged commit 65ef8d3 into Mudlet:development Aug 20, 2019

2 of 7 checks passed

Travis CI - Pull Request Build Errored
Details
CodeFactor 94 issues fixed. 198 issues found.
Details
Travis CI - Pull Request Build Created
Details
LGTM analysis: JavaScript No code changes detected
Details
LGTM analysis: Python No code changes detected
Details
LGTM analysis: C/C++ No new or fixed alerts
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
@Kebap

This comment has been minimized.

Copy link
Contributor

commented Aug 30, 2019

🤷‍♂ no feedback from there, so let's go with it as-is and add the ideas on discoverability in a later update.

For one https://wiki.mudlet.org/w/Manual:Editor will need to be updated, but I don't remember the website I made it with.

I updated that image to be a text instead for a11y reasons.
Also included these new shortcuts (in a new "navigation" section)

  • CTRL+Tab - Focus next section
  • CTRL+SHIFT+Tab - Focus previous section

The word "section" I am not too happy with, maybe "widget" (but technical), maybe "panel" (as named above), maybe other still?

Also I would have naively assumed CTRL + Tab to bring me from trigger editor to alias editor to timer editor, etc. Is that another shortcut still?

@vadi2

This comment has been minimized.

Copy link
Member

commented Aug 30, 2019

Thanks for changing it! Much easier to update now, too. I think "section" sounds fine, but if someone has a better term, I wouldn't mind.

Taking you to another editor I don't think was the purpose of this shortcut. It should indeed be a different shortcut.

wsdmatty added a commit to wsdmatty/Mudlet that referenced this pull request Sep 5, 2019
Adds shortcuts for better navigating editor window (Mudlet#2979)
* Initial commit. Adds ctrl+tab shortcut and logic for moving from pane to pane in the trigger editor.

* Shortcut works without menu action. Forward tabbing logic seems to be right.

Just missing reverse shortcut and logic.

* Added CTRL+SHIFT+Tab shortcut to tab through sections in reverse order.

* Removed unnecessary debug code.

* Factor out drawing exits in the map into a separate method (Mudlet#2941)

* WIP

* Const the variables that we can

* Format

* Reorganize windows sdk (Mudlet#2958)

* Move declaration of install functions

This allows us to use them singularly in a different context.

* Use our own edbee with updated QsLog (Mudlet#2914)

Intention is to send all improvements upstream but not be delayed by them getting merged.

* Fix userwindows not going away on profile close (Mudlet#2959)

* Use correct URL to download the coverity software

* Don't show SSL certificate info until we have one in Profile Preferences (Mudlet#2953)

* Don't show SSL certificate info until we have one & streamline UI

* Remove colorroles

* Add a workaround for mapper creation breaking getMainWindowSize() (Mudlet#2945)

* Add a workaround for mapper creation breaking getMainWindowSize()

* Revert "Fix errors when creating new triggers (Mudlet#2868)"

This reverts commit 0578c61.

* Fix typo

* Don't include TLS code code when it's not available (Mudlet#2965)

* Raise minimum to Qt 5.11 (Mudlet#2944)

* Raise minimum to Qt 5.11

* Update Travis minimum Qt build

* Remove < Qt 5.11 workarounds (Mudlet#2969)

* Replace a couple of cases of std::tie with auto (Mudlet#2967)

* Replace a couple of cases of std::tie with auto

* A few more

* Fix Coverity TTimer mRepeating initialiser warning (Mudlet#2972)

* Fix updateDialog uninitialised in constructor (Mudlet#2973)

* Fix nullptr warning around curVar (Mudlet#2974)

* Fix a possible nullptr dereference if the room wasn't found for some reason (Mudlet#2975)

* getRoom() will return nullptr if the room id is negative (Mudlet#2976)

* Add autocomplete toggle (Mudlet#2679)

* Update tooltip, more than IRE now provide maps (Mudlet#2668)

* Add autocomplete toggle to profile

* Update to a version of edbee with autocomplete toggle

* Wire in the autocomplete toggle

* Use correct host variable

* Add missing toggle call

* Formatting changes up simplification of some code.

* Added closing bracket that I must have accidentally deleted while resolving conflicts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.