2020-05-19 19:49:52 +00:00
|
|
|
import QtQuick 2.7
|
|
|
|
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import QtQuick.Controls.Styles 1.4
|
|
|
|
import QtGraphicalEffects 1.12
|
|
|
|
import "." as Widgets
|
2020-05-19 20:25:56 +00:00
|
|
|
import "theme"
|
2020-05-19 19:49:52 +00:00
|
|
|
|
|
|
|
// IconTextField integrates a text field and an icon
|
|
|
|
TextField {
|
2020-08-28 22:08:33 +00:00
|
|
|
color: Theme.textfieldTextColor
|
2020-05-19 19:49:52 +00:00
|
|
|
font.pixelSize: Theme.secondaryTextSize * gcd.themeScale * gcd.themeScale
|
|
|
|
width: parent.width - 20
|
|
|
|
property alias icon: icon_.source
|
|
|
|
signal clicked
|
|
|
|
smooth: true
|
|
|
|
placeholderTextColor: Theme.altTextColor
|
|
|
|
|
|
|
|
|
|
|
|
background: Rectangle {
|
|
|
|
radius: 10
|
2020-08-28 22:08:33 +00:00
|
|
|
color: Theme.textfieldBackgroundColor
|
|
|
|
border.color: Theme.textfieldBorderColor
|
2020-05-19 19:49:52 +00:00
|
|
|
layer.enabled: true
|
|
|
|
layer.effect: DropShadow {
|
|
|
|
transparentBorder: true
|
|
|
|
horizontalOffset: 0
|
|
|
|
verticalOffset: 0
|
|
|
|
samples: 10
|
|
|
|
radius: 8
|
|
|
|
color: Theme.dropShadowColor
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Widgets.Icon {
|
|
|
|
id: icon_
|
|
|
|
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: 4
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
|
|
|
|
height: parent.height-4;
|
|
|
|
width: parent.height-4;
|
|
|
|
|
2020-08-28 22:08:33 +00:00
|
|
|
iconColor: Theme.textfieldTextColor
|
|
|
|
backgroundColor: Theme.textfieldBackgroundColor
|
2020-05-19 19:49:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|