2023-06-07 18:28:32 +08:00
|
|
|
import QtQuick
|
|
|
|
|
import QtQuick.Controls
|
|
|
|
|
import QtQuick.Layouts
|
|
|
|
|
|
2024-07-07 13:42:38 +03:00
|
|
|
import Style 1.0
|
|
|
|
|
|
2023-06-07 18:28:32 +08:00
|
|
|
import "../Controls2"
|
|
|
|
|
import "../Controls2/TextTypes"
|
|
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
|
id: root
|
|
|
|
|
|
2023-06-27 19:07:42 +09:00
|
|
|
property real rootWidth: root.width
|
2023-06-07 18:28:32 +08:00
|
|
|
property int currentIndex
|
|
|
|
|
|
|
|
|
|
implicitWidth: transportProtoButtonGroup.implicitWidth
|
|
|
|
|
implicitHeight: transportProtoButtonGroup.implicitHeight
|
|
|
|
|
|
2024-08-20 16:54:05 +07:00
|
|
|
color: AmneziaStyle.color.onyxBlack
|
2023-06-07 18:28:32 +08:00
|
|
|
radius: 16
|
|
|
|
|
|
2024-04-18 17:54:55 +04:00
|
|
|
onFocusChanged: {
|
|
|
|
|
if (focus) {
|
|
|
|
|
udpButton.forceActiveFocus()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-06-07 18:28:32 +08:00
|
|
|
RowLayout {
|
|
|
|
|
id: transportProtoButtonGroup
|
|
|
|
|
|
|
|
|
|
spacing: 0
|
|
|
|
|
|
|
|
|
|
HorizontalRadioButton {
|
2024-04-18 17:54:55 +04:00
|
|
|
id: udpButton
|
2023-06-07 18:28:32 +08:00
|
|
|
checked: root.currentIndex === 0
|
|
|
|
|
|
2023-07-13 11:29:26 +09:00
|
|
|
hoverEnabled: root.enabled
|
|
|
|
|
|
2023-06-07 18:28:32 +08:00
|
|
|
implicitWidth: (rootWidth - 32) / 2
|
|
|
|
|
text: "UDP"
|
|
|
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
|
root.currentIndex = 0
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
HorizontalRadioButton {
|
2024-04-18 17:54:55 +04:00
|
|
|
id: tcpButton
|
2023-06-07 18:28:32 +08:00
|
|
|
checked: root.currentIndex === 1
|
|
|
|
|
|
2023-07-13 11:29:26 +09:00
|
|
|
hoverEnabled: root.enabled
|
|
|
|
|
|
2023-06-07 18:28:32 +08:00
|
|
|
implicitWidth: (rootWidth - 32) / 2
|
|
|
|
|
text: "TCP"
|
|
|
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
|
root.currentIndex = 1
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|