Cmake: Make line edit in formatter settings editable again

... and improve layout a bit

Change-Id: Ib1f7626259ca59190804faab5e2f453e8520de58
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
hjk
2023-07-14 15:02:24 +02:00
parent 955fa48b41
commit 0db2beeff9

View File

@@ -60,10 +60,12 @@ public:
autoFormatOnlyCurrentProject.setSettingsKey("autoFormatOnlyCurrentProject"); autoFormatOnlyCurrentProject.setSettingsKey("autoFormatOnlyCurrentProject");
autoFormatOnlyCurrentProject.setDefaultValue(true); autoFormatOnlyCurrentProject.setDefaultValue(true);
autoFormatOnlyCurrentProject.setLabelText(Tr::tr("Restrict to files contained in the current project")); autoFormatOnlyCurrentProject.setLabelText(Tr::tr("Restrict to files contained in the current project"));
autoFormatOnlyCurrentProject.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBox);
autoFormatMime.setSettingsKey("autoFormatMime"); autoFormatMime.setSettingsKey("autoFormatMime");
autoFormatMime.setDefaultValue("text/x-cmake"); autoFormatMime.setDefaultValue("text/x-cmake");
autoFormatMime.setLabelText(Tr::tr("Restrict to MIME types:")); autoFormatMime.setLabelText(Tr::tr("Restrict to MIME types:"));
autoFormatMime.setDisplayStyle(StringAspect::LineEditDisplay);
setLayouter([this] { setLayouter([this] {
using namespace Layouting; using namespace Layouting;
@@ -73,9 +75,12 @@ public:
Group { Group {
title(Tr::tr("Automatic Formatting on File Save")), title(Tr::tr("Automatic Formatting on File Save")),
autoFormatOnSave.groupChecker(), autoFormatOnSave.groupChecker(),
Form { // Conceptually, that's a Form, but this would look odd:
autoFormatMime, br, // xxxxxx [____]
Span(2, autoFormatOnlyCurrentProject) // [x] xxxxxxxxxxxxxx
Column {
Row { autoFormatMime },
autoFormatOnlyCurrentProject
} }
}, },
st st