Make sure that the style menu shows the right style name for code and quote.

Also when in quote mode the valid styles are now transformed to how they look in quote to show they are valid. Clicking quote style again in a quote block will return to paragrpah style from heading now
This commit is contained in:
James Graham
2026-02-07 17:18:26 +00:00
parent 7afce01a23
commit 13d7f9b322
11 changed files with 110 additions and 18 deletions

View File

@@ -57,6 +57,7 @@ RowLayout {
readonly property ChatButtonHelper chatButtonHelper: ChatButtonHelper {
textItem: root.contentModel.focusedTextItem
inQuote: root.contentModel.focusType == LibNeoChat.MessageComponentType.Quote
}
signal clicked
@@ -195,11 +196,12 @@ RowLayout {
}
StyleButton {
id: styleButton
Layout.minimumWidth: compressed ? -1 : Kirigami.Units.gridUnit * 8 + Kirigami.Units.largeSpacing * 2
Layout.minimumWidth: compressed ? -1 : Kirigami.Units.gridUnit * 10 + Kirigami.Units.largeSpacing * 2
icon.name: "typewriter"
text: i18nc("@action:button", "Text Style")
style: root.chatButtonHelper.currentStyle
inQuote: root.contentModel.focusType == LibNeoChat.MessageComponentType.Quote
compressed: root.maxAvailableWidth < root.extraTextCompressedImplicitWidth
enabled: root.chatButtonHelper.styleFormatEnabled
display: QQC2.AbstractButton.IconOnly
@@ -216,8 +218,10 @@ RowLayout {
StylePicker {
id: styleMenu
width: styleButton.compressed ? implicitWidth : styleButton.width
chatContentModel: root.contentModel
chatButtonHelper: root.chatButtonHelper
inQuote: root.contentModel.focusType == LibNeoChat.MessageComponentType.Quote
onClosed: {
root.clicked()