Skip to content

Commit

Permalink
Merge pull request #41 from neochapay/theming
Browse files Browse the repository at this point in the history
Theming
  • Loading branch information
locusf authored Jun 9, 2017
2 parents d20c032 + 7197e40 commit 3858cd5
Show file tree
Hide file tree
Showing 105 changed files with 802 additions and 4,166 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
.directory
*.o
*.so
*.qmlc
moc_*
qrc_*
examples/touch/touch_nemo
.qmake.stash
*.spec.*
documentation.list
examples/touch/glacier-components
Makefile
installroot/
RPMS/
2 changes: 1 addition & 1 deletion examples/touch/content/AndroidDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Item {
anchors.right: parent.right
anchors.rightMargin: 20
anchors.verticalCenter: parent.verticalCenter
source: "../images/navigation_next_item.png"
source: "/usr/share/glacier-components/images/navigation_next_item.png"
}

MouseArea {
Expand Down
8 changes: 4 additions & 4 deletions examples/touch/content/ButtonPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
**
****************************************************************************/

import QtQuick 2.1
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
Expand All @@ -54,11 +54,11 @@ Page {
anchors.centerIn: parent

Button {
property bool isGlacier: Theme.name == "Glacier"
property bool isGlacier: true
anchors.margins: 20
text: isGlacier ? "Set Ugly Theme" : "Set Nice Theme"
onClicked: isGlacier ? Theme.loadFromFile("ugly.json")
: Theme.loadFromFile("glacier.json")
onClicked: isGlacier ? Theme.loadTheme("ugly")
: Theme.loadTheme("glacier")
}

Button {
Expand Down
2 changes: 1 addition & 1 deletion examples/touch/content/ButtonRowPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
**
****************************************************************************************/

import QtQuick 2.1
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
Expand Down
2 changes: 1 addition & 1 deletion examples/touch/content/CheckboxPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
**
****************************************************************************************/

import QtQuick 2.1
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
Expand Down
2 changes: 1 addition & 1 deletion examples/touch/content/LabelPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
**
****************************************************************************************/

import QtQuick 2.1
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
Expand Down
2 changes: 1 addition & 1 deletion examples/touch/content/ListViewPage.qml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import QtQuick 2.1
import QtQuick 2.6
import QtQuick.Controls 1.0
import QtQuick.Controls.Nemo 1.0
import QtQuick.Controls.Styles.Nemo 1.0
Expand Down
2 changes: 1 addition & 1 deletion examples/touch/content/LiveCoding.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* Boston, MA 02110-1301, USA.
*/

import QtQuick 2.1
import QtQuick 2.6
import QtQuick.Controls 1.0 //needed for the Stack attached property
import QtQuick.Controls.Nemo 1.0
import QtQuick.Layouts 1.0
Expand Down
2 changes: 1 addition & 1 deletion examples/touch/content/ProgressBarPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
**
****************************************************************************/

import QtQuick 2.1
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
Expand Down
2 changes: 1 addition & 1 deletion examples/touch/content/QueryDialogPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
**
****************************************************************************************/

import QtQuick 2.1
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
Expand Down
109 changes: 52 additions & 57 deletions examples/touch/content/SelectRollerPage.qml
Original file line number Diff line number Diff line change
@@ -1,80 +1,75 @@
import QtQuick 2.1
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: "Roller"
}

headerTools: HeaderToolsLayout { showBackButton: true; title: "Label" }
allowedOrientations: Qt.PortraitOrientation | Qt.LandscapeOrientation | Qt.InvertedLandscapeOrientation | Qt.InvertedPortraitOrientation


ListModel {
id: animalsModel
ListElement { name: "Ant";}
ListElement { name: "Flea"; }
ListElement { name: "Parrot"; }
ListElement { name: "Guinea pig";}
ListElement { name: "Rat";}
ListElement { name: "Butterfly";}
ListElement { name: "Dog";}
ListElement { name: "Cat";}
ListElement { name: "Pony";}
ListElement { name: "Koala";}
ListElement { name: "Horse";}
ListElement { name: "Tiger";}
ListElement { name: "Giraffe";}
ListElement { name: "Elephant";}
ListElement { name: "Whale";}
}


GlacierRoller {
id: simpleRoller
Column {
spacing: 40
width: parent.width
anchors{
top: parent.top
topMargin: 40
}

clip: true
model: animalsModel
label: qsTr("Choose your favorite animal")
delegate: GlacierRollerItem{
Text{
height: simpleRoller.itemHeight
text: name
color: "white"
font.pixelSize: 32
font.bold: (simpleRoller.activated && simpleRoller.currentIndex === index)
}
ListModel {
id: animalsModel
ListElement { name: "Ant";}
ListElement { name: "Flea"; }
ListElement { name: "Parrot"; }
ListElement { name: "Guinea pig";}
ListElement { name: "Rat";}
ListElement { name: "Butterfly";}
ListElement { name: "Dog";}
ListElement { name: "Cat";}
ListElement { name: "Pony";}
ListElement { name: "Koala";}
ListElement { name: "Horse";}
ListElement { name: "Tiger";}
ListElement { name: "Giraffe";}
ListElement { name: "Elephant";}
ListElement { name: "Whale";}
}
}

GlacierRoller {
id: simpleRoller2
width: parent.width
anchors{
top: simpleRoller.bottom
topMargin: 40
GlacierRoller {
id: simpleRoller
width: parent.width

clip: true
model: animalsModel
label: qsTr("Choose your favorite animal")
delegate: GlacierRollerItem{
Text{
height: simpleRoller.itemHeight
text: name
color: "white"
font.pixelSize: 32
font.bold: (simpleRoller.activated && simpleRoller.currentIndex === index)
}
}
}

clip: true
model: animalsModel
label: qsTr("Choose your second favorite animal")
GlacierRoller {
id: simpleRoller2
width: parent.width

clip: true
model: animalsModel
label: qsTr("Choose your second favorite animal")

delegate: GlacierRollerItem{
Text{
height: simpleRoller2.itemHeight
text: name
color: "white"
font.pixelSize: 32
font.bold: (simpleRoller2.activated && simpleRoller2.currentIndex === index)
delegate: GlacierRollerItem{
Text{
height: simpleRoller2.itemHeight
text: name
color: "white"
font.pixelSize: 32
font.bold: (simpleRoller2.activated && simpleRoller2.currentIndex === index)
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/touch/content/SliderPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
**
****************************************************************************/

import QtQuick 2.1
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
Expand Down
4 changes: 2 additions & 2 deletions examples/touch/content/TabBarPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
**
****************************************************************************/

import QtQuick 2.1
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
Expand Down Expand Up @@ -79,7 +79,7 @@ Page {
anchors.fill: parent
border.bottom: size.dp(8)
border.top: size.dp(8)
source: styleData.selected ? "../images/tab_selected.png":"../images/tabs_standard.png"
source: styleData.selected ? "/usr/share/glacier-components/images/tab_selected.png":"/usr/share/glacier-components/images/tabs_standard.png"
Text {
anchors.centerIn: parent
color: "white"
Expand Down
6 changes: 2 additions & 4 deletions examples/touch/content/TextInputPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
**
****************************************************************************/

import QtQuick 2.1
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
Expand Down Expand Up @@ -71,13 +71,11 @@ Page {
TextField {
anchors.margins: size.dp(20)
text: "Text input"
//style: touchStyle
}

TextField {
anchors.margins: size.dp(20)
text: "Readonly Text input"
//style: touchStyle
readOnly: true
}

Expand Down Expand Up @@ -112,7 +110,7 @@ Page {
implicitHeight: size.dp(50)
implicitWidth: size.dp(320)
BorderImage {
source: "../images/textinput.png"
source: "/usr/share/glacier-components/images/textinput.png"
border.left: size.dp(8)
border.right: size.dp(8)
anchors.bottom: parent.bottom
Expand Down
4 changes: 2 additions & 2 deletions examples/touch/glacier-gallery.desktop
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[Desktop Entry]
Type=Application
Name=Glacier UI
Name=Glacier components
Categories=Applications;
Exec=env QT_QUICK_CONTROLS_STYLE=Nemo /usr/lib/qt5/examples/touch_nemo
Exec=env QT_QUICK_CONTROLS_STYLE=Nemo /usr/bin/glacier-components
Icon=icon-app-components

X-Desktop-File-Install-Version=0.20
Expand Down
18 changes: 9 additions & 9 deletions examples/touch/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
**
****************************************************************************/

import QtQuick 2.1
import QtQuick 2.6
import QtQuick.Controls 1.0
import QtQuick.Controls.Nemo 1.0
import QtQuick.Controls.Styles.Nemo 1.0
Expand Down Expand Up @@ -126,9 +126,9 @@ ApplicationWindow {
id: tools

title: "Nemo Touch Gallery"
tools: [ ToolButton { iconSource: "../images/icon_cog.png"},
ToolButton { iconSource: "../images/icon_edit.png"},
ToolButton { iconSource: "../images/icon_refresh.png"} ]
tools: [ ToolButton { iconSource: "/usr/share/glacier-components/images/icon_cog.png"},
ToolButton { iconSource: "/usr/share/glacier-components/images/icon_edit.png"},
ToolButton { iconSource: "/usr/share/glacier-components/images/icon_refresh.png"} ]

//The parent of these items is null when this ToolsLayout is not used
//(i.e. you're on a different page) so we need to check the parent,
Expand Down Expand Up @@ -176,19 +176,19 @@ ApplicationWindow {
id: tool1
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
iconSource: "../images/icon_cog.png"
iconSource: "/usr/share/glacier-components/images/icon_cog.png"
}
ToolButton {
id: tool2
anchors.right: tool1.left
anchors.verticalCenter: parent.verticalCenter
iconSource: "../images/icon_edit.png"
iconSource: "/usr/share/glacier-components/images/icon_edit.png"
}
ToolButton {
id: tool3
anchors.right: tool2.left
anchors.verticalCenter: parent.verticalCenter
iconSource: "../images/icon_refresh.png"
iconSource: "/usr/share/glacier-components/images/icon_refresh.png"
}
},
ButtonRow {
Expand Down Expand Up @@ -219,8 +219,8 @@ ApplicationWindow {
model: pageModel
anchors.fill: parent
clip: true
delegate: AndroidDelegate {
text: title
delegate: ListViewItemWithActions {
label: title
onClicked: pageItem.Stack.view.push(Qt.resolvedUrl(page))
}
}
Expand Down
30 changes: 0 additions & 30 deletions examples/touch/resources.qrc

This file was deleted.

Loading

0 comments on commit 3858cd5

Please sign in to comment.