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
94f6ec9f
Commit
94f6ec9f
authored
Oct 09, 2013
by
Andrea Bernabei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[styling] Add ToolBarStyle and its corresponding theme object
parent
23a2d156
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
135 additions
and
7 deletions
+135
-7
main.qml
examples/touch/main.qml
+1
-3
ToolBarStyle.qml
src/styles/ToolBarStyle.qml
+16
-2
nemotheme.cpp
src/styles/autogenerated/nemotheme.cpp
+9
-0
nemotheme.h
src/styles/autogenerated/nemotheme.h
+4
-0
nemothemetoolbar.cpp
src/styles/autogenerated/nemothemetoolbar.cpp
+41
-0
nemothemetoolbar.h
src/styles/autogenerated/nemothemetoolbar.h
+43
-0
qquicknemostyleextensionplugin.cpp
src/styles/qquicknemostyleextensionplugin.cpp
+1
-0
styles.pro
src/styles/styles.pro
+4
-2
glacier.json
src/styles/themes/glacier.json
+3
-0
components.json
tools/themehelper/components.json
+13
-0
No files found.
examples/touch/main.qml
View file @
94f6ec9f
...
@@ -64,9 +64,7 @@ ApplicationWindow {
...
@@ -64,9 +64,7 @@ ApplicationWindow {
}
}
}
}
toolBar
:
BorderImage
{
toolBar
:
ToolBar
{
border.bottom
:
8
source
:
"
images/toolbar.png
"
width
:
parent
.
width
width
:
parent
.
width
height
:
100
height
:
100
...
...
src/styles/ToolBarStyle.qml
View file @
94f6ec9f
...
@@ -18,7 +18,21 @@
...
@@ -18,7 +18,21 @@
*/
*/
import
QtQuick
2.1
import
QtQuick
2.1
import
QtQuick
.
Controls
.
Styles
.
Private
1.0
import
QtQuick
.
Controls
.
Private
1.0
import
QtQuick
.
Controls
.
Styles
.
Nemo
1.0
ToolBarStyle
{
Style
{
padding.left
:
6
padding.right
:
6
padding.top
:
3
padding.bottom
:
3
property
Component
panel
:
Item
{
implicitHeight
:
75
implicitWidth
:
400
Rectangle
{
anchors.fill
:
parent
color
:
Theme
.
toolBar
.
background
}
}
}
}
src/styles/autogenerated/nemotheme.cpp
View file @
94f6ec9f
...
@@ -42,6 +42,7 @@ NemoTheme::NemoTheme(QObject *parent)
...
@@ -42,6 +42,7 @@ NemoTheme::NemoTheme(QObject *parent)
,
m_primaryButton
(
new
NemoThemeButton
(
this
))
,
m_primaryButton
(
new
NemoThemeButton
(
this
))
,
m_groove
(
new
NemoThemeGroove
(
this
))
,
m_groove
(
new
NemoThemeGroove
(
this
))
,
m_textField
(
new
NemoThemeTextField
(
this
))
,
m_textField
(
new
NemoThemeTextField
(
this
))
,
m_toolBar
(
new
NemoThemeToolBar
(
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"
);
...
@@ -99,6 +100,11 @@ NemoThemeTextField * NemoTheme::textField() const
...
@@ -99,6 +100,11 @@ NemoThemeTextField * NemoTheme::textField() const
return
m_textField
;
return
m_textField
;
}
}
NemoThemeToolBar
*
NemoTheme
::
toolBar
()
const
{
return
m_toolBar
;
}
QString
NemoTheme
::
fontFamily
()
const
QString
NemoTheme
::
fontFamily
()
const
{
{
return
m_fontFamily
;
return
m_fontFamily
;
...
@@ -303,4 +309,7 @@ void NemoTheme::loadFromFile(const QString &fileName)
...
@@ -303,4 +309,7 @@ void NemoTheme::loadFromFile(const QString &fileName)
QJsonObject
stylesTextField
=
styles
.
value
(
"textField"
).
toObject
();
QJsonObject
stylesTextField
=
styles
.
value
(
"textField"
).
toObject
();
m_textField
->
setSelectedTextColor
(
jsonToColor
(
jsonValue
(
stylesTextField
,
"selectedTextColor"
,
"textField"
),
defines
));
m_textField
->
setSelectedTextColor
(
jsonToColor
(
jsonValue
(
stylesTextField
,
"selectedTextColor"
,
"textField"
),
defines
));
m_textField
->
setSelectionColor
(
jsonToColor
(
jsonValue
(
stylesTextField
,
"selectionColor"
,
"textField"
),
defines
));
m_textField
->
setSelectionColor
(
jsonToColor
(
jsonValue
(
stylesTextField
,
"selectionColor"
,
"textField"
),
defines
));
// Setting properties for toolBar
QJsonObject
stylesToolBar
=
styles
.
value
(
"toolBar"
).
toObject
();
m_toolBar
->
setBackground
(
jsonToColor
(
jsonValue
(
stylesToolBar
,
"background"
,
"toolBar"
),
defines
));
}
}
src/styles/autogenerated/nemotheme.h
View file @
94f6ec9f
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
#include "nemothemebutton.h"
#include "nemothemebutton.h"
#include "nemothemegroove.h"
#include "nemothemegroove.h"
#include "nemothemetextfield.h"
#include "nemothemetextfield.h"
#include "nemothemetoolbar.h"
class
NemoTheme
:
public
QObject
class
NemoTheme
:
public
QObject
{
{
...
@@ -38,6 +39,7 @@ class NemoTheme: public QObject
...
@@ -38,6 +39,7 @@ class NemoTheme: public QObject
Q_PROPERTY
(
NemoThemeButton
*
primaryButton
READ
primaryButton
CONSTANT
)
Q_PROPERTY
(
NemoThemeButton
*
primaryButton
READ
primaryButton
CONSTANT
)
Q_PROPERTY
(
NemoThemeGroove
*
groove
READ
groove
CONSTANT
)
Q_PROPERTY
(
NemoThemeGroove
*
groove
READ
groove
CONSTANT
)
Q_PROPERTY
(
NemoThemeTextField
*
textField
READ
textField
CONSTANT
)
Q_PROPERTY
(
NemoThemeTextField
*
textField
READ
textField
CONSTANT
)
Q_PROPERTY
(
NemoThemeToolBar
*
toolBar
READ
toolBar
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
);
...
@@ -49,6 +51,7 @@ public:
...
@@ -49,6 +51,7 @@ public:
NemoThemeButton
*
primaryButton
()
const
;
NemoThemeButton
*
primaryButton
()
const
;
NemoThemeGroove
*
groove
()
const
;
NemoThemeGroove
*
groove
()
const
;
NemoThemeTextField
*
textField
()
const
;
NemoThemeTextField
*
textField
()
const
;
NemoThemeToolBar
*
toolBar
()
const
;
QString
fontFamily
()
const
;
QString
fontFamily
()
const
;
public
Q_SLOTS
:
public
Q_SLOTS
:
void
loadFromFile
(
const
QString
&
fileName
);
void
loadFromFile
(
const
QString
&
fileName
);
...
@@ -62,6 +65,7 @@ private:
...
@@ -62,6 +65,7 @@ private:
NemoThemeButton
*
m_primaryButton
;
NemoThemeButton
*
m_primaryButton
;
NemoThemeGroove
*
m_groove
;
NemoThemeGroove
*
m_groove
;
NemoThemeTextField
*
m_textField
;
NemoThemeTextField
*
m_textField
;
NemoThemeToolBar
*
m_toolBar
;
QString
m_fontFamily
;
QString
m_fontFamily
;
};
};
...
...
src/styles/autogenerated/nemothemetoolbar.cpp
0 → 100644
View file @
94f6ec9f
/*
* 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 "nemothemetoolbar.h"
NemoThemeToolBar
::
NemoThemeToolBar
(
QObject
*
parent
)
:
QObject
(
parent
)
{
}
QColor
NemoThemeToolBar
::
background
()
const
{
return
m_background
;
}
void
NemoThemeToolBar
::
setBackground
(
const
QColor
&
background
)
{
if
(
m_background
!=
background
)
{
m_background
=
background
;
emit
backgroundChanged
();
}
}
src/styles/autogenerated/nemothemetoolbar.h
0 → 100644
View file @
94f6ec9f
/*
* 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 NEMOTHEMETOOLBAR_H
#define NEMOTHEMETOOLBAR_H
#include <QtCore/QObject>
#include <QtGui/QColor>
class
NemoThemeToolBar
:
public
QObject
{
Q_OBJECT
Q_PROPERTY
(
QColor
background
READ
background
NOTIFY
backgroundChanged
)
public:
explicit
NemoThemeToolBar
(
QObject
*
parent
=
0
);
QColor
background
()
const
;
void
setBackground
(
const
QColor
&
background
);
Q_SIGNALS:
void
backgroundChanged
();
private:
QColor
m_background
;
};
#endif //NEMOTHEMETOOLBAR_H
src/styles/qquicknemostyleextensionplugin.cpp
View file @
94f6ec9f
...
@@ -45,6 +45,7 @@ void QQuickNemoStyleExtensionPlugin::registerTypes(const char *uri)
...
@@ -45,6 +45,7 @@ void QQuickNemoStyleExtensionPlugin::registerTypes(const char *uri)
qmlRegisterUncreatableType
<
NemoThemeFont
>
(
uri
,
1
,
0
,
"NemoThemeFont"
,
reason
);
qmlRegisterUncreatableType
<
NemoThemeFont
>
(
uri
,
1
,
0
,
"NemoThemeFont"
,
reason
);
qmlRegisterUncreatableType
<
NemoThemeGroove
>
(
uri
,
1
,
0
,
"NemoThemeGroove"
,
reason
);
qmlRegisterUncreatableType
<
NemoThemeGroove
>
(
uri
,
1
,
0
,
"NemoThemeGroove"
,
reason
);
qmlRegisterUncreatableType
<
NemoThemeTextField
>
(
uri
,
1
,
0
,
"NemoThemeTextField"
,
reason
);
qmlRegisterUncreatableType
<
NemoThemeTextField
>
(
uri
,
1
,
0
,
"NemoThemeTextField"
,
reason
);
qmlRegisterUncreatableType
<
NemoThemeToolBar
>
(
uri
,
1
,
0
,
"NemoThemeToolBar"
,
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 @
94f6ec9f
...
@@ -84,7 +84,8 @@ HEADERS += \
...
@@ -84,7 +84,8 @@ HEADERS += \
autogenerated/nemothemebuttontext.h \
autogenerated/nemothemebuttontext.h \
autogenerated/nemothemefont.h \
autogenerated/nemothemefont.h \
autogenerated/nemothemegroove.h \
autogenerated/nemothemegroove.h \
autogenerated/nemothemetextfield.h
autogenerated/nemothemetextfield.h \
autogenerated/nemothemetoolbar.h
SOURCES += \
SOURCES += \
qquicknemostyleextensionplugin.cpp \
qquicknemostyleextensionplugin.cpp \
...
@@ -94,7 +95,8 @@ SOURCES += \
...
@@ -94,7 +95,8 @@ SOURCES += \
autogenerated/nemothemebuttontext.cpp \
autogenerated/nemothemebuttontext.cpp \
autogenerated/nemothemefont.cpp \
autogenerated/nemothemefont.cpp \
autogenerated/nemothemegroove.cpp \
autogenerated/nemothemegroove.cpp \
autogenerated/nemothemetextfield.cpp
autogenerated/nemothemetextfield.cpp \
autogenerated/nemothemetoolbar.cpp
INSTALLS += target images qmlfiles themes
INSTALLS += target images qmlfiles themes
...
...
src/styles/themes/glacier.json
View file @
94f6ec9f
...
@@ -37,6 +37,9 @@
...
@@ -37,6 +37,9 @@
"textField"
:
{
"textField"
:
{
"selectedTextColor"
:
"#ffffff"
,
"selectedTextColor"
:
"#ffffff"
,
"selectionColor"
:
"#0091e5"
"selectionColor"
:
"#0091e5"
},
"toolBar"
:
{
"background"
:
"#000000"
}
}
}
}
}
}
tools/themehelper/components.json
View file @
94f6ec9f
...
@@ -44,6 +44,15 @@
...
@@ -44,6 +44,15 @@
}
}
]
]
},
},
{
"name"
:
"ToolBar"
,
"properties"
:
[
{
"name"
:
"background"
,
"type"
:
"QColor"
}
]
},
...
@@ -128,6 +137,10 @@
...
@@ -128,6 +137,10 @@
{
{
"name"
:
"textField"
,
"name"
:
"textField"
,
"object"
:
"TextField"
"object"
:
"TextField"
},
{
"name"
:
"toolBar"
,
"object"
:
"ToolBar"
}
}
],
],
"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