Skip to content

Commit

Permalink
bugfix on layout switching
Browse files Browse the repository at this point in the history
  • Loading branch information
Park Shinjo committed Oct 25, 2014
1 parent 805a03c commit 91e24ad
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 71 deletions.
18 changes: 17 additions & 1 deletion rpm/jolla-input-ko.spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: dotdanbae
Version: 0.1
Version: 0.2
Release: 1%{?dist}
Summary: Korean layout and input method for Sailfish OS
License: GPLv2+
Expand Down Expand Up @@ -43,3 +43,19 @@ rm -rf %{buildroot}
/usr/share/maliit/plugins/com/jolla/layouts/ko_common/KoNaratgeulInputHandler.qml
/usr/share/maliit/plugins/com/jolla/layouts/ko_common/2set_handler.js
/usr/share/maliit/plugins/com/jolla/layouts/ko_common/naratgeul_handler.js

%changelog
* Sat Oct 25 2014 Park Shinjo <[email protected]> 0.1
- Fix layout switching bug.

* Wed Feb 19 2014 Park Shinjo <[email protected]> 0.1
- Added Naratgeul layout.
- Bumped version number and changed name.
- Fixed bug on trailing syllables in 2-set layout.

* Tue Jan 14 2014 Park Shinjo <[email protected]> 0.02
- Rewrite to use ohi instead of libhangul.
- Removes usage of any native code.

* Mon Jan 13 2014 Park Shinjo <[email protected]> 0.01
- Initial release based on libhangul.
2 changes: 2 additions & 0 deletions src/ko.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
[ko_2set.qml]
name=한글(두벌식)
languageCode=KO
handler=layouts/ko_common/KoInputHandler.qml

[ko_naratgeul.qml]
name=한글(나랏글)
languageCode=KO
handler=layouts/ko_common/KoNaratgeulInputHandler.qml
40 changes: 6 additions & 34 deletions src/ko_2set.qml
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,15 @@

import QtQuick 2.0
import Sailfish.Silica 1.0
import "ko_common"
import ".."

KeyboardLayout {
type: "korean"

KoInputHandler {
id: koInputHandler
}

Component.onCompleted: init()

Connections {
target: keyboard
onInputHandlerChanged: handlerChanged()
}

function init() {
// force onInputHandlerChanged signal by
// making sure that the input handler was not
// previously pasteInputHandler
if (keyboard.allowLayoutChanges) {
var oldHandler = keyboard.inputHandler
keyboard.inputHandler = xt9Handler.item
oldHandler.active = false
keyboard.inputHandler.active = true
}
}

function handlerChanged() {
if (keyboard.allowLayoutChanges && keyboard.inputHandler == pasteInputHandler &&
canvas.layoutRow.layout != null && canvas.layoutRow.layout.type == type) {
var oldHandler = keyboard.inputHandler
keyboard.inputHandler = koInputHandler
oldHandler.active = false
koInputHandler.active = true
}
// enables possibility to use own InputHandler,
// disables autocaps and text prediction
type: "custom"
Component.onCompleted: {
// disable autocaps
keyboard.autocaps = false
}

KeyboardRow {
Expand Down
44 changes: 8 additions & 36 deletions src/ko_naratgeul.qml
Original file line number Diff line number Diff line change
Expand Up @@ -3,48 +3,20 @@

import QtQuick 2.0
import Sailfish.Silica 1.0 as Silica
import "ko_common"
import ".."

KeyboardLayout {
id: main
portraitMode: true
width: geometry.keyboardWidthPortrait
height: 4 * geometry. keyHeightPortrait

type: "korean"

KoNaratgeulInputHandler {
id: koNaratgeulInputHandler
}

Component.onCompleted: init()

Connections {
target: keyboard
onInputHandlerChanged: handlerChanged()
}

function init() {
// force onInputHandlerChanged signal by
// making sure that the input handler was not
// previously pasteInputHandler
if (keyboard.allowLayoutChanges) {
var oldHandler = keyboard.inputHandler
keyboard.inputHandler = xt9Handler.item
oldHandler.active = false
keyboard.inputHandler.active = true
}
}

function handlerChanged() {
if (keyboard.allowLayoutChanges && keyboard.inputHandler == pasteInputHandler &&
canvas.layoutRow.layout != null && canvas.layoutRow.layout.type == type) {
var oldHandler = keyboard.inputHandler
keyboard.inputHandler = koNaratgeulInputHandler
oldHandler.active = false
koNaratgeulInputHandler.active = true
}
height: 4 * geometry.keyHeightPortrait

// enables possibility to use own InputHandler,
// disables autocaps and text prediction
type: "custom"
Component.onCompleted: {
// disable autocaps
keyboard.autocaps = false
}

KeyboardRow {
Expand Down

0 comments on commit 91e24ad

Please sign in to comment.