-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
System lock improvements #26324
base: master
Are you sure you want to change the base?
System lock improvements #26324
Conversation
@@ -156,10 +156,10 @@ InspectorSectionView { | |||
|
|||
orientation: Qt.Horizontal | |||
icon: Boolean(model.allSystemsAreLocked) ? IconCode.LOCK_CLOSED : IconCode.LOCK_OPEN | |||
text: qsTrc("inspector", "Lock current system") | |||
text: qsTrc("inspector", "%1 selected %2".arg(Boolean(model.allSystemsAreLocked) ? "Unlock" : "Lock").arg(model.systemCount > 1 ? "systems" : "system")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lupdate
is too dumb for this; can only textually analyse the code, so does not understand that it should extract 2x2 strings from this.
One way would be to make each part separately translatable:
text: qsTrc("inspector", "%1 selected %2".arg(Boolean(model.allSystemsAreLocked) ? "Unlock" : "Lock").arg(model.systemCount > 1 ? "systems" : "system")) | |
text: qsTrc("inspector", "%1 selected %2").arg(Boolean(model.allSystemsAreLocked) ? qsTrc("inspector", "Unlock") : qsTrc("inspector", "Lock")).arg(model.systemCount > 1 ? qsTrc("inspector", "systems") : qsTrc("inspector", "system")) // not recommended |
But that is very ugly, and means the translators will have to translate 5 cryptical strings instead of 4 normal ones. So I'd just write them out in full; makes the code a bit longer, but that's okay.
text: qsTrc("inspector", "%1 selected %2".arg(Boolean(model.allSystemsAreLocked) ? "Unlock" : "Lock").arg(model.systemCount > 1 ? "systems" : "system")) | |
text: { | |
if (model.allSystemsAreLocked) { | |
return model.systemCount > 1 ? … : … | |
} else { | |
… |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I suspected that might have been the better way. Thanks 👍
It's possible, but would be a little bit cumbersome to implement. Also, are we sure we really want that? I'd think the tooltips stand out more when they don't have the same width as the button, increasing clarity. |
Functionality fixes & copy look great! Some requests below, and while I was testing I noticed two other issues that I logged separately. Newly logged issues
Shortcut function while system lock is selected
Tooltip width Could we hard-code the width of these two tooltips specifically to 276px to be the same as their buttons? It seems like their max width is already set to 300. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above comment
Changing the maximum width for some particular tooltips is actually the cumbersome bit. But it's doable; @mike-spa see |
@cbjeukendrup @mike-spa goes without saying, but the other stuff is more important than tooltip width so if it's a major pain we can save it for later. |
95e936e
to
06caad8
Compare
@avvvvve all done except the tooltip. It's a lot of work and it's just not worth it right now. |
Resolves: #26278
Resolves: #26273
Resolves: #25806
Resolves: #26336
Resolves: #26337
@avvvvve regarding this request
I don't think we do that anywhere else. In fact, I don't even know if it's possible to do that, given that tooltips by definition pop up above the UI and are not bound to it, see e.g.
But I'm also deeply QML-ignorant, so I may well be talking BS (@cbjeukendrup is the expert here).