Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Q
qtquickcontrols-nemo
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
NemoMobile
qtquickcontrols-nemo
Commits
aa7117d5
Unverified
Commit
aa7117d5
authored
Jul 26, 2018
by
Aleksi Suomalainen
Committed by
GitHub
Jul 26, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #68 from neochapay/master
Little fixes, remove some warnings, make pageStack frendly
parents
865503d5
c6fc74ed
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
125 additions
and
12 deletions
+125
-12
BrokenPage.qml
examples/touch/content/BrokenPage.qml
+5
-0
glacier-components.qml
examples/touch/glacier-components.qml
+10
-6
touch.pro
examples/touch/touch.pro
+1
-0
controls.pro
src/controls/controls.pro
+2
-1
editfilter.cpp
src/controls/editfilter.cpp
+1
-2
nemofocussingleton.h
src/controls/nemofocussingleton.h
+1
-1
ApplicationWindow.qml
src/controls/qml/ApplicationWindow.qml
+44
-0
ErrorStackPage.qml
src/controls/qml/ErrorStackPage.qml
+56
-0
HeaderToolsLayout.qml
src/controls/qml/HeaderToolsLayout.qml
+2
-2
qquickfilteringmousearea.cpp
src/controls/qquickfilteringmousearea.cpp
+2
-0
sizing.cpp
src/controls/sizing.cpp
+1
-0
No files found.
examples/touch/content/BrokenPage.qml
0 → 100644
View file @
aa7117d5
import
QtQuick
2.6
SomeBrokenPage
{
}
examples/touch/glacier-components.qml
View file @
aa7117d5
...
...
@@ -133,6 +133,10 @@ ApplicationWindow {
title
:
"
Notifications
"
page
:
"
content/NotificationsPage.qml
"
}
ListElement
{
title
:
"
Broken page
"
page
:
"
content/BrokenPage.qml
"
}
}
...
...
@@ -143,9 +147,9 @@ ApplicationWindow {
id
:
tools
title
:
"
Nemo Touch Gallery
"
tools
:
[
ToolButton
{
iconSource
:
"
/usr/share/glacier-components/images/icon_cog.pn
g
"
},
ToolButton
{
iconSource
:
"
/usr/share/glacier-components/images/icon_edit.png
"
},
ToolButton
{
iconSource
:
"
/usr/share/glacier-components/images/icon_refresh.png
"
}
]
tools
:
[
ToolButton
{
iconSource
:
"
image://theme/co
g
"
},
ToolButton
{
iconSource
:
"
image://theme/edit
"
},
ToolButton
{
iconSource
:
"
image://theme/refresh
"
}
]
//The parent of these items is null when this ToolsLayout is not used
//(i.e. you're on a different page) so we need to check the parent,
...
...
@@ -193,19 +197,19 @@ ApplicationWindow {
id
:
tool1
anchors.right
:
parent
.
right
anchors.verticalCenter
:
parent
.
verticalCenter
iconSource
:
"
/usr/share/glacier-components/images/icon_cog.pn
g
"
iconSource
:
"
image://theme/co
g
"
}
ToolButton
{
id
:
tool2
anchors.right
:
tool1
.
left
anchors.verticalCenter
:
parent
.
verticalCenter
iconSource
:
"
/usr/share/glacier-components/images/icon_edit.png
"
iconSource
:
"
image://theme/edit
"
}
ToolButton
{
id
:
tool3
anchors.right
:
tool2
.
left
anchors.verticalCenter
:
parent
.
verticalCenter
iconSource
:
"
/usr/share/glacier-components/images/icon_refresh.png
"
iconSource
:
"
image://theme/refresh
"
}
},
ButtonRow
{
...
...
examples/touch/touch.pro
View file @
aa7117d5
...
...
@@ -13,6 +13,7 @@ mainqml.path = /usr/share/glacier-components/qml
qml
.
files
+=
\
content
/
AndroidDelegate
.
qml
\
content
/
ButtonPage
.
qml
\
content
/
BrokenPage
.
qml
\
content
/
ProgressBarPage
.
qml
\
content
/
SliderPage
.
qml
\
content
/
TabBarPage
.
qml
\
...
...
src/controls/controls.pro
View file @
aa7117d5
...
...
@@ -27,8 +27,9 @@ QML_FILES += \
qml
/
DatePicker
.
qml
\
qml
/
TimePicker
.
qml
\
qml
/
ScrollDecorator
.
qml
\
qml
/
dialogs
/
QueryDialog
.
qml
\
qml
/
TextField
.
qml
\
qml
/
ErrorStackPage
.
qml
\
qml
/
dialogs
/
QueryDialog
.
qml
\
qml
/
dialogs
/
SelectionDialog
.
qml
\
qml
/
dialogs
/
Dialog
.
qml
...
...
src/controls/editfilter.cpp
View file @
aa7117d5
...
...
@@ -32,7 +32,6 @@ bool EditFilter::eventFilter(QObject *obj, QEvent *event)
nemoFocus
->
edit
()
->
setProperty
(
"focus"
,
QVariant
(
false
));
return
false
;
}
}
else
{
return
QObject
::
eventFilter
(
obj
,
event
);
}
return
QObject
::
eventFilter
(
obj
,
event
);
}
src/controls/nemofocussingleton.h
View file @
aa7117d5
...
...
@@ -35,7 +35,7 @@ public:
private:
QObject
*
m_edit
=
nullptr
;
NemoFocusSingleton
(
QObject
*
parent
=
nullptr
)
{}
NemoFocusSingleton
(
QObject
*
parent
=
nullptr
)
{
Q_UNUSED
(
parent
)
}
};
#endif // NEMOFOCUSSINGLETON_H
src/controls/qml/ApplicationWindow.qml
View file @
aa7117d5
...
...
@@ -66,6 +66,50 @@ NemoWindow {
}
}
//Safety version of pageStack.push - if we can't load component - show error page page with
//error message and back button
function
push
(
url
,
params
)
{
if
(
!
params
){
params
=
{}
}
console
.
log
(
"
##
"
,
url
,
params
,
pageStack
)
var
component
=
Qt
.
createComponent
(
url
)
if
(
component
.
status
===
Component
.
Ready
)
{
pageStack
.
push
(
component
.
createObject
(
pageStack
,
params
))
}
else
{
console
.
warn
(
"
Error loading component
"
,
url
,
component
.
errorString
())
pageStack
.
push
(
Qt
.
resolvedUrl
(
"
ErrorStackPage.qml
"
),
{
error
:
component
.
errorString
()})
}
}
Timer
{
id
:
_errorTimer
property
string
errorString
interval
:
50
repeat
:
false
onTriggered
:
{
pageStack
.
replace
(
Qt
.
resolvedUrl
(
"
ErrorStackPage.qml
"
),
{
error
:
errorString
})
errorString
=
""
}
}
Connections
{
target
:
pageStack
onBusyChanged
:
{
if
(
_errorTimer
.
errorString
&&
!
pageStack
.
busy
)
{
_errorTimer
.
start
()
}
}
onCurrentItemChanged
:
{
var
qmltype
=
pageStack
.
currentItem
.
toString
()
if
(
qmltype
.
slice
(
0
,
10
)
===
"
QQuickText
"
)
{
_errorTimer
.
errorString
=
pageStack
.
currentItem
.
text
}
}
}
function
orientationConstraintsChanged
()
{
//if the current orientation is not allowed anymore, fallback to an allowed one
...
...
src/controls/qml/ErrorStackPage.qml
0 → 100644
View file @
aa7117d5
/****************************************************************************************
**
** Copyright (C) 2018 Chupligin Sergey <neochapay@gmail.com>
** All rights reserved.
**
** You may use this file under the terms of BSD license as follows:
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in the
** documentation and/or other materials provided with the distribution.
** * Neither the name of the author nor the
** names of its contributors may be used to endorse or promote products
** derived from this software without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR
** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**
****************************************************************************************/
import
QtQuick
2.6
import
QtQuick
.
Controls
.
Styles
.
Nemo
1.0
Page
{
id
:
root
property
alias
error
:
errorLabel
.
text
headerTools
:
HeaderToolsLayout
{
showBackButton
:
true
;
title
:
qsTr
(
"
Error
"
)
}
Column
{
spacing
:
40
width
:
parent
.
width
anchors.centerIn
:
parent
Label
{
id
:
errorLabel
width
:
parent
.
width
text
:
qsTr
(
"
We got some error
"
)
wrapMode
:
Text
.
WrapAtWordBoundaryOrAnywhere
}
}
}
src/controls/qml/HeaderToolsLayout.qml
View file @
aa7117d5
...
...
@@ -46,7 +46,7 @@ Item {
fillMode
:
Image
.
PreserveAspectFit
sourceSize.width
:
width
sourceSize.height
:
height
source
:
"
/usr/lib/qt5/qml/QtQuick/Controls/Styles/Nemo/images/icon-triangle-left.png
"
source
:
"
image://theme/chevron-left
"
}
MouseArea
{
...
...
@@ -122,7 +122,7 @@ Item {
height
:
toolMeasure
sourceSize.height
:
height
visible
:
drawerLevels
&&
drawerLevels
.
length
>
1
source
:
"
/usr/lib/qt5/qml/QtQuick/Controls/Styles/Nemo/images/dots-vertical.png
"
source
:
"
image://theme/ellipsis-v
"
rotation
:
isUiPortrait
?
0
:
90
}
}
src/controls/qquickfilteringmousearea.cpp
View file @
aa7117d5
...
...
@@ -75,6 +75,8 @@ void QQuickFilteringMouseArea::mouseReleaseEvent(QMouseEvent *event) {
}
bool
QQuickFilteringMouseArea
::
sendMouseEvent
(
QQuickItem
*
item
,
QMouseEvent
*
event
)
{
Q_UNUSED
(
item
);
QPointF
localPos
=
mapFromScene
(
event
->
windowPos
());
QQuickWindow
*
c
=
window
();
QQuickItem
*
grabber
=
c
?
c
->
mouseGrabberItem
()
:
0
;
...
...
src/controls/sizing.cpp
View file @
aa7117d5
...
...
@@ -15,6 +15,7 @@ Sizing::Sizing(QObject *parent) : QObject(parent)
qreal
refHeight
=
854.
;
//N9
qreal
refWidth
=
480.
;
//N9
qreal
refDpi
=
251
;
//N9
Q_UNUSED
(
refDpi
);
m_p_height
=
qgetenv
(
"QT_QPA_EGLFS_PHYSICAL_HEIGHT"
).
toInt
();
m_p_width
=
qgetenv
(
"QT_QPA_EGLFS_PHYSICAL_WIDTH"
).
toInt
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment