Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[QgsQuick] Updated external resource widget
It has been enlarged, button changed Added a new component qgsquickicontextitem
- Loading branch information
Showing
4 changed files
with
165 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import QtQuick 2.5 | ||
import QtGraphicalEffects 1.0 | ||
import QgsQuick 0.1 as QgsQuick | ||
|
||
Item { | ||
property real iconSize | ||
property color fontColor | ||
property string iconSource | ||
property string labelText | ||
|
||
id: root | ||
width: root.iconSize + text.width | ||
height: root.iconSize | ||
|
||
Image { | ||
id: icon | ||
source: root.iconSource | ||
width: root.iconSize | ||
height: root.iconSize | ||
sourceSize.width: width | ||
sourceSize.height: height | ||
fillMode: Image.PreserveAspectFit | ||
} | ||
|
||
ColorOverlay { | ||
anchors.fill: icon | ||
source: icon | ||
color: root.fontColor | ||
} | ||
|
||
Text { | ||
id: text | ||
height: root.iconSize | ||
text: root.labelText | ||
font.pixelSize: root.iconSize * 0.75 | ||
color: root.fontColor | ||
anchors.leftMargin: root.iconSize + fieldItem.textMargin | ||
x: root.iconSize + fieldItem.textMargin | ||
horizontalAlignment: Text.AlignRight | ||
verticalAlignment: Text.AlignVCenter | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters