Replace HToolButton usages with HButton
Also change sidePane toolbar: option button and filter rooms field
This commit is contained in:
parent
80067b5060
commit
2e8e042808
1
TODO.md
1
TODO.md
|
@ -7,7 +7,6 @@
|
||||||
|
|
||||||
- Bug fixes
|
- Bug fixes
|
||||||
- 100% CPU usage when hitting top edge to trigger messages loading
|
- 100% CPU usage when hitting top edge to trigger messages loading
|
||||||
- Fix tooltip hide()
|
|
||||||
- Sending `![A picture](https://picsum.photos/256/256)` → not clickable?
|
- Sending `![A picture](https://picsum.photos/256/256)` → not clickable?
|
||||||
- Icons aren't reloaded
|
- Icons aren't reloaded
|
||||||
- Bug when resizing window being tiled (i3), can't figure it out
|
- Bug when resizing window being tiled (i3), can't figure it out
|
||||||
|
|
|
@ -3,11 +3,14 @@ import QtQuick.Controls 2.2
|
||||||
import QtQuick.Layouts 1.4
|
import QtQuick.Layouts 1.4
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
|
property string iconName: ""
|
||||||
|
property var iconDimension: null
|
||||||
|
property bool circle: false
|
||||||
|
|
||||||
property int fontSize: HStyle.fontSize.normal
|
property int fontSize: HStyle.fontSize.normal
|
||||||
property color backgroundColor: "lightgray"
|
property color backgroundColor: "lightgray"
|
||||||
property alias overlayOpacity: buttonBackgroundOverlay.opacity
|
property alias overlayOpacity: buttonBackgroundOverlay.opacity
|
||||||
property string iconName: ""
|
|
||||||
property bool circle: false
|
|
||||||
property bool loading: false
|
property bool loading: false
|
||||||
|
|
||||||
property int contentWidth: 0
|
property int contentWidth: 0
|
||||||
|
@ -53,7 +56,7 @@ Button {
|
||||||
|
|
||||||
HIcon {
|
HIcon {
|
||||||
svgName: loading ? "hourglass" : iconName
|
svgName: loading ? "hourglass" : iconName
|
||||||
dimension: contentLayout.height
|
dimension: iconDimension || contentLayout.height
|
||||||
}
|
}
|
||||||
|
|
||||||
HLabel {
|
HLabel {
|
||||||
|
|
|
@ -1,31 +0,0 @@
|
||||||
import QtQuick 2.7
|
|
||||||
import QtQuick.Controls 2.2
|
|
||||||
import QtQuick.Layouts 1.4
|
|
||||||
|
|
||||||
ToolButton {
|
|
||||||
property string tooltip: ""
|
|
||||||
property string iconName: ""
|
|
||||||
|
|
||||||
id: button
|
|
||||||
display: ToolButton.IconOnly
|
|
||||||
icon.source: "../../icons/" + iconName + ".svg"
|
|
||||||
background: Rectangle { color: "transparent" }
|
|
||||||
|
|
||||||
onClicked: toolTip.hide()
|
|
||||||
|
|
||||||
ToolTip {
|
|
||||||
id: toolTip
|
|
||||||
text: tooltip
|
|
||||||
delay: Qt.styleHints.mousePressAndHoldInterval
|
|
||||||
visible: text ? toolTipZone.containsMouse : false
|
|
||||||
}
|
|
||||||
MouseArea {
|
|
||||||
id: toolTipZone
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
acceptedButtons: Qt.NoButton // Make button receive clicks normally
|
|
||||||
|
|
||||||
onEntered: button.background.color = "#656565"
|
|
||||||
onExited: button.background.color = "transparent"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -50,16 +50,14 @@ ColumnLayout {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Base.HToolButton {
|
Base.HButton {
|
||||||
id: toggleExpand
|
id: toggleExpand
|
||||||
iconName: roomList.visible ? "up" : "down"
|
iconName: roomList.visible ? "up" : "down"
|
||||||
Layout.maximumWidth: 28
|
iconDimension: 16
|
||||||
Layout.minimumHeight: row.height
|
backgroundColor: "transparent"
|
||||||
|
onClicked: roomList.visible = ! roomList.visible
|
||||||
|
|
||||||
onClicked: {
|
Layout.preferredHeight: row.height
|
||||||
toggleExpand.ToolTip.hide()
|
|
||||||
roomList.visible = ! roomList.visible
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,47 +3,20 @@ import QtQuick.Controls 2.2
|
||||||
import QtQuick.Layouts 1.4
|
import QtQuick.Layouts 1.4
|
||||||
import "../base" as Base
|
import "../base" as Base
|
||||||
|
|
||||||
RowLayout {
|
Base.HRowLayout {
|
||||||
id: toolBar
|
id: toolBar
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.maximumHeight: 32
|
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
HToolButton {
|
Layout.fillWidth: true
|
||||||
visible: ! toolBarIsBig()
|
Layout.preferredHeight: 32
|
||||||
iconName: "reduced_menu"
|
|
||||||
tooltip: "Menu"
|
|
||||||
}
|
|
||||||
|
|
||||||
HToolButton {
|
Base.HButton { iconName: "settings" }
|
||||||
iconName: "settings"
|
|
||||||
tooltip: "Settings"
|
|
||||||
}
|
|
||||||
|
|
||||||
HToolButton {
|
Base.HTextField {
|
||||||
iconName: "add_account"
|
|
||||||
tooltip: "Add new account"
|
|
||||||
}
|
|
||||||
|
|
||||||
HToolButton {
|
|
||||||
iconName: "set_status"
|
|
||||||
tooltip: "Set status for all accounts"
|
|
||||||
}
|
|
||||||
|
|
||||||
HToolButton {
|
|
||||||
iconName: "search"
|
|
||||||
tooltip: "Filter rooms"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
TextField {
|
|
||||||
id: filterField
|
id: filterField
|
||||||
visible: false
|
|
||||||
placeholderText: qsTr("Filter rooms")
|
placeholderText: qsTr("Filter rooms")
|
||||||
selectByMouse: true
|
|
||||||
font.family: "Roboto"
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.fillHeight: true
|
Layout.preferredHeight: 32
|
||||||
background: Rectangle { color: "lightgray" }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
import QtQuick 2.7
|
|
||||||
import QtQuick.Controls 2.2
|
|
||||||
import QtQuick.Layouts 1.4
|
|
||||||
import "../base" as Base
|
|
||||||
|
|
||||||
Base.HToolButton {
|
|
||||||
function toolBarIsBig() {
|
|
||||||
return sidePane.width >
|
|
||||||
Layout.minimumWidth * (toolBar.children.length - 2)
|
|
||||||
}
|
|
||||||
|
|
||||||
id: button
|
|
||||||
visible: toolBarIsBig()
|
|
||||||
Layout.fillHeight: true
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.minimumWidth: height
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user