-
Notifications
You must be signed in to change notification settings - Fork 13
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
Added a language layout switching button #14
Conversation
52df3c4
to
2d57f93
Compare
33a0d09
to
489e5db
Compare
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.
Thanks for your contribution, this is a great improvement. Some minor comments regarding code formatting. Also, I suggest squashing the two commits for a cleaner history.
src/qml/CsLayout.qml
Outdated
@@ -227,7 +227,12 @@ ColumnLayout { | |||
property real keyWeight: 154 | |||
|
|||
SymbolKey { | |||
weight: 217 | |||
weight: availableLanguageLayouts.length === 1? 217 : 108.5 |
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.
This code is not formatted! Also all the other layouts.
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.
@Johannes-bichler I think this one from
weight: availableLanguageLayouts.length === 1? 217 : 108.5
to
weight: availableLanguageLayouts.length === 1 ? 217 : 108.5
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.
@panicking I have used the QtCreator included QML Formatter and it worked exactly like you proposed. 😁
src/qml/InputPanel.qml
Outdated
@@ -135,6 +142,13 @@ Item { | |||
} | |||
} | |||
|
|||
Connections{ | |||
target: InputPanel | |||
onLanguageLayoutChanged:{ |
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.
Same: not formatted
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.
@Johannes-bichler from Connections{ to Connections {
src/qml/LanguageKey.qml
Outdated
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.
Same: not formatted
2d57f93
to
687738a
Compare
Added a button to switch language with an Icon and a property to set a list of available languages as StringList, same Format as languageLayout Reformatted code according to requested changes
687738a
to
ec7e7c5
Compare
Formatting has been completed and commits were squashed, everything should look fine now. |
@Johannes-bichler you can also use the QML formatter included in the Qt SDK! |
Hello,
This keyboard does support multiple layouts, but does not support switching between them at runtime.
For this purpose, I've implemented a button (LanguageKey), that switches between a List of Layouts that can be set via a property (availableLanguageLayouts) in InputPanel.
As this layout switching was added, the Greek Layout was changed to be similar to the others, as the internal layout switcher
(greek-latin) is no longer needed.
If this property is kept empty, it will be automatically set to En, but the property languageLayout overrides this.
If only one language is selected, the layout changer will not be visible.
If an invalid layout is added to the list property, it will fallback to "En".