feat: Popup to show current project rules (#241)

* feat: Popup to show current project rules
* feat: Add icon to show project rules button
* feat: Add counter for active rules
This commit is contained in:
Petr Mironychev
2025-10-23 21:41:59 +02:00
committed by GitHub
parent e1025df21e
commit 608103b92e
9 changed files with 491 additions and 6 deletions

View File

@ -33,6 +33,8 @@ Rectangle {
property alias recentPath: recentPathId
property alias openChatHistory: openChatHistoryId
property alias pinButton: pinButtonId
property alias rulesButton: rulesButtonId
property alias activeRulesCount: activeRulesCountId.text
color: palette.window.hslLightness > 0.5 ?
Qt.darker(palette.window, 1.1) :
@ -126,6 +128,38 @@ Rectangle {
ToolTip.text: qsTr("Show in system")
}
QoAButton {
id: rulesButtonId
icon {
source: "qrc:/qt/qml/ChatView/icons/rules-icon.svg"
height: 15
width: 15
}
text: " "
ToolTip.visible: hovered
ToolTip.delay: 250
ToolTip.text: root.activeRulesCount > 0
? qsTr("View active project rules (%1)").arg(root.activeRulesCount)
: qsTr("View active project rules (no rules found)")
Text {
id: activeRulesCountId
anchors {
bottom: parent.bottom
bottomMargin: 2
right: parent.right
rightMargin: 4
}
color: palette.text
font.pixelSize: 10
font.bold: true
}
}
Item {
Layout.fillWidth: true
}