panel title bar: add title, action buttons slot, divider; bt to popup mode; move wifi/bt toggles to title bar
This commit is contained in:
parent
46f14d5d36
commit
d4407ee538
7 changed files with 128 additions and 184 deletions
|
|
@ -8,6 +8,38 @@ M.HoverPanel {
|
|||
|
||||
contentWidth: 250
|
||||
panelNamespace: "nova-network"
|
||||
panelTitle: "Wi-Fi"
|
||||
titleActionsComponent: Component {
|
||||
Item {
|
||||
width: 20
|
||||
height: 20
|
||||
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
text: "\uF011"
|
||||
color: menuWindow._wifiEnabled ? menuWindow.accentColor : M.Theme.base04
|
||||
font.pixelSize: M.Theme.fontSize
|
||||
font.family: M.Theme.iconFontFamily
|
||||
|
||||
Behavior on color {
|
||||
ColorAnimation {
|
||||
duration: 100
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
HoverHandler {
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
}
|
||||
|
||||
TapHandler {
|
||||
onTapped: {
|
||||
radioProc._state = menuWindow._wifiEnabled ? "off" : "on";
|
||||
radioProc.running = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onVisibleChanged: if (visible)
|
||||
scanner.running = true
|
||||
|
|
@ -109,70 +141,6 @@ M.HoverPanel {
|
|||
}
|
||||
}
|
||||
|
||||
// Wi-Fi radio toggle header
|
||||
Item {
|
||||
width: menuWindow.contentWidth
|
||||
height: 36
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: 4
|
||||
anchors.rightMargin: 4
|
||||
color: headerHover.hovered ? M.Theme.base02 : "transparent"
|
||||
radius: M.Theme.radius
|
||||
}
|
||||
|
||||
Text {
|
||||
id: wifiHeaderIcon
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 12
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: "\uF1EB"
|
||||
color: menuWindow._wifiEnabled ? menuWindow.accentColor : M.Theme.base04
|
||||
font.pixelSize: M.Theme.fontSize + 1
|
||||
font.family: M.Theme.iconFontFamily
|
||||
}
|
||||
|
||||
Text {
|
||||
anchors.left: wifiHeaderIcon.right
|
||||
anchors.leftMargin: 8
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: "Wi-Fi"
|
||||
color: menuWindow._wifiEnabled ? M.Theme.base05 : M.Theme.base04
|
||||
font.pixelSize: M.Theme.fontSize
|
||||
font.family: M.Theme.fontFamily
|
||||
font.bold: true
|
||||
}
|
||||
|
||||
Text {
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 12
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: "\uF011"
|
||||
color: menuWindow._wifiEnabled ? menuWindow.accentColor : M.Theme.base04
|
||||
font.pixelSize: M.Theme.fontSize
|
||||
font.family: M.Theme.iconFontFamily
|
||||
}
|
||||
|
||||
HoverHandler {
|
||||
id: headerHover
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
}
|
||||
TapHandler {
|
||||
onTapped: {
|
||||
radioProc._state = menuWindow._wifiEnabled ? "off" : "on";
|
||||
radioProc.running = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
width: menuWindow.contentWidth - 16
|
||||
height: 1
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
color: M.Theme.base03
|
||||
}
|
||||
|
||||
Repeater {
|
||||
model: menuWindow._networks
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue