Skip to content

Improve: icons not coloured status text for normal exits in exits dialog#5513

Merged
SlySven merged 3 commits intoMudlet:developmentfrom
SlySven:Improve_iconsNotColouredStatusTextForNormalExitsInExitsDialog
Oct 22, 2021
Merged

Improve: icons not coloured status text for normal exits in exits dialog#5513
SlySven merged 3 commits intoMudlet:developmentfrom
SlySven:Improve_iconsNotColouredStatusTextForNormalExitsInExitsDialog

Conversation

@SlySven
Copy link
Copy Markdown
Member

@SlySven SlySven commented Oct 14, 2021

This PR puts an icon to the right of the text for each normal exit room ID QLineEdit entry widget in the room exits form/dialogue. The icon is one of four (blank, green tick, orange warning triangle, white-on-red cross) to indicate whether the entry is:

  • blank (empty)
  • valid and to a room in the same area
  • valid and to a room in a different area
  • invalid

respectively. This replaces the previous use of coloured texts which did not work well, particularly with dark styling.

This is a major functional part extracted from the previous draft mega-PR #5303 and deals only with the normal exits. A separate PR is to follow to deal with the special exits.

Also:

  • removes predefined tooltips in the room_exits.ui for the normal exit direction QLineEdit entry widgets - as the text is now incorrect and they are not needed as the appropriate text is generated during the dialogue's construction in the C++ code.
  • refactors some very repeated code (one instance for each normal exit direction) out of the:
    • slot_????_textEdited(const QString&)
    • slot_stub_????_stateChanged(int)
      slot methods.
  • removes a bogus tooltip that was assigned to the non-functional "key" but which made mention of a southwest exit direction.

Signed-off-by: Stephen Lyons slysven@virginmedia.com

Release post highlight

Coloured text in room exits dialogue now removed and replaced with status icons (normal exits initially, special exits to follow) - which is more friendly for styling, particularly for those using dark desktop environments.

This PR puts an icon to the right of the text for each normal exit room ID
`QLineEdit` entry widget in the room exits form/dialogue. The icon is one
of four (blank, green tick, orange warning triangle, white-on-red cross)
to indicate whether the entry is:
* blank (empty)
* valid and to a room in the same area
* valid and to a room in a different area
* invalid
respectively. This replaces the previous use of coloured texts which did
not work well, particularly with dark styling.

This is a major functional part extracted from the previous draft mega-PR
Mudlet#5303 and deals only with the normal exits. A separate PR is to follow to
deal with the special exits.

Also:
* removes predefined tooltips in the `room_exits.ui` for the normal exit
direction `QLineEdit` entry widgets - as the text is now incorrect and they
are not needed as the appropriate text is generated during the dialogue's
construction in the C++ code.
* refactors some very repeated code (one instance for each normal exit
direction) out of the:
  * `slot_????_textEdited(const QString&)`
  * `slot_stub_????_stateChanged(int)`
slot methods.
* removes a bogus tooltip that was assigned to the non-functional "key"
but which made mention of a southwest exit direction.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
@SlySven SlySven requested a review from a team as a code owner October 14, 2021 20:36
@SlySven SlySven requested a review from a team October 14, 2021 20:36
@add-deployment-links
Copy link
Copy Markdown

add-deployment-links bot commented Oct 14, 2021

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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Oct 14, 2021

Messages
✔️

PR type: Improvement

Generated by 🚫 dangerJS against 129ddaa

@github-actions
Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
@SlySven
Copy link
Copy Markdown
Member Author

SlySven commented Oct 14, 2021

In use (with a Dark Desktop environment!):
image

compared to current development branch code:
image

Oh, I forgot that previous code did not distinguish between in- and out-of-area exits - I had previously coded to do the latter in cyan coloured text but I guess I never pushed the code out to do it...

@Delwing
Copy link
Copy Markdown
Contributor

Delwing commented Oct 14, 2021

IMHO warning sign is "too much" for room out of area. There is nothing wrong with that and warning sign kind of implies that this should be checked. Maybe arrow icon?

@vadi2
Copy link
Copy Markdown
Member

vadi2 commented Oct 14, 2021

I had the same feedback as @Delwing.

Nice change otherwise!

@SlySven
Copy link
Copy Markdown
Member Author

SlySven commented Oct 15, 2021

Well I do want it to show a difference for an out-of-area exit but I was trying to confine it to icons already used - and I've already use that three-some already (see the room symbol usage dialogue in the "mapper" preferences). Do we have a better icon already in the source files - @Delwing you say "Maybe arrow icon" - the only one that might sort of work I suppose is the :/icons/arrow-right.png one?

image

🤔 The contrast (valid exits are, of course, now both green) would be less obvious with that - I still think that it is not unreasonable to be saying "Hey this exit is going somewhere else completely, are you sure that is what you want?"

@SlySven
Copy link
Copy Markdown
Member Author

SlySven commented Oct 15, 2021

💡 How about if I GIMP that triangle arrow icon to make it cyan rather than green? The colour difference will help to make it stand out a bit better (for those with normal colour vision anyhow - I might have to do some extra work later in order to make the whole dialogue work better with Qt's accessibility system!)

@vadi2
Copy link
Copy Markdown
Member

vadi2 commented Oct 15, 2021

I think the green triangle is fine 👍

This is in response to peer-review which was unhappy about using a standard
(yellow) warning triangle. The reason for using a cyan version (of an
already existing green one) is so that there is a colour contrast between
it and the green "tick" used for in-area exits...

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
@SlySven
Copy link
Copy Markdown
Member Author

SlySven commented Oct 15, 2021

Humm, I think it is marginally different, but the contrast is not as strong as I would have hoped for (I shifted the hue exactly 60°):
image

Maybe it is because of the cyan focus rectangle around that QLineEdit - or because of the dark background (it might show more strongly different on a light background). Anyhow I'll commit it in and say that'll do as far as I'm concerned.

@SlySven SlySven merged commit 578221c into Mudlet:development Oct 22, 2021
SlySven added a commit to SlySven/Mudlet that referenced this pull request Oct 22, 2021
…alog

This is a bit more involved than the normal exit ones as we have to provide
an extra class to be a "delegate" to handle the `QLineEdit` that is
embedded in the `QTreeWidget` derived special `ExitsTreeWidget` when a text
field (in this case the exit roomID) is edited. We use that and the code
from Mudlet#5513 for normal exits to provide the same icons in that widget whilst
the exit roomID is being edited and we put the same icon in a new column to
the immediate right of that column when that field is not being edited.

This is a major functional part extracted from the previous draft mega-PR
Mudlet#5303 and deals only with the special exit roomIDs. This follows on from a
separate PR Mudlet#5513 already merged to handle normal exits.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
@SlySven SlySven deleted the Improve_iconsNotColouredStatusTextForNormalExitsInExitsDialog branch October 22, 2021 17:51
SlySven added a commit to SlySven/Mudlet that referenced this pull request Oct 26, 2021
…alog

This is a bit more involved than the normal exit ones as we have to provide
an extra class to be a "delegate" to handle the `QLineEdit` that is
embedded in the `QTreeWidget` derived special `ExitsTreeWidget` when a text
field (in this case the exit roomID) is edited. We use that and the code
from Mudlet#5513 for normal exits to provide the same icons in that widget whilst
the exit roomID is being edited and we put the same icon in a new column to
the immediate right of that column when that field is not being edited.

This is a major functional part extracted from the previous draft mega-PR
Mudlet#5303 and deals only with the special exit roomIDs. This follows on from a
separate PR Mudlet#5513 already merged to handle normal exits.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
SlySven added a commit that referenced this pull request Nov 7, 2021
…alog (#5543)

This is a bit more involved than the normal exit ones as we have to provide
an extra class to be a "delegate" to handle the `QLineEdit` that is
embedded in the `QTreeWidget` derived special `ExitsTreeWidget` when a text
field (in this case the exit roomID) is edited. We use that and the code
from #5513 for normal exits to provide the same icons in that widget whilst
the exit roomID is being edited and we put the same icon in a new column to
the immediate right of that column when that field is not being edited.

This is a major functional part extracted from the previous draft mega-PR
#5303 and deals only with the special exit roomIDs. This follows on from a
separate PR #5513 already merged to handle normal exits.

Revised to adopt some peer review points.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
vadi2 pushed a commit to SlySven/Mudlet that referenced this pull request Jan 17, 2022
…alog (Mudlet#5543)

This is a bit more involved than the normal exit ones as we have to provide
an extra class to be a "delegate" to handle the `QLineEdit` that is
embedded in the `QTreeWidget` derived special `ExitsTreeWidget` when a text
field (in this case the exit roomID) is edited. We use that and the code
from Mudlet#5513 for normal exits to provide the same icons in that widget whilst
the exit roomID is being edited and we put the same icon in a new column to
the immediate right of that column when that field is not being edited.

This is a major functional part extracted from the previous draft mega-PR
Mudlet#5303 and deals only with the special exit roomIDs. This follows on from a
separate PR Mudlet#5513 already merged to handle normal exits.

Revised to adopt some peer review points.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
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.

3 participants