mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Add new icons and icons features for future implementations
This commit is contained in:
parent
5acc8f6d8b
commit
6e3de73501
@ -114,17 +114,28 @@ Item
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.left: attachButton.right
|
||||
|
||||
width: chatView.width - sendButton.width - attachButton.width
|
||||
width: chatView.width - sendButton.width - attachButton.width - emojiButton.width
|
||||
height: parent.height -5
|
||||
|
||||
placeholderText: styles.placeHolder
|
||||
background: styles.background
|
||||
|
||||
onTextChanged: {
|
||||
if (msgComposer.length == 0)
|
||||
{
|
||||
sendButton.state = ""
|
||||
}
|
||||
else if (msgComposer.length > 0)
|
||||
{
|
||||
sendButton.state = "SENDBTN"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
BtnIcon {
|
||||
|
||||
id: sendButton
|
||||
id: emojiButton
|
||||
|
||||
property var styles: StyleChat.inferiorPanel.btnIcon
|
||||
|
||||
@ -134,14 +145,69 @@ Item
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: msgComposer.right
|
||||
|
||||
imgUrl: styles.sendIconUrl
|
||||
imgUrl: styles.emojiIconUrl
|
||||
}
|
||||
|
||||
BtnIcon {
|
||||
|
||||
id: sendButton
|
||||
|
||||
property var styles: StyleChat.inferiorPanel.btnIcon
|
||||
property alias icon: sendButton.imgUrl
|
||||
|
||||
height: styles.height
|
||||
width: styles.width
|
||||
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: emojiButton.right
|
||||
|
||||
imgUrl: styles.microIconUrl
|
||||
|
||||
onClicked:
|
||||
{
|
||||
var jsonData = {"chat_id":chatView.chatId, "msg":msgComposer.text}
|
||||
rsApi.request( "/chat/send_message", JSON.stringify(jsonData),
|
||||
function(par) { msgComposer.text = ""; } )
|
||||
if (sendButton.state == "SENDBTN" ) {
|
||||
var jsonData = {"chat_id":chatView.chatId, "msg":msgComposer.text}
|
||||
rsApi.request( "/chat/send_message", JSON.stringify(jsonData),
|
||||
function(par) { msgComposer.text = ""; } )
|
||||
}
|
||||
}
|
||||
|
||||
onPressed:
|
||||
{
|
||||
if (sendButton.state == "RECORDING" )
|
||||
{
|
||||
sendButton.state = ""
|
||||
}
|
||||
else if (sendButton.state == "" )
|
||||
{
|
||||
sendButton.state = "RECORDING"
|
||||
}
|
||||
}
|
||||
|
||||
onReleased:
|
||||
{
|
||||
if (sendButton.state == "RECORDING" )
|
||||
{
|
||||
sendButton.state = ""
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
states: [
|
||||
State {
|
||||
name: ""
|
||||
PropertyChanges { target: sendButton; icon: styles.microIconUrl}
|
||||
},
|
||||
State {
|
||||
name: "RECORDING"
|
||||
PropertyChanges { target: sendButton; icon: styles.microMuteIconUrl}
|
||||
},
|
||||
State {
|
||||
name: "SENDBTN"
|
||||
PropertyChanges { target: sendButton; icon: styles.sendIconUrl}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -4,8 +4,8 @@ Item {
|
||||
|
||||
id: root
|
||||
signal clicked
|
||||
// signal pressed
|
||||
// signal released
|
||||
signal pressed
|
||||
signal released
|
||||
|
||||
property var imgUrl: ""
|
||||
|
||||
@ -21,7 +21,7 @@ Item {
|
||||
MouseArea {
|
||||
anchors.fill: root
|
||||
onClicked: { root.clicked() }
|
||||
// onPressed: { root.pressed() }
|
||||
// onReleased: { root.released() }
|
||||
onPressed: { root.pressed() }
|
||||
onReleased: { root.released() }
|
||||
}
|
||||
}
|
||||
|
@ -46,8 +46,14 @@ QtObject {
|
||||
readonly property int width: 30
|
||||
readonly property int height: 30
|
||||
|
||||
readonly property int margin: 10
|
||||
|
||||
readonly property string sendIconUrl: "/icons/send-message.svg"
|
||||
readonly property string attachIconUrl: "/icons/attach.svg"
|
||||
readonly property string microIconUrl: "/icons/microphone.svg"
|
||||
readonly property string microMuteIconUrl: "/icons/microphone_mute.svg"
|
||||
readonly property string emojiIconUrl: "/icons/smiley.svg"
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user