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
5c958bb8
Commit
5c958bb8
authored
Jun 17, 2017
by
eekkelund
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Controls] Add IconButton and example IconPage
parent
b44cef3c
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
195 additions
and
18 deletions
+195
-18
IconPage.qml
examples/touch/content/IconPage.qml
+68
-0
main.qml
examples/touch/main.qml
+4
-0
touch.pro
examples/touch/touch.pro
+3
-17
IconButton.qml
src/controls/IconButton.qml
+72
-0
controls.pro
src/controls/controls.pro
+2
-1
qmldir
src/controls/qmldir
+1
-0
IconButtonStyle.qml
src/styles/IconButtonStyle.qml
+43
-0
qmldir
src/styles/qmldir
+1
-0
styles.pro
src/styles/styles.pro
+1
-0
No files found.
examples/touch/content/IconPage.qml
0 → 100644
View file @
5c958bb8
/****************************************************************************************
**
** Copyright (C) 2017 Eetu Kahelin
** 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.6
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
headerTools
:
HeaderToolsLayout
{
showBackButton
:
true
;
title
:
"
Icon example
"
}
allowedOrientations
:
Qt
.
PortraitOrientation
|
Qt
.
LandscapeOrientation
|
Qt
.
InvertedLandscapeOrientation
|
Qt
.
InvertedPortraitOrientation
Column
{
spacing
:
Theme
.
itemSpacingMedium
anchors.centerIn
:
parent
//fontawesome
IconButton
{
source
:
"
image://theme/compass
"
}
//fontawesome
IconButton
{
width
:
height
height
:
Theme
.
itemHeightExtraLarge
source
:
"
image://theme/bell
"
enabled
:
false
}
//fontawesome
IconButton
{
source
:
"
image://theme/address-book?
"
+
Theme
.
fillColor
}
//glacier
IconButton
{
width
:
height
height
:
Theme
.
itemHeightExtraLarge
source
:
"
image://theme/icon-m-framework-close-thumbnail
"
}
}
}
examples/touch/main.qml
View file @
5c958bb8
...
...
@@ -116,6 +116,10 @@ ApplicationWindow {
title
:
"
Query Dialog
"
page
:
"
content/QueryDialogPage.qml
"
}
ListElement
{
title
:
"
Icons
"
page
:
"
content/IconPage.qml
"
}
}
...
...
examples/touch/touch.pro
View file @
5c958bb8
...
...
@@ -24,29 +24,15 @@ qml.files += \
content
/
ButtonRowPage
.
qml
\
content
/
QueryDialogPage
.
qml
\
content
/
ListViewPage
.
qml
\
content
/
SelectRollerPage
.
qml
content
/
SelectRollerPage
.
qml
\
content
/
IconPage
.
qml
qml
.
path
=
/
usr
/
share
/
glacier
-
components
/
content
images
.
files
=
images
/*
.png
images.path = /usr/share/glacier-components/images
OTHER_FILES += \
main.qml \
content/AndroidDelegate.qml \
content/ButtonPage.qml \
content/ProgressBarPage.qml \
content/SliderPage.qml \
content/TabBarPage.qml \
content/TextInputPage.qml \
content/LiveCoding.qml \
content/SpinnerPage.qml \
content/LabelPage.qml \
content/CheckboxPage.qml \
content/ButtonRowPage.qml \
content/QueryDialogPage.qml \
content/ListViewPage.qml \
content/SelectRollerPage.qml
OTHER_FILES += $$qml.files
desktop.path = /usr/share/applications
...
...
src/controls/IconButton.qml
0 → 100644
View file @
5c958bb8
/****************************************************************************************
**
** Copyright (C) 2017 Eetu Kahelin
** 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.6
import
QtQuick
.
Controls
1.0
import
QtQuick
.
Controls
.
Nemo
1.0
import
QtQuick
.
Controls
.
Styles
.
Nemo
1.0
Button
{
property
color
highlightColor
:
Theme
.
accentColor
property
bool
highlighted
:
pressed
property
bool
_showPress
:
highlighted
||
pressTimer
.
running
property
string
source
property
string
highlightSource
:
{
if
(
source
!=
""
)
{
var
tmpSrc
=
source
.
toString
()
var
i
=
tmpSrc
.
lastIndexOf
(
"
?
"
)
if
(
i
!==
-
1
)
{
tmpSrc
=
tmpSrc
.
substring
(
0
,
i
)
}
return
tmpSrc
+
"
?
"
+
highlightColor
}
else
{
return
""
}
}
onPressedChanged
:
{
if
(
pressed
)
{
console
.
log
(
highlightSource
,
_showPress
,
source
)
pressTimer
.
start
()
}
}
width
:
Theme
.
itemHeightLarge
height
:
width
style
:
IconButtonStyle
{
}
Timer
{
id
:
pressTimer
interval
:
20
}
}
src/controls/controls.pro
View file @
5c958bb8
...
...
@@ -21,7 +21,8 @@ QML_FILES += \
ListView
.
qml
\
ListViewItemWithActions
.
qml
\
GlacierRoller
.
qml
\
GlacierRollerItem
.
qml
GlacierRollerItem
.
qml
\
IconButton
.
qml
OTHER_FILES
+=
qmldir
\
$$
QML_FILES
...
...
src/controls/qmldir
View file @
5c958bb8
...
...
@@ -23,6 +23,7 @@ ListView 1.0 ListView.qml
ListViewItemWithActions 1.0 ListViewItemWithActions.qml
GlacierRoller 1.0 GlacierRoller.qml
GlacierRollerItem 1.0 GlacierRollerItem.qml
IconButton 1.0 IconButton.qml
# MIRRORED CONTROLS:
# These are the controls that we take directly from official QQC.
...
...
src/styles/IconButtonStyle.qml
0 → 100644
View file @
5c958bb8
/****************************************************************************************
**
** Copyright (C) 2017 Eetu Kahelin
** 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.6
import
QtQuick
.
Controls
1.0
import
QtQuick
.
Controls
.
Styles
1.4
import
QtGraphicalEffects
1.0
ButtonStyle
{
background
:
Image
{
fillMode
:
Image
.
PreserveAspectFit
opacity
:
control
.
enabled
?
1.0
:
0.5
source
:
control
.
_showPress
?
control
.
highlightSource
:
control
.
source
}
}
src/styles/qmldir
View file @
5c958bb8
...
...
@@ -20,3 +20,4 @@ SpinBoxStyle 1.0 SpinBoxStyle.qml
TabViewStyle 1.0 TabViewStyle.qml
TableViewStyle 1.0 TableViewStyle.qml
TextFieldStyle 1.0 TextFieldStyle.qml
IconButtonStyle 1.0 IconButtonStyle.qml
src/styles/styles.pro
View file @
5c958bb8
...
...
@@ -27,6 +27,7 @@ QML_FILES = \
TextFieldStyle
.
qml
\
ToolBarStyle
.
qml
\
ToolButtonStyle
.
qml
\
IconButtonStyle
.
qml
#
Images
QML_FILES
+=
\
...
...
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