| 1 |
/* |
| 2 |
* Copyright 2015 Canonical Ltd. |
| 3 |
* |
| 4 |
* This program is free software; you can redistribute it and/or modify |
| 5 |
* it under the terms of the GNU Lesser General Public License as published by |
| 6 |
* the Free Software Foundation; version 3. |
| 7 |
* |
| 8 |
* This program is distributed in the hope that it will be useful, |
| 9 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 |
* GNU Lesser General Public License for more details. |
| 12 |
* |
| 13 |
* You should have received a copy of the GNU Lesser General Public License |
| 14 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 |
*/ |
| 16 |
|
| 17 |
import QtQuick 2.4 |
| 18 |
import Lomiri.Components 1.3 |
| 19 |
import Lomiri.Components.Themes 1.0 |
| 20 |
|
| 21 |
MainView { |
| 22 |
objectName: "TopItem" |
| 23 |
width: units.gu(50) |
| 24 |
height: units.gu(100) |
| 25 |
|
| 26 |
theme.objectName: "MasterTheme" |
| 27 |
|
| 28 |
Column { |
| 29 |
objectName: "Column" |
| 30 |
anchors.fill: parent |
| 31 |
Label { |
| 32 |
text: "Hallo" |
| 33 |
} |
| 34 |
Button { |
| 35 |
text: "Theme change" |
| 36 |
onClicked: theme.name = "Lomiri.Components.Themes.SuruDark" |
| 37 |
} |
| 38 |
Button { |
| 39 |
text: "Reset palette" |
| 40 |
onClicked: customTheme.theme.palette = undefined |
| 41 |
} |
| 42 |
Button { |
| 43 |
text: "Lo" |
| 44 |
} |
| 45 |
|
| 46 |
TextField { |
| 47 |
objectName: "OuterText" |
| 48 |
property string styleName: theme.name |
| 49 |
onStyleNameChanged: print(objectName, styleName) |
| 50 |
} |
| 51 |
StyledItem { |
| 52 |
id: customTheme |
| 53 |
objectName: "SuruDarkStyled" |
| 54 |
width: parent.width |
| 55 |
height: units.gu(10) |
| 56 |
theme: ThemeSettings { |
| 57 |
objectName: "InnerTheme" |
| 58 |
id: thisTheme |
| 59 |
name: parentTheme.name |
| 60 |
// name: "Lomiri.Components.Themes.SuruDark" |
| 61 |
palette: Palette { |
| 62 |
id: config |
| 63 |
normal { |
| 64 |
foregroundText: LomiriColors.blue |
| 65 |
overlayText: "#BAFEDC" |
| 66 |
field: "lime" |
| 67 |
} |
| 68 |
selected { |
| 69 |
field: "teal" |
| 70 |
fieldText: "brown" |
| 71 |
foregroundText: Qt.rgba(0, 0, 1, 1) |
| 72 |
overlayText: config.normal.overlayText |
| 73 |
foreground: LomiriColors.green |
| 74 |
} |
| 75 |
} |
| 76 |
} |
| 77 |
property color myColor: theme.palette.selected.overlayText |
| 78 |
onMyColorChanged: print(myColor) |
| 79 |
|
| 80 |
TextField { |
| 81 |
objectName: "InnerText" |
| 82 |
property string styleName: theme.name |
| 83 |
onStyleNameChanged: print(objectName, styleName) |
| 84 |
} |
| 85 |
} |
| 86 |
} |
| 87 |
} |