Enhance: indicate other profile with new data when multi-playing#1589
Enhance: indicate other profile with new data when multi-playing#1589SlySven merged 11 commits intoMudlet:developmentfrom
Conversation
If more than one profile is open and multiView mode is not selected then any profile which is not the currently selected one will be hidden from view - and if any data comes in from the MUD server it will not be obvious. This commit turns the text on the tab of the "other" profile red when new data arrives - which is reset when the user switches to that profile to see what has come in. Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
|
This looks great, but red is hard to see. How about making it bold instead? |
|
Unfortunately there isn't an obvious control for that (I'm using |
|
Of course a modified marker - a |
|
I think we can make it bold! I prefer that over an asterisk. If we give the tabs object names, we could address them in css:
|
|
🤕 I can't get style sheets to work on tab widgets using the I can style the tabs with other QSS(?) selection mechanisms, e.g. Sadly there is another problem with using StyleSheets on Tab-bars in Qt 5.9.2 - 10.0 beta1 (at least) - see QTBUG-63696: {macOS} Regression: setting stylesheet on QTabWidget::pane hides the close graphic on tab - which says that the close button (that we use!) on the tabs disappears on macOs platforms when a style-sheet is applied...! Oh, we cannot give the tabs object names, they are not exposed in a suitable manner from the |
This attempts to detect some local initiated things that change the contents as well as incoming data from the Mud Server, in the former case a blue-which info icon is added to the tab for the affected, "other" non-active profile, which also turns the title text blue to match. For data coming in from the Mud Server an orange warning triangle is placed there together with the red text. This has priority over the local case. Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
|
The above commit might help - it adds an icon as well as changing the colour and it does so for some local actions that change the contents of the main console as well as for when text comes in from the Mud Server. The latter does have priority though... I have made the tab text a little larger - so the tabs are a little bigger which is okay I think as it stops the icons from being too small! |
|
I've research it further (even build a small test case application) and I am pretty much convinced that it is not possible to apply styling to specific tabs based on their index or text. 👎 |
|
Have you tried using dynamic properties? Qt CSS is able to target those
…On Sat, 31 Mar 2018, 7:49 pm Stephen Lyons, ***@***.***> wrote:
I've research it further (even build a small test case application) and I
am pretty much convinced that it is not possible to apply styling to
*specific* tabs based on their *index* or *text*. 👎
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#1589 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAGxjICCvghAN2Vh5_2XDYYuOM2mOE-rks5tj8HEgaJpZM4S_Rp3>
.
|
|
That won't work - having read Dynamic Properties and Stylesheets and looking at the 5.10.0 source code I can see that the individual tabs are not However that code has suggested checking trying |
|
... nope, that doesn't work. I just tried to inspect a |
|
I had a look at the latest - still not a fan. Trying out various things myself too. |
|
Given the current state of things I'd be tempted to drop the colour and rely solely on icons... |
|
This solution seems to work: http://lists.qt-project.org/pipermail/interest/2018-April/029734.html Could you adapt it? |
Some code was suggested and modified to sub-class the QTabBar class into one (TTabBar) with the ability to set individual tabs to have bold text on a per tab (selected by text OR index). This also required the derivation of a TStyle from QProxyStyle to perform the actual drawing of tabs so modified. I have removed the previous use of icons and changed the red on data from the MUD server to magenta. Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
|
Yes - but it took me a while to get my head around it as it targeted |
SF is becoming increasingly unreliable as a host for source code and this project has moved to Github some time ago but we had not spotted this. There are later versions that the 2012 0.13.62 version that we are currently using but that is an exercise for a new PR instead of a hot-fix repair to the system for this one. Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Might help with build failures (and it might not). Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
vadi2
left a comment
There was a problem hiding this comment.
The bolding seems to work well... could TTabBar be in a separate class file though - separation of concerns, mudlet.cpp should not worry about custom widgets?
The colour doesn't really look that good, I'd prefer it to be just a normal bolding
|
I would like to differentiate between the two cases though (local and remote) and cover the corner case where all the tabs are bolded by an application or user's system wide style settings - do you have an alternative (am I going to have to include provisions to underline or italicize as well)? I mean blue works well for me but red is not so, um, hot - so I thought magenta seemed a reasonable choice as it seems more urgent than blue (do you want a user choice?) |
|
I think that's overengineering. Let's keep it simple for the first pass and if people request that feature, we can still add it in. |
|
Ah @keneanung - just the person I ought to drag into this - do you have any advice on (and do you still have those steel-lined rubber gauntlets 😉 to work with) the current AppVeyor troubles? I have located the newer home for zziplib on Github (which downloads much more reliably) but although the source tarball for the 0.13.62 version is almost the same as the SF one (some extra ancillaries to do with MSVC and a symbian port) that I have changed to herein it is not building and even updating to the current version 0.13.68 is failing in the same manner with a:
Help! |
I have revised the new code to support italic and underline effects as well as bold. I have wired up changes originating locally to cause the title on the non-active tabs to become italicised and removed all colour changes. In both cases the tabs are also underlined which helps to draw attention to tabs showing either change. Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
I forgot to include the new TTabBar .cpp and .h in the project files for CMake - so the CI builds using it broke. Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
To see if more verbose messages help to explain what is going wrong. Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
|
I agree with #1589 (comment) |
Tweaks to try and get AppVeyor to work have been reverted (even if they may be wanted to be done in the future). Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
|
So, apart from the AppVeyor support changes that haven't worked (and which I have just reverted) is there anything wrong with this now? Actually - once the changes have been pushed out to a new class the changes in the existing code looks quite clean to me now - I guess I start to see the advantages to encapsulation/inheritance/what-have-you in C++ with dropping in a |
|
Yes - #1589 (comment) please 😃 |
|
vadi2 I'm not sure I understand - are you saying that it is not suitable as it is now because you think it is still too complicated? 😕 I think it is okay - there may be methods that are not currently used (some of the state getters) but together there is a complete set of getters and setters for three separate but related font effects (bold, italic and underline) that are based on tab index (how the underlying Qt methods do other aspects of individual tab configuration) and on tab text (i.e. context - which is more reliable when the texts are not changeable - which matches our current usage - but the tabs may be reordered by the user - which I got the idea was the case or was requested - ah, it is still the subject of recent issue #1456). Oh, as a side effect of increasing the tab text font size from 6 to 8, I think this PR will also address another recent issue and closes #1542 ! Edited so that GitHub will spot the linkage and auto-close the linked to issue when this is merged! It may be that not all local things that change the contents of the main console for a non-active profile are yet detected but that is one thing I am happy to fix later as things show up (it would likely just need an |
|
About using colours and differentiating local vs server changes - me & keneanung gravitate towards just bold, no colouring, and no differentiation. We can add the differentiation later on if people are keen but I don't think it's a feature that'll really be appreciated and adding colours is problematic for aesthetic reasons. |
This actually makes the TConsole code a tiny bit more complex as it has to filter whether to emit a SIGNAL depending on where the input to TConsole::printOnDisplay(...) comes from! I was also able to simplify the mudlet::slot_newDataOnHost(...) method because I had forgotten to use the methods to change the tab text formatting that identifies the tab by its text as an argument rather than an index number. (The same for(...) loop construct is used but it is hidden in the new TTabBar class...) Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
|
👍 will test |
Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
|
I had already taken out the colouration! I must confess bolding the tab text does not catch my eye so much as it might for some - but I have removed the underline (which did work for me). Ah - I may have miss-interpreted the removal of differentiation of the source of the change - so try this commit instead.... |
Following a discussion on Discord on the Help channel I realised that if more than one profile is open and Multi-View mode is not selected then any profile which is not the currently selected one will be hidden from view - and if any data comes in from the MUD server it will not be obvious to the user.
This commit turns the text on the tab of the "other" profile red when new data arrives - which is reset back to the standard colour when the user switches to that profile to see the new stuff.
Signed-off-by: Stephen Lyons slysven@virginmedia.com