mumble
mumble copied to clipboard
Allow a certified server's row background to be themed
See here - https://github.com/xPoke/MetroMumble/issues/8
The green bar on a server with a valid certificate (example) cannot be implemented in themes due to it being drawn before QSS is applied (either here or here, thanks mkrautz).
A theme would be able to implement it's own style on such a row if it would have a specific ID value, using setObjectName. It would then probably be possible to theme with QSS such as
QTreeView::item#certifiedServer {
background-color: yellow;
}
While doing this, it should also be possible to communicate other miscellaneous information to themes about items in the main treeview, such as if the row is a user or a room, is the user the local user, is the room empty/full, etc. This would allow such information to be given to the user with visual cues.
Does the same problem occur in the server browser? If so the workaround with the ID wouldn't work there I guess.
Yeah, it happens in the server browser too.
There's no restriction on several objects having the same objectName, so we could set the same name for all relevant objects. We should check if this even works though...
Ah. Cool. I assumed it would have to be unique but that doesn't seem to be the case. That should work then.
I looked some more into this and I don't think you can style tree view items as that doesn't seem to be supported by Qt. They aren't even QObject based. Also found a post stating that Qt support said it wasn't possible back in 2010 for what that's worth (http://qt-project.org/forums/viewthread/2243/#12301).
This wouldn't be hard to work-around if we could simply override the QSS styling with explicit commands (https://bugreports.qt.io/browse/QTBUG-28675). However that obviously doesn't work the way we do it now or we wouldn't have this issue in the first place and the background would already be green.
If we can figure out how to manually override the QSS styling my suggestion would be to add custom styling properties to the tree which one can use much like we did for the system palette.
EDIT: Added links EDIT: Another resource http://stackoverflow.com/questions/30170922/how-can-i-get-the-background-color-returned-by-model-take-precedence-over-the-st
I just noticed this while playing with 1.3.x. If the styling of the row is difficult, perhaps an icon could be added to the row (like user icons for muted, etc) to indicate the certificate validity? An obvious choice would be to follow the common convention of lock icons (perhaps also indicating when the certificate is only self-signed?). In my opinion the meaning of the icon would be clearer than just a green background.
This would also add a good opportunity to allow the user to hover or click the icon and show information about the TLS connection and certificate chain.
Has there been any progress on this issue?
No, not yet.
Not fixed. But restored the background color to be "shippable" for 1.3.0. Re-assigning to 1.4.0.