Skip to content

Commit

Permalink
Add circle item for clipping arbitrary items
Browse files Browse the repository at this point in the history
  • Loading branch information
iBelieve committed Jan 28, 2015
1 parent ccafd38 commit d462026
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
42 changes: 42 additions & 0 deletions modules/Material/Extras/CircleItem.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* QML Extras - Extra types and utilities to make QML even more awesome
*
* Copyright (C) 2015 Michael Spencer <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 2.1 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import QtQuick 2.3
import QtGraphicalEffects 1.0

Item {
id: item

property Item content

Image {
id: mask
source: Qt.resolvedUrl("images/circle.png")
anchors.fill: parent
smooth: true
visible: false
mipmap: true
}

OpacityMask {
anchors.fill: parent
source: content
maskSource: mask
}
}
1 change: 1 addition & 0 deletions modules/Material/Extras/qmldir
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module Material.Extras

CircleImage 0.1 CircleImage.qml
CircleItem 0.1 CircleItem.qml
Image 0.1 Image.qml
ColumnFlow 0.1 ColumnFlow.qml
Document 0.1 Document.qml
Expand Down

0 comments on commit d462026

Please sign in to comment.