2
* Copyright 2015 Canonical Ltd.
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU Lesser General Public License as published by
6
* the Free Software Foundation; version 3.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU Lesser General Public License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
18
import "key_constants.js" as UI
22
property var actionKeyOverride: maliit_input_method.actionKeyOverride
23
property string overrideIconName: actionKeyOverride && actionKeyOverride.icon ? actionKeyOverride.icon : ""
24
property string overrideLabel: actionKeyOverride && actionKeyOverride.label ? actionKeyOverride.label : ""
26
enabled: actionKeyOverride ? actionKeyOverride.enabled : true
27
// overrideIcon has high priority over label
28
label: overrideIconName == "" ? overrideLabel : ""
29
// Scale the font so the label fits if a long word is set
30
fontSize: units.gu(UI.symbolShiftKeyFontSize) * (4 / (label.length >= 4 ? (label.length <= 6 ? label.length : 6) : 4));
33
iconNormal: (overrideIconName == "") && (overrideLabel == "") ? "keyboard-return" : overrideIconName
34
iconShifted: iconNormal
35
iconCapsLock: iconNormal
37
action: maliit_input_method.preedit != "" ? "commit" : "return"
38
switchBackFromSymbols: true
39
// TODO: input_method.actionKeyOverride.highlighted