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
aafd0897
Commit
aafd0897
authored
Oct 06, 2013
by
Lucien XU
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for groove and text field
parent
99c67307
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
295 additions
and
4 deletions
+295
-4
GrooveStyle.qml
src/styles/GrooveStyle.qml
+2
-2
nemotheme.cpp
src/styles/nemotheme.cpp
+20
-0
nemotheme.h
src/styles/nemotheme.h
+8
-0
nemothemegroove.cpp
src/styles/nemothemegroove.cpp
+54
-0
nemothemegroove.h
src/styles/nemothemegroove.h
+48
-0
nemothemetextfield.cpp
src/styles/nemothemetextfield.cpp
+54
-0
nemothemetextfield.h
src/styles/nemothemetextfield.h
+48
-0
qquicknemostyleextensionplugin.cpp
src/styles/qquicknemostyleextensionplugin.cpp
+2
-0
styles.pro
src/styles/styles.pro
+4
-0
glacier.json
src/styles/themes/glacier.json
+10
-1
ugly.json
src/styles/themes/ugly.json
+10
-1
components.json
tools/themehelper/components.json
+35
-0
No files found.
src/styles/GrooveStyle.qml
View file @
aafd0897
...
...
@@ -24,11 +24,11 @@ Component {
Rectangle
{
implicitHeight
:
16
implicitWidth
:
440
color
:
Theme
.
groove
.
background
Color
color
:
Theme
.
groove
.
background
Rectangle
{
antialiasing
:
true
radius
:
1
color
:
Theme
.
groove
.
foreground
Color
color
:
Theme
.
groove
.
foreground
height
:
parent
.
height
width
:
parent
.
width
*
control
.
value
/
control
.
maximumValue
}
...
...
src/styles/nemotheme.cpp
View file @
aafd0897
...
...
@@ -40,6 +40,8 @@ NemoTheme::NemoTheme(QObject *parent)
:
QObject
(
parent
)
,
m_button
(
new
NemoThemeButton
(
this
))
,
m_primaryButton
(
new
NemoThemeButton
(
this
))
,
m_groove
(
new
NemoThemeGroove
(
this
))
,
m_textField
(
new
NemoThemeTextField
(
this
))
{
loadFromFile
(
GLACIER_THEME
);
int
id
=
QFontDatabase
::
addApplicationFont
(
"/usr/share/fonts/google-opensans/OpenSans-Regular.ttf"
);
...
...
@@ -87,6 +89,16 @@ NemoThemeButton * NemoTheme::primaryButton() const
return
m_primaryButton
;
}
NemoThemeGroove
*
NemoTheme
::
groove
()
const
{
return
m_groove
;
}
NemoThemeTextField
*
NemoTheme
::
textField
()
const
{
return
m_textField
;
}
QString
NemoTheme
::
fontFamily
()
const
{
return
m_fontFamily
;
...
...
@@ -281,4 +293,12 @@ void NemoTheme::loadFromFile(const QString &fileName)
if
(
stylesPrimaryButtonPressedGradient
.
contains
(
"edge"
))
{
m_primaryButton
->
pressedGradient
()
->
setEdge
(
jsonToDouble
(
stylesPrimaryButton
.
value
(
"pressedGradient"
),
defines
));
}
// Setting properties for groove
QJsonObject
stylesGroove
=
styles
.
value
(
"groove"
).
toObject
();
m_groove
->
setBackground
(
jsonToColor
(
jsonValue
(
stylesGroove
,
"background"
,
"groove"
),
defines
));
m_groove
->
setForeground
(
jsonToColor
(
jsonValue
(
stylesGroove
,
"foreground"
,
"groove"
),
defines
));
// Setting properties for textField
QJsonObject
stylesTextField
=
styles
.
value
(
"textField"
).
toObject
();
m_textField
->
setSelectedTextColor
(
jsonToColor
(
jsonValue
(
stylesTextField
,
"selectedTextColor"
,
"textField"
),
defines
));
m_textField
->
setSelectionColor
(
jsonToColor
(
jsonValue
(
stylesTextField
,
"selectionColor"
,
"textField"
),
defines
));
}
src/styles/nemotheme.h
View file @
aafd0897
...
...
@@ -26,6 +26,8 @@
#include <QtCore/QObject>
#include <QtCore/QString>
#include "nemothemebutton.h"
#include "nemothemegroove.h"
#include "nemothemetextfield.h"
class
NemoTheme
:
public
QObject
{
...
...
@@ -34,6 +36,8 @@ class NemoTheme: public QObject
Q_PROPERTY
(
QString
description
READ
description
NOTIFY
descriptionChanged
)
Q_PROPERTY
(
NemoThemeButton
*
button
READ
button
CONSTANT
)
Q_PROPERTY
(
NemoThemeButton
*
primaryButton
READ
primaryButton
CONSTANT
)
Q_PROPERTY
(
NemoThemeGroove
*
groove
READ
groove
CONSTANT
)
Q_PROPERTY
(
NemoThemeTextField
*
textField
READ
textField
CONSTANT
)
Q_PROPERTY
(
QString
fontFamily
READ
fontFamily
CONSTANT
)
public:
explicit
NemoTheme
(
QObject
*
parent
=
0
);
...
...
@@ -43,6 +47,8 @@ public:
void
setDescription
(
QString
description
);
NemoThemeButton
*
button
()
const
;
NemoThemeButton
*
primaryButton
()
const
;
NemoThemeGroove
*
groove
()
const
;
NemoThemeTextField
*
textField
()
const
;
QString
fontFamily
()
const
;
public
Q_SLOTS
:
void
loadFromFile
(
const
QString
&
fileName
);
...
...
@@ -54,6 +60,8 @@ private:
QString
m_description
;
NemoThemeButton
*
m_button
;
NemoThemeButton
*
m_primaryButton
;
NemoThemeGroove
*
m_groove
;
NemoThemeTextField
*
m_textField
;
QString
m_fontFamily
;
};
...
...
src/styles/nemothemegroove.cpp
0 → 100644
View file @
aafd0897
/*
* 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 "nemothemegroove.h"
NemoThemeGroove
::
NemoThemeGroove
(
QObject
*
parent
)
:
QObject
(
parent
)
{
}
QColor
NemoThemeGroove
::
background
()
const
{
return
m_background
;
}
void
NemoThemeGroove
::
setBackground
(
QColor
background
)
{
if
(
m_background
!=
background
)
{
m_background
=
background
;
emit
backgroundChanged
();
}
}
QColor
NemoThemeGroove
::
foreground
()
const
{
return
m_foreground
;
}
void
NemoThemeGroove
::
setForeground
(
QColor
foreground
)
{
if
(
m_foreground
!=
foreground
)
{
m_foreground
=
foreground
;
emit
foregroundChanged
();
}
}
src/styles/nemothemegroove.h
0 → 100644
View file @
aafd0897
/*
* 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 NEMOTHEMEGROOVE_H
#define NEMOTHEMEGROOVE_H
#include <QtCore/QObject>
#include <QtGui/QColor>
class
NemoThemeGroove
:
public
QObject
{
Q_OBJECT
Q_PROPERTY
(
QColor
background
READ
background
NOTIFY
backgroundChanged
)
Q_PROPERTY
(
QColor
foreground
READ
foreground
NOTIFY
foregroundChanged
)
public:
explicit
NemoThemeGroove
(
QObject
*
parent
=
0
);
QColor
background
()
const
;
void
setBackground
(
QColor
background
);
QColor
foreground
()
const
;
void
setForeground
(
QColor
foreground
);
Q_SIGNALS:
void
backgroundChanged
();
void
foregroundChanged
();
private:
QColor
m_background
;
QColor
m_foreground
;
};
#endif //NEMOTHEMEGROOVE_H
src/styles/nemothemetextfield.cpp
0 → 100644
View file @
aafd0897
/*
* 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 "nemothemetextfield.h"
NemoThemeTextField
::
NemoThemeTextField
(
QObject
*
parent
)
:
QObject
(
parent
)
{
}
QColor
NemoThemeTextField
::
selectedTextColor
()
const
{
return
m_selectedTextColor
;
}
void
NemoThemeTextField
::
setSelectedTextColor
(
QColor
selectedTextColor
)
{
if
(
m_selectedTextColor
!=
selectedTextColor
)
{
m_selectedTextColor
=
selectedTextColor
;
emit
selectedTextColorChanged
();
}
}
QColor
NemoThemeTextField
::
selectionColor
()
const
{
return
m_selectionColor
;
}
void
NemoThemeTextField
::
setSelectionColor
(
QColor
selectionColor
)
{
if
(
m_selectionColor
!=
selectionColor
)
{
m_selectionColor
=
selectionColor
;
emit
selectionColorChanged
();
}
}
src/styles/nemothemetextfield.h
0 → 100644
View file @
aafd0897
/*
* 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 NEMOTHEMETEXTFIELD_H
#define NEMOTHEMETEXTFIELD_H
#include <QtCore/QObject>
#include <QtGui/QColor>
class
NemoThemeTextField
:
public
QObject
{
Q_OBJECT
Q_PROPERTY
(
QColor
selectedTextColor
READ
selectedTextColor
NOTIFY
selectedTextColorChanged
)
Q_PROPERTY
(
QColor
selectionColor
READ
selectionColor
NOTIFY
selectionColorChanged
)
public:
explicit
NemoThemeTextField
(
QObject
*
parent
=
0
);
QColor
selectedTextColor
()
const
;
void
setSelectedTextColor
(
QColor
selectedTextColor
);
QColor
selectionColor
()
const
;
void
setSelectionColor
(
QColor
selectionColor
);
Q_SIGNALS:
void
selectedTextColorChanged
();
void
selectionColorChanged
();
private:
QColor
m_selectedTextColor
;
QColor
m_selectionColor
;
};
#endif //NEMOTHEMETEXTFIELD_H
src/styles/qquicknemostyleextensionplugin.cpp
View file @
aafd0897
...
...
@@ -43,6 +43,8 @@ void QQuickNemoStyleExtensionPlugin::registerTypes(const char *uri)
qmlRegisterUncreatableType
<
NemoThemeButtonPressedGradient
>
(
uri
,
1
,
0
,
"NemoThemeButtonPressedGradient"
,
reason
);
qmlRegisterUncreatableType
<
NemoThemeButtonText
>
(
uri
,
1
,
0
,
"NemoThemeButtonText"
,
reason
);
qmlRegisterUncreatableType
<
NemoThemeFont
>
(
uri
,
1
,
0
,
"NemoThemeFont"
,
reason
);
qmlRegisterUncreatableType
<
NemoThemeGroove
>
(
uri
,
1
,
0
,
"NemoThemeGroove"
,
reason
);
qmlRegisterUncreatableType
<
NemoThemeTextField
>
(
uri
,
1
,
0
,
"NemoThemeTextField"
,
reason
);
qmlRegisterSingletonType
<
QObject
>
(
uri
,
1
,
0
,
"Theme"
,
nemo_theme_provider
);
}
...
...
src/styles/styles.pro
View file @
aafd0897
...
...
@@ -82,6 +82,8 @@ HEADERS += \
nemothemebuttonpressedgradient.h \
nemothemebuttontext.h \
nemothemefont.h \
nemothemegroove.h \
nemothemetextfield.h \
nemotheme.h
SOURCES += \
...
...
@@ -90,6 +92,8 @@ SOURCES += \
nemothemebuttonpressedgradient.cpp \
nemothemebuttontext.cpp \
nemothemefont.cpp \
nemothemegroove.cpp \
nemothemetextfield.cpp \
nemotheme.cpp
INSTALLS += target images qmlfiles themes
...
...
src/styles/themes/glacier.json
View file @
aafd0897
...
...
@@ -3,7 +3,8 @@
"description"
:
"Glacier theme"
,
"defines"
:
{
"accentColor"
:
"#0091e5"
,
"fillColor"
:
"#474747"
"fillColor"
:
"#474747"
,
"fillColorDark"
:
"#313131"
},
"styles"
:
{
"button"
:
{
...
...
@@ -28,6 +29,14 @@
"centerColor"
:
"white"
,
"edgeColor"
:
"accentColor"
}
},
"groove"
:
{
"foreground"
:
"accentColor"
,
"background"
:
"fillColorDark"
},
"textField"
:
{
"selectedTextColor"
:
"#ffffff"
,
"selectionColor"
:
"#0091e5"
}
}
}
src/styles/themes/ugly.json
View file @
aafd0897
...
...
@@ -3,7 +3,8 @@
"description"
:
"Ugly test theme"
,
"defines"
:
{
"accentColor"
:
"#FF7F00"
,
"fillColor"
:
"#474747"
"fillColor"
:
"#474747"
,
"fillColorDark"
:
"#202020"
},
"styles"
:
{
"button"
:
{
...
...
@@ -28,6 +29,14 @@
"centerColor"
:
"white"
,
"edgeColor"
:
"accentColor"
}
},
"groove"
:
{
"foreground"
:
"accentColor"
,
"background"
:
"fillColorDark"
},
"textField"
:
{
"selectedTextColor"
:
"#ffffff"
,
"selectionColor"
:
"#0091e5"
}
}
}
tools/themehelper/components.json
View file @
aafd0897
...
...
@@ -77,6 +77,33 @@
"default"
:
25
}
]
},
{
"name"
:
"Groove"
,
"properties"
:
[
{
"name"
:
"background"
,
"type"
:
"QColor"
},
{
"name"
:
"foreground"
,
"type"
:
"QColor"
}
]
},
{
"name"
:
"TextField"
,
"properties"
:
[
{
"name"
:
"selectedTextColor"
,
"type"
:
"QColor"
},
{
"name"
:
"selectionColor"
,
"type"
:
"QColor"
}
]
}
],
"properties"
:
[
...
...
@@ -87,6 +114,14 @@
{
"name"
:
"primaryButton"
,
"object"
:
"Button"
},
{
"name"
:
"groove"
,
"object"
:
"Groove"
},
{
"name"
:
"textField"
,
"object"
:
"TextField"
}
],
"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