forked from Shinonome/dots-hyprland
booru: add api provider indicator
This commit is contained in:
@@ -7,10 +7,11 @@ import QtQuick.Layouts
|
|||||||
ToolTip {
|
ToolTip {
|
||||||
property string content
|
property string content
|
||||||
property bool extraVisibleCondition: true
|
property bool extraVisibleCondition: true
|
||||||
|
property bool alternativeVisibleCondition: false
|
||||||
property bool internalVisibleCondition: false
|
property bool internalVisibleCondition: false
|
||||||
padding: 7
|
padding: 7
|
||||||
|
|
||||||
visible: (extraVisibleCondition && (parent.hovered === undefined || parent?.hovered) && internalVisibleCondition)
|
visible: ((extraVisibleCondition && (parent.hovered === undefined || parent?.hovered) && internalVisibleCondition)) || alternativeVisibleCondition
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: parent
|
target: parent
|
||||||
@@ -36,7 +37,8 @@ ToolTip {
|
|||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
color: Appearance.colors.colTooltip
|
color: Appearance.colors.colTooltip
|
||||||
radius: Appearance.rounding.small
|
radius: Appearance.rounding.small
|
||||||
width: tooltipTextObject.width + 2 * padding
|
implicitWidth: tooltipTextObject.width + 2 * padding
|
||||||
|
implicitHeight: tooltipTextObject.height + 2 * padding
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
OpacityAnimator {
|
OpacityAnimator {
|
||||||
duration: Appearance.animation.elementDecel.duration
|
duration: Appearance.animation.elementDecel.duration
|
||||||
|
|||||||
@@ -71,6 +71,41 @@ Item {
|
|||||||
id: columnLayout
|
id: columnLayout
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
implicitHeight: providerRowLayout.implicitHeight + 5 * 2
|
||||||
|
implicitWidth: providerRowLayout.implicitWidth + 10 * 2
|
||||||
|
radius: Appearance.rounding.small
|
||||||
|
color: Appearance.colors.colLayer1
|
||||||
|
RowLayout {
|
||||||
|
id: providerRowLayout
|
||||||
|
anchors.centerIn: parent
|
||||||
|
|
||||||
|
MaterialSymbol {
|
||||||
|
text: "api"
|
||||||
|
font.pixelSize: Appearance.font.pixelSize.large
|
||||||
|
}
|
||||||
|
StyledText {
|
||||||
|
id: providerName
|
||||||
|
font.pixelSize: Appearance.font.pixelSize.large
|
||||||
|
font.weight: Font.DemiBold
|
||||||
|
color: Appearance.m3colors.m3onSurface
|
||||||
|
text: Booru.providers[Booru.currentProvider].name
|
||||||
|
}
|
||||||
|
}
|
||||||
|
StyledToolTip {
|
||||||
|
id: toolTip
|
||||||
|
alternativeVisibleCondition: mouseArea.containsMouse // Show tooltip when hovered
|
||||||
|
content: qsTr("The current API used. Endpoint: ") + Booru.providers[Booru.currentProvider].url + qsTr("\nSet with /mode PROVIDER")
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
id: mouseArea
|
||||||
|
anchors.fill: parent
|
||||||
|
hoverEnabled: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
|
|||||||
Reference in New Issue
Block a user