Skip to content
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

Update to Qt5.9-5.12 #80

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/touch/touch.pro
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ qml.files += \

qml.path = /usr/share/glacier-components/qml/content

images.files = images/*.png
images.files += images/*.jpg
images.files = $$files(images/*.png,false)
images.files += $$files(images/*.jpg,false)
images.path = /usr/share/glacier-components/images

OTHER_FILES += $$qml.files
Expand Down
2 changes: 2 additions & 0 deletions rpm/qtquickcontrols-nemo.spec
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ desktop-file-install --delete-original \
%defattr(-,root,root,-)
%{_libdir}/qt5/qml/Nemo/Dialogs
%{_libdir}/qt5/qml/Nemo/UX/Models
%{_libdir}/qt5/qml/Nemo/Dialogs
%{_libdir}/qt5/qml/QtQuick/VirtualKeyboard/Styles/Nemo
%{_libdir}/qt5/qml/QtQuick/Controls/Nemo
%{_libdir}/qt5/qml/QtQuick/Controls/Styles/Nemo

Expand Down
4 changes: 2 additions & 2 deletions src/controls/controls.pro
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ SOURCES += \

target.path = $$[QT_INSTALL_QML]/$$PLUGIN_IMPORT_PATH

qmlfiles.files = $$_PRO_FILE_PWD_/qml/*.qml
qmlfiles.files = $$files($$_PRO_FILE_PWD_/qml/*.qml,false)
qmlfiles.files += $$_PRO_FILE_PWD_/qml/qmldir
qmlfiles.path = $$[QT_INSTALL_QML]/$$PLUGIN_IMPORT_PATH

dialogs.files = $$_PRO_FILE_PWD_/qml/dialogs/*.qml
dialogs.files = $$files($$_PRO_FILE_PWD_/qml/dialogs/*.qml,false)
dialogs.files += $$_PRO_FILE_PWD_/qml/dialogs/qmldir
dialogs.path = $$[QT_INSTALL_QML]/Nemo/Dialogs

Expand Down
2 changes: 1 addition & 1 deletion src/controls/editfilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

#include "editfilter.h"

class QVariant;
EditFilter::EditFilter(QObject *parent) : QObject(parent)
{

Expand Down
2 changes: 2 additions & 0 deletions src/controls/editfilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#include <QVariant>
#include "nemofocussingleton.h"

#include <QVariant>

class EditFilter : public QObject
{
Q_OBJECT
Expand Down
4 changes: 2 additions & 2 deletions src/controls/nemowindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ NemoWindow::NemoWindow(QWindow *parent) :
m_defaultAllowedOrientations(Qt::PortraitOrientation | Qt::LandscapeOrientation)
{
m_allowedOrientations = m_defaultAllowedOrientations;
m_filter = new EditFilter();
this->installEventFilter(m_filter);
//m_filter = new EditFilter();
//this->installEventFilter(m_filter);
}

Qt::ScreenOrientations NemoWindow::allowedOrientations() const
Expand Down
207 changes: 153 additions & 54 deletions src/controls/qml/ApplicationWindow.qml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import QtQuick.Layouts 1.0
import QtQuick.Controls.Private 1.0
import QtQuick.Controls.Nemo 1.0
import QtQuick.Controls.Styles.Nemo 1.0

import QtQuick.VirtualKeyboard 2.1
NemoWindow {
id: root

Expand All @@ -38,6 +38,7 @@ NemoWindow {
property alias initialPage: stackView.initialItem
property bool applicationActive: Qt.application.active

property alias inputPanel: inputPanel

property alias orientation: contentArea.uiOrientation
readonly property int isUiPortrait: orientation == Qt.PortraitOrientation || orientation == Qt.InvertedPortraitOrientation
Expand Down Expand Up @@ -191,9 +192,51 @@ NemoWindow {

Item {
id: backgroundItem
anchors.fill: parent
anchors.fill: parent
rotation: rotationToTransposeToPortrait()

Item {
id: inputClipping

z: 2

property bool panelVisible: inputPanel.active
onPanelVisibleChanged:{
if(!panelVisible) {
imShowAnimation.stop()
imHideAnimation.start()
}else {
imHideAnimation.stop()
imShowAnimation.to = inputPanel.height
imShowAnimation.start()
}
}

width:(isUiLandscape ? stackView.panelSize : parent.width)
height:(isUiPortrait ? stackView.panelSize : parent.height)
Item {
id:inputRotatingArea
rotation:contentArea.rotation
anchors.centerIn: parent
width:isUiPortrait ? backgroundItem.width : backgroundItem.height
height:isUiPortrait ? parent.height : stackView.panelSize //parent.width
readonly property real kbdDesignHeight: size.ratio(480)
InputPanel {
z:99
objectName: "inputpanel"
id: inputPanel
visible: stackView.panelSize > 0
anchors.left: parent.left
anchors.right: parent.right

Connections {
target: root
onIsUiPortraitChanged: inputPanel.keyboard.style.keyboardDesignHeight = root.isUiPortrait ? inputRotatingArea.kbdDesignHeight : root.width/2
}
}
}
}

Item {
id: clipping

Expand Down Expand Up @@ -236,25 +279,24 @@ NemoWindow {

property real panelSize: 0
property real previousImSize: 0
property real imSize: !root.applicationActive ? 0 : (isUiPortrait ? (root._transpose ? Qt.inputMethod.keyboardRectangle.width
: Qt.inputMethod.keyboardRectangle.height)
: (root._transpose ? Qt.inputMethod.keyboardRectangle.height
: Qt.inputMethod.keyboardRectangle.width))
property real imSize: !root.applicationActive ? 0 : Qt.inputMethod.keyboardRectangle.height

onImSizeChanged: {
if (imSize <= 0 && previousImSize > 0) {
imShowAnimation.stop()
imHideAnimation.start()
} else if (imSize > 0 && previousImSize <= 0) {
imHideAnimation.stop()
imShowAnimation.to = imSize
imShowAnimation.start()
} else {
panelSize = imSize
}
if(inputPanel.active) {
if (imSize <= 0 && previousImSize > 0) {
imShowAnimation.stop()
imHideAnimation.start()
} else if (imSize > 0 && previousImSize <= 0) {
imHideAnimation.stop()
imShowAnimation.to = imSize
imShowAnimation.start()
} else {
panelSize = imSize
}

previousImSize = imSize
previousImSize = imSize
}
}

clip: true
Component.onCompleted: {
stackInitialized = true
Expand Down Expand Up @@ -303,6 +345,12 @@ NemoWindow {
delegate: StackViewDelegate {
pushTransition: Component {
StackViewTransition {
ScriptAction {
script: {
imShowAnimation.stop()
imHideAnimation.start()
}
}
PropertyAnimation {
target: enterItem
property: "x"
Expand All @@ -323,6 +371,12 @@ NemoWindow {
}
popTransition: Component {
StackViewTransition {
ScriptAction {
script: {
imShowAnimation.stop()
imHideAnimation.start()
}
}
PropertyAnimation {
target: enterItem
property: "x"
Expand Down Expand Up @@ -374,33 +428,34 @@ NemoWindow {

//used to animate the dimmer when pages are pushed/popped (see Header's QML code)
property alias __dimmer: headerDimmerContainer
}

Item {
//This item handles the rotation of the dimmer.
//All this because QML doesn't have a horizontal gradient (unless you import GraphicalEffects)
//and having a container which doesn't rotate but just resizes makes it easier to rotate its inner
//child
id: headerDimmerContainer

//README: Don't use AnchorChanges for this item!
//Reason: state changes disable bindings while the transition from one state to another is running.
//This causes the dimmer not to follow the drawer when the drawer is closed right before the orientation change
anchors.top: isUiPortrait ? toolBar.bottom : parent.top
anchors.left: isUiPortrait ? parent.left : toolBar.right
anchors.right: isUiPortrait ? parent.right : undefined
anchors.bottom: isUiPortrait ? undefined : parent.bottom
//we only set the size in one orientation, the anchors will take care of the other
width: if (!isUiPortrait) Theme.itemHeightExtraSmall/2
height: if (isUiPortrait) Theme.itemHeightExtraSmall/2
//MAKE SURE THAT THE HEIGHT SPECIFIED BY THE THEME IS AN EVEN NUMBER, TO AVOID ROUNDING ERRORS IN THE LAYOUT

Rectangle {
id: headerDimmer
anchors.centerIn: parent
gradient: Gradient {
GradientStop { position: 0; color: Theme.backgroundColor }
GradientStop { position: 1; color: "transparent" }

Item {
//This item handles the rotation of the dimmer.
//All this because QML doesn't have a horizontal gradient (unless you import GraphicalEffects)
//and having a container which doesn't rotate but just resizes makes it easier to rotate its inner
//child
id: headerDimmerContainer

//README: Don't use AnchorChanges for this item!
//Reason: state changes disable bindings while the transition from one state to another is running.
//This causes the dimmer not to follow the drawer when the drawer is closed right before the orientation change
anchors.top: isUiPortrait ? toolBar.bottom : parent.top
anchors.left: isUiPortrait ? parent.left : toolBar.right
anchors.right: isUiPortrait ? parent.right : undefined
anchors.bottom: isUiPortrait ? undefined : parent.bottom
//we only set the size in one orientation, the anchors will take care of the other
width: if (!isUiPortrait) Theme.itemHeightExtraSmall/2
height: if (isUiPortrait) Theme.itemHeightExtraSmall/2
//MAKE SURE THAT THE HEIGHT SPECIFIED BY THE THEME IS AN EVEN NUMBER, TO AVOID ROUNDING ERRORS IN THE LAYOUT

Rectangle {
id: headerDimmer
anchors.centerIn: parent
gradient: Gradient {
GradientStop { position: 0; color: Theme.backgroundColor }
GradientStop { position: 1; color: "transparent" }
}
}
}
}
Expand Down Expand Up @@ -439,6 +494,13 @@ NemoWindow {
anchors.right: undefined
anchors.bottom: undefined
}
AnchorChanges {
target: inputClipping
anchors.top: clipping.bottom
anchors.left: parent.left
anchors.right: undefined
anchors.bottom: undefined
}
},
State {
name: 'Landscape'
Expand All @@ -464,6 +526,13 @@ NemoWindow {
anchors.right: parent.right
anchors.bottom: parent.bottom
}
AnchorChanges {
target: inputClipping
anchors.top: undefined
anchors.left: parent.left
anchors.right: undefined//clipping.left
anchors.bottom: parent.bottom
}
},
State {
name: 'PortraitInverted'
Expand All @@ -489,6 +558,13 @@ NemoWindow {
anchors.right: parent.right
anchors.bottom: parent.bottom
}
AnchorChanges {
target: inputClipping
anchors.top: undefined
anchors.left: undefined
anchors.right: clipping.right
anchors.bottom: clipping.top
}
},
State {
name: 'LandscapeInverted'
Expand All @@ -514,6 +590,13 @@ NemoWindow {
anchors.right: undefined
anchors.bottom: parent.bottom
}
AnchorChanges {
target: inputClipping
anchors.top: undefined
anchors.left: undefined//clipping.right
anchors.right: parent.right
anchors.bottom: parent.bottom
}
}
]

Expand All @@ -526,11 +609,19 @@ NemoWindow {
property: 'orientationTransitionRunning'
value: true
}
NumberAnimation {
target: contentArea
property: 'opacity'
to: 0
duration: 150
ParallelAnimation {
NumberAnimation {
target: contentArea
property: 'opacity'
to: 0
duration: 150
}
NumberAnimation {
target: inputPanel
property: 'opacity'
to: 0
duration: 150
}
}
PropertyAction {
target: contentArea
Expand All @@ -543,11 +634,19 @@ NemoWindow {
target: headerDimmer
properties: 'width,height,rotation'
}
NumberAnimation {
target: contentArea
property: 'opacity'
to: 1
duration: 150
ParallelAnimation {
NumberAnimation {
target: contentArea
property: 'opacity'
to: 1
duration: 150
}
NumberAnimation {
target: inputPanel
property: 'opacity'
to: 1
duration: 150
}
}
PropertyAction {
target: contentArea
Expand Down
1 change: 1 addition & 0 deletions src/controls/qml/ButtonRow.qml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
**
** Copyright (C) 2014 Aleksi Suomalainen <[email protected]>
** Copyright (C) 2017 Sergey Chupligin <[email protected]>
** Copyright (C) 2017 Eetu Kahelin
** All rights reserved.
**
** You may use this file under the terms of BSD license as follows:
Expand Down
Loading