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
aed0a925
Commit
aed0a925
authored
Dec 04, 2013
by
Simonas Leleiva
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #13 from locusf/label
[label] Label with example page.
parents
b4d6b34c
c6d70475
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
223 additions
and
6 deletions
+223
-6
LabelPage.qml
examples/touch/content/LabelPage.qml
+50
-0
main.qml
examples/touch/main.qml
+4
-0
resources.qrc
examples/touch/resources.qrc
+1
-0
touch.pro
examples/touch/touch.pro
+2
-1
Label.qml
src/controls/Label.qml
+38
-0
controls.pro
src/controls/controls.pro
+2
-1
qmldir
src/controls/qmldir
+2
-1
nemotheme.cpp
src/styles/autogenerated/nemotheme.cpp
+11
-0
nemotheme.h
src/styles/autogenerated/nemotheme.h
+4
-0
nemothemelabel.cpp
src/styles/autogenerated/nemothemelabel.cpp
+42
-0
nemothemelabel.h
src/styles/autogenerated/nemothemelabel.h
+43
-0
qquicknemostyleextensionplugin.cpp
src/styles/qquicknemostyleextensionplugin.cpp
+1
-0
styles.pro
src/styles/styles.pro
+6
-3
glacier.json
src/styles/themes/glacier.json
+3
-0
components.json
tools/themehelper/components.json
+14
-0
No files found.
examples/touch/content/LabelPage.qml
0 → 100644
View file @
aed0a925
/****************************************************************************************
**
** Copyright (C) 2013 Aleksi Suomalainen <suomalainen.aleksi@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.1
import
QtQuick
.
Controls
1.0
//needed for the Stack attached property
import
QtQuick
.
Controls
.
Nemo
1.0
import
QtQuick
.
Controls
.
Styles
.
Nemo
1.0
Page
{
id
:
root
tools
:
ToolBarLayoutExample
{
title
:
"
Label
"
}
Column
{
spacing
:
40
anchors.centerIn
:
parent
Label
{
text
:
"
Test label
"
color
:
"
white
"
}
}
}
examples/touch/main.qml
View file @
aed0a925
...
@@ -91,6 +91,10 @@ ApplicationWindow {
...
@@ -91,6 +91,10 @@ ApplicationWindow {
title
:
"
Spinner
"
title
:
"
Spinner
"
page
:
"
content/SpinnerPage.qml
"
page
:
"
content/SpinnerPage.qml
"
}
}
ListElement
{
title
:
"
Labels
"
page
:
"
content/LabelPage.qml
"
}
}
}
...
...
examples/touch/resources.qrc
View file @
aed0a925
...
@@ -18,5 +18,6 @@
...
@@ -18,5 +18,6 @@
<file>content/LiveCoding.qml</file>
<file>content/LiveCoding.qml</file>
<file>content/ToolBarLayoutExample.qml</file>
<file>content/ToolBarLayoutExample.qml</file>
<file>content/SpinnerPage.qml</file>
<file>content/SpinnerPage.qml</file>
<file>content/LabelPage.qml</file>
</qresource>
</qresource>
</RCC>
</RCC>
examples/touch/touch.pro
View file @
aed0a925
...
@@ -19,7 +19,8 @@ OTHER_FILES += \
...
@@ -19,7 +19,8 @@ OTHER_FILES += \
content
/
TextInputPage
.
qml
\
content
/
TextInputPage
.
qml
\
content
/
LiveCoding
.
qml
\
content
/
LiveCoding
.
qml
\
content
/
ToolBarLayoutExample
.
qml
\
content
/
ToolBarLayoutExample
.
qml
\
content
/
SpinnerPage
.
qml
content
/
SpinnerPage
.
qml
\
content
/
LabelPage
.
qml
RESOURCES
+=
\
RESOURCES
+=
\
resources
.
qrc
resources
.
qrc
...
...
src/controls/Label.qml
0 → 100644
View file @
aed0a925
/****************************************************************************************
**
** Copyright (C) 2013 Aleksi Suomalainen <suomalainen.aleksi@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.1
import
QtQuick
.
Controls
.
Styles
.
Nemo
1.0
Text
{
renderType
:
Text
.
NativeRendering
font.family
:
Theme
.
fontFamily
color
:
Theme
.
label
.
color
}
src/controls/controls.pro
View file @
aed0a925
...
@@ -10,7 +10,8 @@ QML_FILES += \
...
@@ -10,7 +10,8 @@ QML_FILES += \
Button
.
qml
\
Button
.
qml
\
ApplicationWindow
.
qml
\
ApplicationWindow
.
qml
\
Page
.
qml
\
Page
.
qml
\
Spinner
.
qml
Spinner
.
qml
\
Label
.
qml
OTHER_FILES
+=
qmldir
\
OTHER_FILES
+=
qmldir
\
$$
QML_FILES
$$
QML_FILES
...
...
src/controls/qmldir
View file @
aed0a925
...
@@ -12,6 +12,7 @@ Button 1.0 Button.qml
...
@@ -12,6 +12,7 @@ Button 1.0 Button.qml
ApplicationWindow 1.0 ApplicationWindow.qml
ApplicationWindow 1.0 ApplicationWindow.qml
Page 1.0 Page.qml
Page 1.0 Page.qml
Spinner 1.0 Spinner.qml
Spinner 1.0 Spinner.qml
Label 1.0 Label.qml
# MIRRORED CONTROLS:
# MIRRORED CONTROLS:
# These are the controls that we take directly from official QQC.
# These are the controls that we take directly from official QQC.
...
@@ -25,7 +26,7 @@ Spinner 1.0 Spinner.qml
...
@@ -25,7 +26,7 @@ Spinner 1.0 Spinner.qml
CheckBox 1.0 ../CheckBox.qml
CheckBox 1.0 ../CheckBox.qml
ComboBox 1.0 ../ComboBox.qml
ComboBox 1.0 ../ComboBox.qml
GroupBox 1.0 ../GroupBox.qml
GroupBox 1.0 ../GroupBox.qml
Label 1.0 ../Label.qml
MenuBar 1.0 ../MenuBar.qml
MenuBar 1.0 ../MenuBar.qml
Menu 1.0 ../Menu.qml
Menu 1.0 ../Menu.qml
StackView 1.0 ../StackView.qml
StackView 1.0 ../StackView.qml
...
...
src/styles/autogenerated/nemotheme.cpp
View file @
aed0a925
...
@@ -46,6 +46,7 @@ NemoTheme::NemoTheme(QObject *parent)
...
@@ -46,6 +46,7 @@ NemoTheme::NemoTheme(QObject *parent)
,
m_window
(
new
NemoThemeWindow
(
this
))
,
m_window
(
new
NemoThemeWindow
(
this
))
,
m_page
(
new
NemoThemePage
(
this
))
,
m_page
(
new
NemoThemePage
(
this
))
,
m_spinner
(
new
NemoThemeSpinner
(
this
))
,
m_spinner
(
new
NemoThemeSpinner
(
this
))
,
m_label
(
new
NemoThemeLabel
(
this
))
{
{
loadFromFile
(
GLACIER_THEME
);
loadFromFile
(
GLACIER_THEME
);
int
id
=
QFontDatabase
::
addApplicationFont
(
"/usr/share/fonts/google-opensans/OpenSans-Regular.ttf"
);
int
id
=
QFontDatabase
::
addApplicationFont
(
"/usr/share/fonts/google-opensans/OpenSans-Regular.ttf"
);
...
@@ -123,6 +124,11 @@ NemoThemeSpinner * NemoTheme::spinner() const
...
@@ -123,6 +124,11 @@ NemoThemeSpinner * NemoTheme::spinner() const
return
m_spinner
;
return
m_spinner
;
}
}
NemoThemeLabel
*
NemoTheme
::
label
()
const
{
return
m_label
;
}
QString
NemoTheme
::
fontFamily
()
const
QString
NemoTheme
::
fontFamily
()
const
{
{
return
m_fontFamily
;
return
m_fontFamily
;
...
@@ -368,4 +374,9 @@ void NemoTheme::loadFromFile(const QString &fileName)
...
@@ -368,4 +374,9 @@ void NemoTheme::loadFromFile(const QString &fileName)
if
(
stylesSpinner
.
contains
(
"transitionDuration"
))
{
if
(
stylesSpinner
.
contains
(
"transitionDuration"
))
{
m_spinner
->
setTransitionDuration
(
jsonToInt
(
styles
.
value
(
"spinner"
),
defines
));
m_spinner
->
setTransitionDuration
(
jsonToInt
(
styles
.
value
(
"spinner"
),
defines
));
}
}
// Setting properties for label
QJsonObject
stylesLabel
=
styles
.
value
(
"label"
).
toObject
();
if
(
stylesLabel
.
contains
(
"color"
))
{
m_label
->
setColor
(
jsonToColor
(
styles
.
value
(
"label"
),
defines
));
}
}
}
src/styles/autogenerated/nemotheme.h
View file @
aed0a925
...
@@ -32,6 +32,7 @@
...
@@ -32,6 +32,7 @@
#include "nemothemewindow.h"
#include "nemothemewindow.h"
#include "nemothemepage.h"
#include "nemothemepage.h"
#include "nemothemespinner.h"
#include "nemothemespinner.h"
#include "nemothemelabel.h"
class
NemoTheme
:
public
QObject
class
NemoTheme
:
public
QObject
{
{
...
@@ -46,6 +47,7 @@ class NemoTheme: public QObject
...
@@ -46,6 +47,7 @@ class NemoTheme: public QObject
Q_PROPERTY
(
NemoThemeWindow
*
window
READ
window
CONSTANT
)
Q_PROPERTY
(
NemoThemeWindow
*
window
READ
window
CONSTANT
)
Q_PROPERTY
(
NemoThemePage
*
page
READ
page
CONSTANT
)
Q_PROPERTY
(
NemoThemePage
*
page
READ
page
CONSTANT
)
Q_PROPERTY
(
NemoThemeSpinner
*
spinner
READ
spinner
CONSTANT
)
Q_PROPERTY
(
NemoThemeSpinner
*
spinner
READ
spinner
CONSTANT
)
Q_PROPERTY
(
NemoThemeLabel
*
label
READ
label
CONSTANT
)
Q_PROPERTY
(
QString
fontFamily
READ
fontFamily
CONSTANT
)
Q_PROPERTY
(
QString
fontFamily
READ
fontFamily
CONSTANT
)
public:
public:
explicit
NemoTheme
(
QObject
*
parent
=
0
);
explicit
NemoTheme
(
QObject
*
parent
=
0
);
...
@@ -61,6 +63,7 @@ public:
...
@@ -61,6 +63,7 @@ public:
NemoThemeWindow
*
window
()
const
;
NemoThemeWindow
*
window
()
const
;
NemoThemePage
*
page
()
const
;
NemoThemePage
*
page
()
const
;
NemoThemeSpinner
*
spinner
()
const
;
NemoThemeSpinner
*
spinner
()
const
;
NemoThemeLabel
*
label
()
const
;
QString
fontFamily
()
const
;
QString
fontFamily
()
const
;
public
Q_SLOTS
:
public
Q_SLOTS
:
void
loadFromFile
(
const
QString
&
fileName
);
void
loadFromFile
(
const
QString
&
fileName
);
...
@@ -78,6 +81,7 @@ private:
...
@@ -78,6 +81,7 @@ private:
NemoThemeWindow
*
m_window
;
NemoThemeWindow
*
m_window
;
NemoThemePage
*
m_page
;
NemoThemePage
*
m_page
;
NemoThemeSpinner
*
m_spinner
;
NemoThemeSpinner
*
m_spinner
;
NemoThemeLabel
*
m_label
;
QString
m_fontFamily
;
QString
m_fontFamily
;
};
};
...
...
src/styles/autogenerated/nemothemelabel.cpp
0 → 100644
View file @
aed0a925
/*
* 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 "nemothemelabel.h"
NemoThemeLabel
::
NemoThemeLabel
(
QObject
*
parent
)
:
QObject
(
parent
)
,
m_color
(
"white"
)
{
}
QColor
NemoThemeLabel
::
color
()
const
{
return
m_color
;
}
void
NemoThemeLabel
::
setColor
(
const
QColor
&
color
)
{
if
(
m_color
!=
color
)
{
m_color
=
color
;
emit
colorChanged
();
}
}
src/styles/autogenerated/nemothemelabel.h
0 → 100644
View file @
aed0a925
/*
* 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 NEMOTHEMELABEL_H
#define NEMOTHEMELABEL_H
#include <QtCore/QObject>
#include <QtGui/QColor>
class
NemoThemeLabel
:
public
QObject
{
Q_OBJECT
Q_PROPERTY
(
QColor
color
READ
color
NOTIFY
colorChanged
)
public:
explicit
NemoThemeLabel
(
QObject
*
parent
=
0
);
QColor
color
()
const
;
void
setColor
(
const
QColor
&
color
);
Q_SIGNALS:
void
colorChanged
();
private:
QColor
m_color
;
};
#endif //NEMOTHEMELABEL_H
src/styles/qquicknemostyleextensionplugin.cpp
View file @
aed0a925
...
@@ -50,6 +50,7 @@ void QQuickNemoStyleExtensionPlugin::registerTypes(const char *uri)
...
@@ -50,6 +50,7 @@ void QQuickNemoStyleExtensionPlugin::registerTypes(const char *uri)
qmlRegisterUncreatableType
<
NemoThemePage
>
(
uri
,
1
,
0
,
"NemoThemePage"
,
reason
);
qmlRegisterUncreatableType
<
NemoThemePage
>
(
uri
,
1
,
0
,
"NemoThemePage"
,
reason
);
qmlRegisterUncreatableType
<
NemoThemePageDimmer
>
(
uri
,
1
,
0
,
"NemoThemePageDimmer"
,
reason
);
qmlRegisterUncreatableType
<
NemoThemePageDimmer
>
(
uri
,
1
,
0
,
"NemoThemePageDimmer"
,
reason
);
qmlRegisterUncreatableType
<
NemoThemeSpinner
>
(
uri
,
1
,
0
,
"NemoThemeSpinner"
,
reason
);
qmlRegisterUncreatableType
<
NemoThemeSpinner
>
(
uri
,
1
,
0
,
"NemoThemeSpinner"
,
reason
);
qmlRegisterUncreatableType
<
NemoThemeLabel
>
(
uri
,
1
,
0
,
"NemoThemeLabel"
,
reason
);
qmlRegisterSingletonType
<
QObject
>
(
uri
,
1
,
0
,
"Theme"
,
nemo_theme_provider
);
qmlRegisterSingletonType
<
QObject
>
(
uri
,
1
,
0
,
"Theme"
,
nemo_theme_provider
);
...
...
src/styles/styles.pro
View file @
aed0a925
...
@@ -26,7 +26,8 @@ QML_FILES = \
...
@@ -26,7 +26,8 @@ QML_FILES = \
TabViewStyle
.
qml
\
TabViewStyle
.
qml
\
TextFieldStyle
.
qml
\
TextFieldStyle
.
qml
\
ToolBarStyle
.
qml
\
ToolBarStyle
.
qml
\
ToolButtonStyle
.
qml
ToolButtonStyle
.
qml
\
LabelStyle
.
qml
#
Images
#
Images
#
QML_FILES
+=
\
#
QML_FILES
+=
\
...
@@ -89,7 +90,8 @@ HEADERS += \
...
@@ -89,7 +90,8 @@ HEADERS += \
autogenerated/nemothemewindow.h \
autogenerated/nemothemewindow.h \
autogenerated/nemothemepage.h \
autogenerated/nemothemepage.h \
autogenerated/nemothemepagedimmer.h \
autogenerated/nemothemepagedimmer.h \
autogenerated/nemothemespinner.h
autogenerated/nemothemespinner.h \
autogenerated/nemothemelabel.h
SOURCES += \
SOURCES += \
qquicknemostyleextensionplugin.cpp \
qquicknemostyleextensionplugin.cpp \
...
@@ -104,7 +106,8 @@ SOURCES += \
...
@@ -104,7 +106,8 @@ SOURCES += \
autogenerated/nemothemewindow.cpp \
autogenerated/nemothemewindow.cpp \
autogenerated/nemothemepage.cpp \
autogenerated/nemothemepage.cpp \
autogenerated/nemothemepagedimmer.cpp \
autogenerated/nemothemepagedimmer.cpp \
autogenerated/nemothemespinner.cpp
autogenerated/nemothemespinner.cpp \
autogenerated/nemothemelabel.cpp
INSTALLS += target images qmlfiles themes
INSTALLS += target images qmlfiles themes
...
...
src/styles/themes/glacier.json
View file @
aed0a925
...
@@ -54,6 +54,9 @@
...
@@ -54,6 +54,9 @@
"spinner"
:
{
"spinner"
:
{
"primaryColor"
:
"#ffffff"
,
"primaryColor"
:
"#ffffff"
,
"secondaryColor"
:
"#0091e5"
"secondaryColor"
:
"#0091e5"
},
"label"
:
{
"color"
:
"white"
}
}
}
}
}
}
tools/themehelper/components.json
View file @
aed0a925
...
@@ -201,6 +201,16 @@
...
@@ -201,6 +201,16 @@
"default"
:
500
"default"
:
500
}
}
]
]
},
{
"name"
:
"Label"
,
"properties"
:
[
{
"name"
:
"color"
,
"type"
:
"QColor"
,
"default"
:
"white"
}
]
}
}
],
],
"properties"
:
[
"properties"
:
[
...
@@ -235,6 +245,10 @@
...
@@ -235,6 +245,10 @@
{
{
"name"
:
"spinner"
,
"name"
:
"spinner"
,
"object"
:
"Spinner"
"object"
:
"Spinner"
},
{
"name"
:
"label"
,
"object"
:
"Label"
}
}
],
],
"font"
:
"/usr/share/fonts/google-opensans/OpenSans-Regular.ttf"
"font"
:
"/usr/share/fonts/google-opensans/OpenSans-Regular.ttf"
...
...
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