2 * Copyright (C) 2014 Canonical, Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
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 General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18import Utils 0.1 as Utils
25 readonly property var parsedStyle: String(style)
26 .match(/^(color|gradient):\/\/\/(?:(#(?:[0-9a-f]{3,4}){1,2}|[a-z]{3,}))(?:\/(#(?:[0-9a-f]{3,4}){1,2}|[a-z]{3,}))?\/?$/i)
27 readonly property var luminance: {
28 if (!parsedStyle) return 0.5;
29 if (parsedStyle[1] === "color") return Utils.Style.luminance(parsedStyle[2]);
30 else if (parsedStyle[1] === "gradient") return Utils.Style.luminance(parsedStyle[2], parsedStyle[3]);
34 if (style == "") return null;
35 if (!parsedStyle) return image;
36 if (parsedStyle[1] === "color") return solid
37 if (parsedStyle[1] === "gradient") return gradient
40 onLoaded: if (item.hasOwnProperty("parsedStyle")) {
41 item.parsedStyle = Qt.binding(function() { return root.parsedStyle } );
50 property var parsedStyle
52 color: parsedStyle ? parsedStyle[2] : "#ffffff"
60 objectName: "gradient"
62 property var parsedStyle
65 GradientStop { position: 0; color: parsedStyle ? parsedStyle[2] : "#000000" }
66 GradientStop { position: 1; color: parsedStyle ? parsedStyle[3] : "#000000" }
77 source: width > 0 && height > 0 && root.style
79 sourceSize.width: width
80 sourceSize.height: height
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list