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
029a3da1
Commit
029a3da1
authored
Feb 25, 2014
by
Aleksi Suomalainen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[buttonrow] Button row, v0.1
parent
737679a8
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
339 additions
and
8 deletions
+339
-8
ButtonRowPage.qml
examples/touch/content/ButtonRowPage.qml
+98
-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
ButtonRow.qml
src/controls/ButtonRow.qml
+84
-0
controls.pro
src/controls/controls.pro
+8
-4
disabled-overlay-inverse.png
src/controls/images/disabled-overlay-inverse.png
+0
-0
disabled-overlay.png
src/controls/images/disabled-overlay.png
+0
-0
qmldir
src/controls/qmldir
+1
-1
nemotheme.cpp
src/styles/autogenerated/nemotheme.cpp
+10
-0
nemotheme.h
src/styles/autogenerated/nemotheme.h
+4
-0
nemothemebuttonrow.cpp
src/styles/autogenerated/nemothemebuttonrow.cpp
+54
-0
nemothemebuttonrow.h
src/styles/autogenerated/nemothemebuttonrow.h
+48
-0
styles.pro
src/styles/styles.pro
+4
-2
glacier.json
src/styles/themes/glacier.json
+4
-0
components.json
tools/themehelper/components.json
+17
-0
No files found.
examples/touch/content/ButtonRowPage.qml
0 → 100644
View file @
029a3da1
/****************************************************************************************
**
** Copyright (C) 2014 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
:
"
ButtonRow
"
}
Column
{
spacing
:
40
anchors.centerIn
:
parent
ButtonRow
{
id
:
row
model
:
ListModel
{
ListElement
{
name
:
"
swim
"
}
ListElement
{
name
:
"
cruise
"
}
ListElement
{
name
:
"
row
"
}
ListElement
{
name
:
"
fish
"
}
ListElement
{
name
:
"
dive
"
}
}
}
Connections
{
target
:
row
onSelected
:
{
selector
.
text
=
"
Selected
"
+
sel
}
}
Label
{
id
:
selector
text
:
"
Nothing selected
"
}
ButtonRow
{
id
:
row2
enabled
:
false
model
:
ListModel
{
ListElement
{
name
:
"
swim
"
}
ListElement
{
name
:
"
cruise
"
}
ListElement
{
name
:
"
row
"
}
ListElement
{
name
:
"
fish
"
}
ListElement
{
name
:
"
dive
"
}
}
}
}
}
examples/touch/main.qml
View file @
029a3da1
...
...
@@ -99,6 +99,10 @@ ApplicationWindow {
title
:
"
Switches
"
page
:
"
content/CheckboxPage.qml
"
}
ListElement
{
title
:
"
ButtonRow
"
page
:
"
content/ButtonRowPage.qml
"
}
}
...
...
examples/touch/resources.qrc
View file @
029a3da1
...
...
@@ -20,5 +20,6 @@
<file>content/SpinnerPage.qml</file>
<file>content/LabelPage.qml</file>
<file>content/CheckboxPage.qml</file>
<file>content/ButtonRowPage.qml</file>
</qresource>
</RCC>
examples/touch/touch.pro
View file @
029a3da1
...
...
@@ -21,7 +21,8 @@ OTHER_FILES += \
content
/
ToolBarLayoutExample
.
qml
\
content
/
SpinnerPage
.
qml
\
content
/
LabelPage
.
qml
\
content
/
CheckboxPage
.
qml
content
/
CheckboxPage
.
qml
\
content
/
ButtonRowPage
.
qml
RESOURCES
+=
\
resources
.
qrc
...
...
src/controls/ButtonRow.qml
0 → 100644
View file @
029a3da1
/****************************************************************************************
**
** Copyright (C) 2014 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
Rectangle
{
id
:
main
width
:
440
color
:
"
#313131
"
height
:
40
property
ListModel
model
:
ListModel
{}
property
bool
enabled
:
true
signal
selected
(
string
sel
)
Image
{
anchors.fill
:
parent
visible
:
!
main
.
enabled
source
:
"
images/disabled-overlay.png
"
fillMode
:
Image
.
Tile
}
Row
{
spacing
:
0
Repeater
{
id
:
rectangles
model
:
main
.
model
delegate
:
Rectangle
{
property
bool
active
:
false
height
:
50
width
:
20
*
name
.
length
color
:
"
transparent
"
MouseArea
{
enabled
:
main
.
enabled
width
:
parent
.
width
height
:
parent
.
height
onClicked
:
{
if
(
!
parent
.
active
)
{
text
.
font
.
bold
=
true
parent
.
color
=
"
#0091e5
"
parent
.
active
=
true
}
else
{
text
.
font
.
bold
=
false
parent
.
color
=
"
transparent
"
parent
.
active
=
false
}
main
.
selected
(
name
)
}
}
Label
{
id
:
text
text
:
name
}
}
}
}
}
src/controls/controls.pro
View file @
029a3da1
...
...
@@ -12,10 +12,13 @@ QML_FILES += \
Page
.
qml
\
Spinner
.
qml
\
Label
.
qml
\
Checkbox
.
qml
Checkbox
.
qml
\
images
/
disabled
-
overlay
.
png
images
/
disabled
-
overlay
-
inverse
.
png
OTHER_FILES
+=
qmldir
\
$$
QML_FILES
$$
QML_FILES
\
ButtonRow
.
qml
HEADERS
+=
\
qquicknemocontrolsextensionplugin
.
h
\
...
...
@@ -34,5 +37,6 @@ target.path = $$[QT_INSTALL_QML]/$$PLUGIN_IMPORT_PATH
qmlfiles
.
files
=
$$
_PRO_FILE_PWD_
/*
.qml
qmlfiles.files += $$_PRO_FILE_PWD_/qmldir
qmlfiles.path = $$[QT_INSTALL_QML]/$$PLUGIN_IMPORT_PATH
INSTALLS += target qmlfiles
images.files = $$_PRO_FILE_PWD_/images
images.path = $$[QT_INSTALL_QML]/$$PLUGIN_IMPORT_PATH
INSTALLS += target qmlfiles images
src/controls/images/disabled-overlay-inverse.png
0 → 100644
View file @
029a3da1
281 Bytes
src/controls/images/disabled-overlay.png
0 → 100644
View file @
029a3da1
299 Bytes
src/controls/qmldir
View file @
029a3da1
...
...
@@ -14,7 +14,7 @@ Page 1.0 Page.qml
Spinner 1.0 Spinner.qml
Label 1.0 Label.qml
CheckBox 1.0 Checkbox.qml
ButtonRow 1.0 ButtonRow.qml
# MIRRORED CONTROLS:
# These are the controls that we take directly from official QQC.
# This is to avoid having to "import QtQuick.Controls" when using controls
...
...
src/styles/autogenerated/nemotheme.cpp
View file @
029a3da1
...
...
@@ -49,6 +49,7 @@ NemoTheme::NemoTheme(QObject *parent)
,
m_spinner
(
new
NemoThemeSpinner
(
this
))
,
m_label
(
new
NemoThemeLabel
(
this
))
,
m_checkbox
(
new
NemoThemeCheckbox
(
this
))
,
m_buttonRow
(
new
NemoThemeButtonRow
(
this
))
{
loadFromFile
(
GLACIER_THEME
);
int
id
=
QFontDatabase
::
addApplicationFont
(
"/usr/share/fonts/google-opensans/OpenSans-Regular.ttf"
);
...
...
@@ -141,6 +142,11 @@ NemoThemeCheckbox * NemoTheme::checkbox() const
return
m_checkbox
;
}
NemoThemeButtonRow
*
NemoTheme
::
buttonRow
()
const
{
return
m_buttonRow
;
}
QString
NemoTheme
::
fontFamily
()
const
{
return
m_fontFamily
;
...
...
@@ -450,4 +456,8 @@ void NemoTheme::loadFromFile(const QString &fileName)
QJsonObject
stylesCheckbox
=
styles
.
value
(
"checkbox"
).
toObject
();
m_checkbox
->
setBack1
(
jsonToColor
(
jsonValue
(
stylesCheckbox
,
"back1"
,
"checkbox"
),
defines
));
m_checkbox
->
setBack2
(
jsonToColor
(
jsonValue
(
stylesCheckbox
,
"back2"
,
"checkbox"
),
defines
));
// Setting properties for buttonRow
QJsonObject
stylesButtonRow
=
styles
.
value
(
"buttonRow"
).
toObject
();
m_buttonRow
->
setBackground
(
jsonToColor
(
jsonValue
(
stylesButtonRow
,
"background"
,
"buttonRow"
),
defines
));
m_buttonRow
->
setButtonColor
(
jsonToColor
(
jsonValue
(
stylesButtonRow
,
"buttonColor"
,
"buttonRow"
),
defines
));
}
src/styles/autogenerated/nemotheme.h
View file @
029a3da1
...
...
@@ -35,6 +35,7 @@
#include "nemothemespinner.h"
#include "nemothemelabel.h"
#include "nemothemecheckbox.h"
#include "nemothemebuttonrow.h"
class
NemoTheme
:
public
QObject
{
...
...
@@ -52,6 +53,7 @@ class NemoTheme: public QObject
Q_PROPERTY
(
NemoThemeSpinner
*
spinner
READ
spinner
CONSTANT
)
Q_PROPERTY
(
NemoThemeLabel
*
label
READ
label
CONSTANT
)
Q_PROPERTY
(
NemoThemeCheckbox
*
checkbox
READ
checkbox
CONSTANT
)
Q_PROPERTY
(
NemoThemeButtonRow
*
buttonRow
READ
buttonRow
CONSTANT
)
Q_PROPERTY
(
QString
fontFamily
READ
fontFamily
CONSTANT
)
public:
explicit
NemoTheme
(
QObject
*
parent
=
0
);
...
...
@@ -70,6 +72,7 @@ public:
NemoThemeSpinner
*
spinner
()
const
;
NemoThemeLabel
*
label
()
const
;
NemoThemeCheckbox
*
checkbox
()
const
;
NemoThemeButtonRow
*
buttonRow
()
const
;
QString
fontFamily
()
const
;
public
Q_SLOTS
:
void
loadFromFile
(
const
QString
&
fileName
);
...
...
@@ -90,6 +93,7 @@ private:
NemoThemeSpinner
*
m_spinner
;
NemoThemeLabel
*
m_label
;
NemoThemeCheckbox
*
m_checkbox
;
NemoThemeButtonRow
*
m_buttonRow
;
QString
m_fontFamily
;
};
...
...
src/styles/autogenerated/nemothemebuttonrow.cpp
0 → 100644
View file @
029a3da1
/*
* 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 "nemothemebuttonrow.h"
NemoThemeButtonRow
::
NemoThemeButtonRow
(
QObject
*
parent
)
:
QObject
(
parent
)
{
}
QColor
NemoThemeButtonRow
::
background
()
const
{
return
m_background
;
}
void
NemoThemeButtonRow
::
setBackground
(
const
QColor
&
background
)
{
if
(
m_background
!=
background
)
{
m_background
=
background
;
emit
backgroundChanged
();
}
}
QColor
NemoThemeButtonRow
::
buttonColor
()
const
{
return
m_buttonColor
;
}
void
NemoThemeButtonRow
::
setButtonColor
(
const
QColor
&
buttonColor
)
{
if
(
m_buttonColor
!=
buttonColor
)
{
m_buttonColor
=
buttonColor
;
emit
buttonColorChanged
();
}
}
src/styles/autogenerated/nemothemebuttonrow.h
0 → 100644
View file @
029a3da1
/*
* 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 NEMOTHEMEBUTTONROW_H
#define NEMOTHEMEBUTTONROW_H
#include <QtCore/QObject>
#include <QtGui/QColor>
class
NemoThemeButtonRow
:
public
QObject
{
Q_OBJECT
Q_PROPERTY
(
QColor
background
READ
background
NOTIFY
backgroundChanged
)
Q_PROPERTY
(
QColor
buttonColor
READ
buttonColor
NOTIFY
buttonColorChanged
)
public:
explicit
NemoThemeButtonRow
(
QObject
*
parent
=
0
);
QColor
background
()
const
;
void
setBackground
(
const
QColor
&
background
);
QColor
buttonColor
()
const
;
void
setButtonColor
(
const
QColor
&
buttonColor
);
Q_SIGNALS:
void
backgroundChanged
();
void
buttonColorChanged
();
private:
QColor
m_background
;
QColor
m_buttonColor
;
};
#endif //NEMOTHEMEBUTTONROW_H
src/styles/styles.pro
View file @
029a3da1
...
...
@@ -87,7 +87,8 @@ HEADERS += \
autogenerated/nemothemespinner.h \
autogenerated/nemothemelabel.h \
autogenerated/nemothemecheckbox.h \
autogenerated/nemothemepagestack.h
autogenerated/nemothemepagestack.h \
autogenerated/nemothemebuttonrow.h
SOURCES += \
qquicknemostyleextensionplugin.cpp \
...
...
@@ -105,7 +106,8 @@ SOURCES += \
autogenerated/nemothemespinner.cpp \
autogenerated/nemothemelabel.cpp \
autogenerated/nemothemecheckbox.cpp \
autogenerated/nemothemepagestack.cpp
autogenerated/nemothemepagestack.cpp \
autogenerated/nemothemebuttonrow.cpp
INSTALLS += target images qmlfiles themes
...
...
src/styles/themes/glacier.json
View file @
029a3da1
...
...
@@ -61,6 +61,10 @@
"checkbox"
:
{
"back1"
:
"#0091e5"
,
"back2"
:
"#313131"
},
"buttonRow"
:
{
"background"
:
"#313131"
,
"buttonColor"
:
"#0091e5"
}
}
}
tools/themehelper/components.json
View file @
029a3da1
...
...
@@ -243,6 +243,19 @@
"default"
:
500
}
]
},
{
"name"
:
"ButtonRow"
,
"properties"
:
[
{
"name"
:
"background"
,
"type"
:
"QColor"
},
{
"name"
:
"buttonColor"
,
"type"
:
"QColor"
}
]
}
],
"properties"
:
[
...
...
@@ -289,6 +302,10 @@
{
"name"
:
"checkbox"
,
"object"
:
"Checkbox"
},
{
"name"
:
"buttonRow"
,
"object"
:
"ButtonRow"
}
],
"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