linphone-desktop/linphone-app/ui/modules/Common/Form/Buttons/AbstractTextButton.qml
Julien Wadel 3031cc856a Fixes and Features : Fullscreen, crashs, contacts, messages
Fixes:

* Change download URL to `https://www.linphone.org/technical-corner/linphone`
* Crash on contacts list when deleting a friend and trying to load logs.
* Message status behaviour : Resuming status when changing logs, cursor shapes updates, bind the `resend message` action to error icon
* Synchronize settings and main presence.
* QML Crashs on fullscreen

Features :

* Add utilities in fullscreen view (media quality, security, mutable speaker)
* Show fullscreen on the current call screen
* Show Display name of participant in conference
* Participants in conference are mutable
2020-05-15 09:00:09 +02:00

95 lines
2.2 KiB
QML

import QtQuick 2.7
import QtQuick.Controls 2.2
import Common.Styles 1.0
// =============================================================================
Item {
id: wrappedButton
property color colorDisabled
property color colorHovered
property color colorNormal
property color colorPressed
// By default textColorNormal is the hovered/pressed text color.
property color textColorDisabled
property color textColorHovered: textColorNormal
property color textColorNormal
property color textColorPressed: textColorNormal
property alias text: button.text
property bool enabled: true
signal clicked
// ---------------------------------------------------------------------------
function _getBackgroundColor () {
if (!wrappedButton.enabled) {
return colorDisabled
}
return button.down
? colorPressed
: (button.hovered ? colorHovered : colorNormal)
}
function _getTextColor () {
if (!wrappedButton.enabled) {
return textColorDisabled
}
return button.down
? textColorPressed
: (button.hovered ? textColorHovered : textColorNormal)
}
// ---------------------------------------------------------------------------
height: AbstractTextButtonStyle.background.height
width: AbstractTextButtonStyle.background.width
// ---------------------------------------------------------------------------
Button {
id: button
background: Rectangle {
color: _getBackgroundColor()
radius: AbstractTextButtonStyle.background.radius
}
contentItem: Text {
color: _getTextColor()
font {
bold: true
pointSize: AbstractTextButtonStyle.text.pointSize
}
elide: Text.ElideRight
horizontalAlignment: Text.AlignHCenter
text: button.text
verticalAlignment: Text.AlignVCenter
}
hoverEnabled: true
MouseArea
{
id: mouseArea
anchors.fill: parent
onPressed: mouse.accepted = false
hoverEnabled: true
cursorShape: containsMouse
? Qt.PointingHandCursor
: Qt.ArrowCursor
}
height: parent.height
width: parent.width
onClicked: wrappedButton.enabled && parent.clicked()
}
}