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
737679a8
Commit
737679a8
authored
Jan 16, 2014
by
SfietKonstantin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #21 from SfietKonstantin/page-transition
Page transition
parents
835988af
a5586200
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
176 additions
and
2 deletions
+176
-2
ApplicationWindow.qml
src/controls/ApplicationWindow.qml
+44
-0
nemotheme.cpp
src/styles/autogenerated/nemotheme.cpp
+13
-0
nemotheme.h
src/styles/autogenerated/nemotheme.h
+4
-0
nemothemepagestack.cpp
src/styles/autogenerated/nemothemepagestack.cpp
+50
-0
nemothemepagestack.h
src/styles/autogenerated/nemothemepagestack.h
+43
-0
qquicknemostyleextensionplugin.cpp
src/styles/qquicknemostyleextensionplugin.cpp
+1
-0
styles.pro
src/styles/styles.pro
+4
-2
ugly.json
src/styles/themes/ugly.json
+3
-0
components.json
tools/themehelper/components.json
+14
-0
No files found.
src/controls/ApplicationWindow.qml
View file @
737679a8
...
...
@@ -195,6 +195,50 @@ NemoWindow {
target
:
stackView
.
_isCurrentItemNemoPage
()
?
stackView
.
currentItem
:
null
onAllowedOrientationsChanged
:
root
.
orientationConstraintsChanged
()
}
delegate
:
StackViewDelegate
{
pushTransition
:
Component
{
StackViewTransition
{
PropertyAnimation
{
target
:
enterItem
property
:
"
x
"
from
:
target
.
width
to
:
0
duration
:
Theme
.
pageStack
.
transitionDuration
easing.type
:
Easing
.
OutQuad
}
PropertyAnimation
{
target
:
exitItem
property
:
"
x
"
from
:
0
to
:
-
target
.
width
duration
:
Theme
.
pageStack
.
transitionDuration
easing.type
:
Easing
.
OutQuad
}
}
}
popTransition
:
Component
{
StackViewTransition
{
PropertyAnimation
{
target
:
enterItem
property
:
"
x
"
from
:
-
target
.
width
to
:
0
duration
:
Theme
.
pageStack
.
transitionDuration
easing.type
:
Easing
.
OutQuad
}
PropertyAnimation
{
target
:
exitItem
property
:
"
x
"
from
:
0
to
:
target
.
width
duration
:
Theme
.
pageStack
.
transitionDuration
easing.type
:
Easing
.
OutQuad
}
}
}
}
}
Item
{
...
...
src/styles/autogenerated/nemotheme.cpp
View file @
737679a8
...
...
@@ -45,6 +45,7 @@ NemoTheme::NemoTheme(QObject *parent)
,
m_toolBar
(
new
NemoThemeToolBar
(
this
))
,
m_window
(
new
NemoThemeWindow
(
this
))
,
m_page
(
new
NemoThemePage
(
this
))
,
m_pageStack
(
new
NemoThemePageStack
(
this
))
,
m_spinner
(
new
NemoThemeSpinner
(
this
))
,
m_label
(
new
NemoThemeLabel
(
this
))
,
m_checkbox
(
new
NemoThemeCheckbox
(
this
))
...
...
@@ -120,6 +121,11 @@ NemoThemePage * NemoTheme::page() const
return
m_page
;
}
NemoThemePageStack
*
NemoTheme
::
pageStack
()
const
{
return
m_pageStack
;
}
NemoThemeSpinner
*
NemoTheme
::
spinner
()
const
{
return
m_spinner
;
...
...
@@ -396,6 +402,13 @@ void NemoTheme::loadFromFile(const QString &fileName)
}
else
{
m_page
->
dimmer
()
->
setEndPositionDefault
();
}
// Setting properties for pageStack
QJsonObject
stylesPageStack
=
styles
.
value
(
"pageStack"
).
toObject
();
if
(
stylesPageStack
.
contains
(
"transitionDuration"
))
{
m_pageStack
->
setTransitionDuration
(
jsonToInt
(
stylesPageStack
.
value
(
"transitionDuration"
),
defines
));
}
else
{
m_pageStack
->
setTransitionDurationDefault
();
}
// Setting properties for spinner
QJsonObject
stylesSpinner
=
styles
.
value
(
"spinner"
).
toObject
();
if
(
stylesSpinner
.
contains
(
"radius"
))
{
...
...
src/styles/autogenerated/nemotheme.h
View file @
737679a8
...
...
@@ -31,6 +31,7 @@
#include "nemothemetoolbar.h"
#include "nemothemewindow.h"
#include "nemothemepage.h"
#include "nemothemepagestack.h"
#include "nemothemespinner.h"
#include "nemothemelabel.h"
#include "nemothemecheckbox.h"
...
...
@@ -47,6 +48,7 @@ class NemoTheme: public QObject
Q_PROPERTY
(
NemoThemeToolBar
*
toolBar
READ
toolBar
CONSTANT
)
Q_PROPERTY
(
NemoThemeWindow
*
window
READ
window
CONSTANT
)
Q_PROPERTY
(
NemoThemePage
*
page
READ
page
CONSTANT
)
Q_PROPERTY
(
NemoThemePageStack
*
pageStack
READ
pageStack
CONSTANT
)
Q_PROPERTY
(
NemoThemeSpinner
*
spinner
READ
spinner
CONSTANT
)
Q_PROPERTY
(
NemoThemeLabel
*
label
READ
label
CONSTANT
)
Q_PROPERTY
(
NemoThemeCheckbox
*
checkbox
READ
checkbox
CONSTANT
)
...
...
@@ -64,6 +66,7 @@ public:
NemoThemeToolBar
*
toolBar
()
const
;
NemoThemeWindow
*
window
()
const
;
NemoThemePage
*
page
()
const
;
NemoThemePageStack
*
pageStack
()
const
;
NemoThemeSpinner
*
spinner
()
const
;
NemoThemeLabel
*
label
()
const
;
NemoThemeCheckbox
*
checkbox
()
const
;
...
...
@@ -83,6 +86,7 @@ private:
NemoThemeToolBar
*
m_toolBar
;
NemoThemeWindow
*
m_window
;
NemoThemePage
*
m_page
;
NemoThemePageStack
*
m_pageStack
;
NemoThemeSpinner
*
m_spinner
;
NemoThemeLabel
*
m_label
;
NemoThemeCheckbox
*
m_checkbox
;
...
...
src/styles/autogenerated/nemothemepagestack.cpp
0 → 100644
View file @
737679a8
/*
* Copyright (C) 2013 Lucien Xu <sfietkonstantin@free.fr>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
// This class is autogenerated using themehelper.py
// Any modification done in this file will be overridden
#include "nemothemepagestack.h"
NemoThemePageStack
::
NemoThemePageStack
(
QObject
*
parent
)
:
QObject
(
parent
)
,
m_transitionDuration
(
500
)
{
}
int
NemoThemePageStack
::
transitionDuration
()
const
{
return
m_transitionDuration
;
}
void
NemoThemePageStack
::
setTransitionDuration
(
int
transitionDuration
)
{
if
(
m_transitionDuration
!=
transitionDuration
)
{
m_transitionDuration
=
transitionDuration
;
emit
transitionDurationChanged
();
}
}
void
NemoThemePageStack
::
setTransitionDurationDefault
()
{
if
(
m_transitionDuration
!=
500
)
{
m_transitionDuration
=
500
;
emit
transitionDurationChanged
();
}
}
src/styles/autogenerated/nemothemepagestack.h
0 → 100644
View file @
737679a8
/*
* Copyright (C) 2013 Lucien Xu <sfietkonstantin@free.fr>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
// This class is autogenerated using themehelper.py
// Any modification done in this file will be overridden
#ifndef NEMOTHEMEPAGESTACK_H
#define NEMOTHEMEPAGESTACK_H
#include <QtCore/QObject>
class
NemoThemePageStack
:
public
QObject
{
Q_OBJECT
Q_PROPERTY
(
int
transitionDuration
READ
transitionDuration
NOTIFY
transitionDurationChanged
)
public:
explicit
NemoThemePageStack
(
QObject
*
parent
=
0
);
int
transitionDuration
()
const
;
void
setTransitionDuration
(
int
transitionDuration
);
void
setTransitionDurationDefault
();
Q_SIGNALS:
void
transitionDurationChanged
();
private:
int
m_transitionDuration
;
};
#endif //NEMOTHEMEPAGESTACK_H
src/styles/qquicknemostyleextensionplugin.cpp
View file @
737679a8
...
...
@@ -52,6 +52,7 @@ void QQuickNemoStyleExtensionPlugin::registerTypes(const char *uri)
qmlRegisterUncreatableType
<
NemoThemeSpinner
>
(
uri
,
1
,
0
,
"NemoThemeSpinner"
,
reason
);
qmlRegisterUncreatableType
<
NemoThemeLabel
>
(
uri
,
1
,
0
,
"NemoThemeLabel"
,
reason
);
qmlRegisterUncreatableType
<
NemoThemeCheckbox
>
(
uri
,
1
,
0
,
"NemoThemeCheckbox"
,
reason
);
qmlRegisterUncreatableType
<
NemoThemePageStack
>
(
uri
,
1
,
0
,
"NemoThemePageStack"
,
reason
);
qmlRegisterSingletonType
<
QObject
>
(
uri
,
1
,
0
,
"Theme"
,
nemo_theme_provider
);
...
...
src/styles/styles.pro
View file @
737679a8
...
...
@@ -86,7 +86,8 @@ HEADERS += \
autogenerated/nemothemepagedimmer.h \
autogenerated/nemothemespinner.h \
autogenerated/nemothemelabel.h \
autogenerated/nemothemecheckbox.h
autogenerated/nemothemecheckbox.h \
autogenerated/nemothemepagestack.h
SOURCES += \
qquicknemostyleextensionplugin.cpp \
...
...
@@ -103,7 +104,8 @@ SOURCES += \
autogenerated/nemothemepagedimmer.cpp \
autogenerated/nemothemespinner.cpp \
autogenerated/nemothemelabel.cpp \
autogenerated/nemothemecheckbox.cpp
autogenerated/nemothemecheckbox.cpp \
autogenerated/nemothemepagestack.cpp
INSTALLS += target images qmlfiles themes
...
...
src/styles/themes/ugly.json
View file @
737679a8
...
...
@@ -61,6 +61,9 @@
"checkbox"
:
{
"back1"
:
"#0091e5"
,
"back2"
:
"#313131"
},
"pageStack"
:
{
"transitionDuration"
:
1500
}
}
}
tools/themehelper/components.json
View file @
737679a8
...
...
@@ -233,6 +233,16 @@
"type"
:
"QColor"
}
]
},
{
"name"
:
"PageStack"
,
"properties"
:
[
{
"name"
:
"transitionDuration"
,
"type"
:
"int"
,
"default"
:
500
}
]
}
],
"properties"
:
[
...
...
@@ -264,6 +274,10 @@
"name"
:
"page"
,
"object"
:
"Page"
},
{
"name"
:
"pageStack"
,
"object"
:
"PageStack"
},
{
"name"
:
"spinner"
,
"object"
:
"Spinner"
...
...
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