Commit e2f5a26a authored by faenil's avatar faenil

[port] Now uses qtcomponents, added preliminary orientationLock support, qml code more robust

- Added PageStackWindow and Page elements to exploit qtcomponents' screen orientation support.
To do that part of QML code had to be modified a bit because many function calls assumed that the "window" element was in their scope, which has always been the case so far because it was the root QML item, but not anymore, now that the root item is a PageStackWindow, and "window" has been moved as a child of the initialPage.

- A new Orientation Lock setting has been added in Fingerterm's menu. It lets you choose between Auto, Portrait Lock and Landscape Lock (defaults to Auto).
parent f8573e52
......@@ -40,7 +40,7 @@ OTHER_FILES += \
qtc_packaging/debian_harmattan/compat \
qtc_packaging/debian_harmattan/changelog \
qml/Button.qml \
qml/Menu.qml \
qml/MenuFingerterm.qml \
qml/NotifyWin.qml \
qml/UrlWindow.qml \
qml/LayoutWindow.qml
......
......@@ -135,14 +135,16 @@ int main(int argc, char *argv[])
view.setSource(QUrl("qrc:/qml/Main.qml"));
QObject *win = view.rootObject();
if(!win)
QObject *root = view.rootObject();
if(!root)
qFatal("no root object - qml error");
QObject* win = root->findChild<QObject*>("window");
if(!startupErrorMsg.isEmpty())
QMetaObject::invokeMethod(win, "showErrorMessage", Qt::QueuedConnection, Q_ARG(QVariant, startupErrorMsg));
TextRender *tr = win->findChild<TextRender*>("textrender");
TextRender *tr = root->findChild<TextRender*>("textrender");
tr->setUtil(&util);
tr->setTerminal(&term);
term.setRenderer(tr);
......@@ -178,6 +180,8 @@ int main(int argc, char *argv[])
void defaultSettings(QSettings* settings)
{
if(!settings->contains("ui/orientationLockMode"))
settings->setValue("ui/orientationLockMode", "auto");
if(!settings->contains("general/execCmd"))
settings->setValue("general/execCmd", "");
if(!settings->contains("general/visualBell"))
......
......@@ -125,7 +125,7 @@ Rectangle {
key.color = keyboard.keyBgColor
setStickiness(-1)
vkbKeypress(currentCode, keyboard.keyModifiers);
window.vkbKeypress(currentCode, keyboard.keyModifiers);
if( !sticky && keyboard.resetSticky != 0 && keyboard.resetSticky !== key ) {
resetSticky.setStickiness(0);
......
......@@ -125,7 +125,7 @@ Rectangle {
to: "*"
SequentialAnimation {
PropertyAnimation { target: layoutWindow; properties: "y"; duration: 200; easing.type: Easing.InOutCubic }
ScriptAction { script: updateGesturesAllowed(); }
ScriptAction { script: window.updateGesturesAllowed(); }
}
}
]
......
This diff is collapsed.
......@@ -33,6 +33,7 @@ Rectangle {
property string currentSwipeLocking: util.settingsValue("ui/allowSwipe")
property string currentShowMethod: util.settingsValue("ui/vkbShowMethod")
property string currentDragMode: util.settingsValue("ui/dragMode")
property string currentOrientationLockMode: util.settingsValue("ui/orientationLockMode")
property int keyboardFadeOutDelay: util.settingsValue("ui/keyboardFadeOutDelay")
Rectangle {
......@@ -203,6 +204,56 @@ Rectangle {
}
}
}
Rectangle {
width: 180
height: 68
radius: 5
color: "#606060"
border.color: "#000000"
border.width: 1
Column {
Text {
width: 180
height: 20
color: "#ffffff"
font.pointSize: util.uiFontSize()-1;
text: "UI Orientation"
horizontalAlignment: Text.AlignHCenter
}
Row {
Button {
text: "<font size=\"-1\">Auto</font>"
highlighted: currentOrientationLockMode=="auto"
onClicked: {
currentOrientationLockMode = "auto";
window.setOrientationLockMode("auto");
}
width: 60
height: 48
}
Button {
text: "<font size=\"-1\">L<font>"
highlighted: currentOrientationLockMode=="landscape"
onClicked: {
currentOrientationLockMode = "landscape";
window.setOrientationLockMode("landscape");
}
width: 60
height: 48
}
Button {
text: "<font size=\"-1\">P</font>"
highlighted: currentOrientationLockMode=="portrait"
onClicked: {
currentOrientationLockMode = "portrait";
window.setOrientationLockMode("portrait");
}
width: 60
height: 48
}
}
}
}
Rectangle {
width: 180
height: 68
......@@ -281,7 +332,7 @@ Rectangle {
onClicked: {
util.setSettingsValue("ui/vkbShowMethod", "off");
currentShowMethod = "off";
setTextRenderAttributes();
window.setTextRenderAttributes();
hideMenu();
}
width: 60
......@@ -293,7 +344,7 @@ Rectangle {
onClicked: {
util.setSettingsValue("ui/vkbShowMethod", "fade");
currentShowMethod = "fade";
setTextRenderAttributes();
window.setTextRenderAttributes();
hideMenu();
}
width: 60
......@@ -305,7 +356,7 @@ Rectangle {
onClicked: {
util.setSettingsValue("ui/vkbShowMethod", "move");
currentShowMethod = "move";
setTextRenderAttributes();
window.setTextRenderAttributes();
hideMenu();
}
width: 60
......@@ -486,7 +537,7 @@ Rectangle {
visible = true;
fader.opacity = 0.5;
rect.x = menuWin.width-rect.width;
updateGesturesAllowed();
window.updateGesturesAllowed();
enableCopy = util.terminalHasSelection();
enablePaste = util.canPaste();
}
......@@ -496,7 +547,7 @@ Rectangle {
showing = false;
fader.opacity = 0;
rect.x = menuWin.width+1;
updateGesturesAllowed();
window.updateGesturesAllowed();
}
function changeSwipeLocking(state)
......
......@@ -88,7 +88,7 @@ Rectangle {
to: "*"
SequentialAnimation {
PropertyAnimation { target: notifyWin; properties: "y"; duration: 200; easing.type: Easing.InOutCubic }
ScriptAction { script: updateGesturesAllowed(); }
ScriptAction { script: window.updateGesturesAllowed(); }
}
}
]
......
......@@ -126,7 +126,7 @@ Rectangle {
to: "*"
SequentialAnimation {
PropertyAnimation { target: urlWindow; properties: "y"; duration: 200; easing.type: Easing.InOutCubic }
ScriptAction { script: updateGesturesAllowed(); }
ScriptAction { script: window.updateGesturesAllowed(); }
}
}
]
......
......@@ -5,7 +5,7 @@
<file>qml/Keyboard.qml</file>
<file>qml/Lineview.qml</file>
<file>qml/Button.qml</file>
<file>qml/Menu.qml</file>
<file>qml/MenuFingerterm.qml</file>
<file>qml/NotifyWin.qml</file>
<file>icons/backspace.png</file>
<file>icons/down.png</file>
......
......@@ -13,6 +13,7 @@ BuildRequires: pkgconfig(Qt5Qml)
BuildRequires: pkgconfig(Qt5Quick)
Requires: qt5-qtdeclarative-import-xmllistmodel
Requires: qt5-qtdeclarative-import-window2
Requires: qt-components-qt5
Obsoletes: meego-terminal <= 0.2.2
Provides: meego-terminal > 0.2.2
......
......@@ -177,7 +177,6 @@ void Terminal::putString(QString str, bool unEscape)
void Terminal::keyPress(int key, int modifiers)
{
QChar c(key);
//qDebug() << key;
resetBackBufferScrollPos();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment