2 * Copyright (C) 2012 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 Ubuntu.Components 0.1 as Theming
20/* FIXME: This component is duplicating the UbuntuShape from the SDK, but shapes more
21 * general (Item-based) components. This ability should be incorporated into the SDK's
22 * UbuntuShape so this file can be removed.
23 * Bug: https://bugs.launchpad.net/tavastia/+bug/1089595
29 Theming.ItemStyle.class: "UbuntuShape-radius-" + radius
31 property string radius: "small"
32 property url maskSource: Theming.ComponentUtils.style(shape, "maskSource", "")
33 property url borderSource: Theming.ComponentUtils.style(shape, "borderIdle", "")
36 implicitWidth: units.gu(8)
37 implicitHeight: units.gu(8)
39 onWidthChanged: __updateImageDimensions()
40 onHeightChanged: __updateImageDimensions()
41 onImageChanged: __updateImageDimensions()
43 function __updateImageDimensions() {
45 image.width = shape.width;
46 image.height = shape.height;
47 image.visible = false;
54 property ShaderEffectSource mask: ShaderEffectSource {
55 sourceItem: BorderImage {
58 source: shape.maskSource
63 property ShaderEffectSource image: ShaderEffectSource {
64 sourceItem: shape.image
69 varying highp vec2 qt_TexCoord0;
70 uniform lowp float qt_Opacity;
71 uniform sampler2D mask;
72 uniform sampler2D image;
76 lowp vec4 maskColor = texture2D(mask, qt_TexCoord0.st);
77 lowp vec4 imageColor = texture2D(image, qt_TexCoord0.st);
78 gl_FragColor = imageColor * maskColor.a * qt_Opacity;
87 source: shape.borderSource
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