Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

Commit

Permalink
change symoji's behavior when there is only one layout
Browse files Browse the repository at this point in the history
  • Loading branch information
Fuseteam committed Apr 6, 2021
1 parent 9265e14 commit 12967c0
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions qml/keys/SymojiKey.qml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ import "key_constants.js" as UI

FlickActionKey {
id: symojiKey
property bool standard: (maliit_input_method.previousLanguage && panel.state == "CHARACTERS" && state == "signs") ? true : false
property bool stdsingle: (!maliit_input_method.previousLanguage && panel.state == "CHARACTERS" && state == "signs") ? true : false
charlabel: (state == "marks") ? ["", "", "a!", "", ""] : (panel.state == "CHARACTERS") ? ["", "", "ä‽", "", "īø"] : ["", "", "", "", "a!"]
leaves: (state == "marks") ? ["", "", "a!", "", ""] : (panel.state == "CHARACTERS") ? ["", "", "ä‽", "", "īø"] : ["", "", "", "", "a!"]
iconNormal: (state == "marks") ? ["settings", "", "", "", ""] : panel.state == "CHARACTERS" ? ["language-chooser", "", "", "", ""] : ["navigation-menu", "", "", "", ""]
iconNormalSource: ["", "", "", "../images/happy.svg", ""]
leaves: charlabel
iconNormal: stdsingle? ["", "", "", "settings", ""]: ["language-chooser", "", "", "navigation-menu", ""]
iconNormalSource: standard ? ["", "", "", "happy.svg", ""] : maliit_input_method.previousLanguage ?["", "", "", "", ""]:["happy.svg", "", "", "", ""]
iconAngles:["","","","","180"]
iconDisabled: ["", "", "keyboard-caps-locked", "", "keyboard-caps-locked"]
shiftedlabel: charlabel
Expand Down Expand Up @@ -59,23 +61,23 @@ FlickActionKey {

onReleased: {
if (index == 0) {
if(state == "marks") {
Qt.openUrlExternally("settings:///system/language");
maliit_input_method.hide();
} else if (maliit_input_method.previousLanguage && maliit_input_method.previousLanguage != maliit_input_method.activeLanguage && panel.state == "CHARACTERS") {
if(maliit_input_method.previousLanguage == "emoji")
canvas.languageMenuShown = true;
else
if (maliit_input_method.previousLanguage && maliit_input_method.previousLanguage != maliit_input_method.activeLanguage && panel.state == "CHARACTERS") {
maliit_input_method.activeLanguage = maliit_input_method.previousLanguage;
} else {
canvas.languageMenuShown = true;
panel.state = "EMOJI";
}
} else if (index == 2) {
panel.state = (state == "marks") ? "CHARACTERS" : "ACCENTS";
state = (state == "marks") ? "signs" : "marks";
} else if (index == 3) {
//panel.state = (panel.state != "EMOJI") ? "EMOJI" : "CHARACTERS";
maliit_input_method.activeLanguage = "emoji";
if(standard)
panel.state = "EMOJI";
else if(panel.state == "CHARACTERS" && state == "signs"){
Qt.openUrlExternally("settings:///system/language")
maliit_input_method.hide();
}else {
canvas.languageMenuShown = true;
}
} else if (index == 4) {
if(panel.state == "ACCENTS" && state =="signs") panel.state = "CHARACTERS";
else state="marks";
Expand Down

0 comments on commit 12967c0

Please sign in to comment.