Bug 493581 - PromptDialog minimum width does not consider subtitle width if its text is set imperatively
Summary: PromptDialog minimum width does not consider subtitle width if its text is se...
Status: CONFIRMED
Alias: None
Product: frameworks-kirigami
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 6.6.0
Platform: Other Linux
: NOR normal
Target Milestone: Not decided
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-24 11:58 UTC by Plata
Modified: 2024-09-27 15:13 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Telly Skout (99.93 KB, image/png)
2024-09-24 11:58 UTC, Plata
Details
PromptDialog with long subtitle (108.43 KB, image/png)
2024-09-27 08:31 UTC, Akseli Lahtinen
Details
Minimal example (87.85 KB, image/png)
2024-09-27 10:26 UTC, Plata
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Plata 2024-09-24 11:58:25 UTC
Created attachment 174024 [details]
Telly Skout

SUMMARY
The PromptDialog width depends on the title only. This looks very weird if the title is short.

STEPS TO REPRODUCE
Create a PromptDialog with short title but long subtitle.

OBSERVED RESULT
The width of the PromptDialog is too small.

EXPECTED RESULT
The width is reasonable.

SOFTWARE/OS VERSIONS
KDE Plasma Version: 6.1.5
KDE Frameworks Version: 6.6.0
Qt Version: 6.7.2
Comment 1 Akseli Lahtinen 2024-09-27 08:31:49 UTC
Created attachment 174132 [details]
PromptDialog with long subtitle

I am unable to reproduce this using newest kirigami + kirigami-gallery

This is the prompt dialog code:

```qml

    Kirigami.PromptDialog {
        id: textPromptDialog
        title: "New Folder"
        subtitle: "Long subtitle aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"

        standardButtons: Kirigami.Dialog.NoButton
        customFooterActions: [
            Kirigami.Action {
                text: qsTr("Create Folder")
                icon.name: "dialog-ok"
                onTriggered: {
                    showPassiveNotification("Created");
                    textPromptDialog.close();
                }
            },
            Kirigami.Action {
                text: qsTr("Cancel")
                icon.name: "dialog-cancel"
                onTriggered: {
                    textPromptDialog.close();
                }
            }
        ]

        FormCard.FormTextFieldDelegate {
            label: qsTr("Folder name:")
            leftPadding: 0
            rightPadding: 0
        }
    }

```
Comment 2 Plata 2024-09-27 10:24:22 UTC
It works as expected if the subtitle is known at creation time.

Minimal example to reproduce the problem:
```qml
    Kirigami.PromptDialog {
        id: textPromptDialog
        title: "Title"
        subtitle: "empty"
        Component.onCompleted: {
            subtitle = "A long subtitle which should change the width of the PromptDialog"
        }
    }
```
Comment 3 Plata 2024-09-27 10:26:59 UTC
Created attachment 174134 [details]
Minimal example
Comment 4 Akseli Lahtinen 2024-09-27 11:27:10 UTC
(In reply to Plata from comment #2)
> It works as expected if the subtitle is known at creation time.
> 
> Minimal example to reproduce the problem:
> ```qml
>     Kirigami.PromptDialog {
>         id: textPromptDialog
>         title: "Title"
>         subtitle: "empty"
>         Component.onCompleted: {
>             subtitle = "A long subtitle which should change the width of the
> PromptDialog"
>         }
>     }
> ```

Thanks, i could repro it now!