mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-16 09:57:19 -05:00
Create component to wrap text and icon
This commit is contained in:
parent
b848422a2d
commit
fd38129b09
37
retroshare-qml-app/src/components/TextAndIcon.qml
Normal file
37
retroshare-qml-app/src/components/TextAndIcon.qml
Normal file
@ -0,0 +1,37 @@
|
||||
import QtQuick 2.0
|
||||
import QtQuick.Controls 2.0
|
||||
|
||||
|
||||
ToolButton
|
||||
{
|
||||
height: icon.height + 5
|
||||
|
||||
property alias iconUrl: icon.source
|
||||
property alias innerText: innerText.text
|
||||
|
||||
|
||||
Image
|
||||
{
|
||||
id: icon
|
||||
|
||||
height: innerText.contentHeight
|
||||
width: innerText.contentHeight
|
||||
|
||||
fillMode: Image.PreserveAspectFit
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 4
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
Text
|
||||
{
|
||||
id: innerText
|
||||
wrapMode: Text.WrapAnywhere
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: icon.right
|
||||
anchors.leftMargin: 5
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -46,5 +46,6 @@
|
||||
<file>icons/exit.svg</file>
|
||||
<file>icons/add.svg</file>
|
||||
<file>icons/keyring.svg</file>
|
||||
<file>components/TextAndIcon.qml</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
Loading…
Reference in New Issue
Block a user