Skip to content

Commit b6e0d4b

Browse files
committed
liteeditor: fix goaddtags ui size
1 parent eb11fd4 commit b6e0d4b

File tree

3 files changed

+78
-14
lines changed

3 files changed

+78
-14
lines changed

liteidex/src/plugins/golangedit/goaddtagsdialog.cpp

+17-6
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,22 @@ GoAddTagsDialog::GoAddTagsDialog(QWidget *parent) :
3838
ui(new Ui::GoAddTagsDialog)
3939
{
4040
ui->setupUi(this);
41-
connect(ui->jsonGroupBox,SIGNAL(toggled(bool)),this,SLOT(updateaAguments()));
41+
42+
connect(ui->jsonCheckBox,SIGNAL(toggled(bool)),this,SLOT(updateaAguments()));
43+
connect(ui->jsonCheckBox,SIGNAL(toggled(bool)),ui->jsonGroupBox,SLOT(setEnabled(bool)));
44+
4245
connect(ui->jsonOptionsCheckBox,SIGNAL(toggled(bool)),this,SLOT(updateaAguments()));
4346
connect(ui->jsonOptionsLineEdit,SIGNAL(textChanged(QString)),this,SLOT(updateaAguments()));
4447

45-
connect(ui->xmlGroupBox,SIGNAL(toggled(bool)),this,SLOT(updateaAguments()));
48+
connect(ui->xmlCheckBox,SIGNAL(toggled(bool)),this,SLOT(updateaAguments()));
49+
connect(ui->xmlCheckBox,SIGNAL(toggled(bool)),ui->xmlGroupBox,SLOT(setEnabled(bool)));
50+
4651
connect(ui->xmlOptionsCheckBox,SIGNAL(toggled(bool)),this,SLOT(updateaAguments()));
4752
connect(ui->xmlOptionsLineEdit,SIGNAL(textChanged(QString)),this,SLOT(updateaAguments()));
4853

49-
connect(ui->customGroupBox,SIGNAL(toggled(bool)),this,SLOT(updateaAguments()));
54+
connect(ui->customCheckBox,SIGNAL(toggled(bool)),this,SLOT(updateaAguments()));
55+
connect(ui->customCheckBox,SIGNAL(toggled(bool)),ui->customGroupBox,SLOT(setEnabled(bool)));
56+
5057
connect(ui->customTagNameLineEdit1,SIGNAL(textChanged(QString)),this,SLOT(updateaAguments()));
5158
connect(ui->customTagOptionLineEdit1,SIGNAL(textChanged(QString)),this,SLOT(updateaAguments()));
5259
connect(ui->customTagNameLineEdit2,SIGNAL(textChanged(QString)),this,SLOT(updateaAguments()));
@@ -60,6 +67,10 @@ GoAddTagsDialog::GoAddTagsDialog(QWidget *parent) :
6067
connect(ui->sortCheckBox,SIGNAL(toggled(bool)),this,SLOT(updateaAguments()));
6168

6269
ui->snakeCaseRadioButton->setChecked(true);
70+
71+
ui->jsonGroupBox->setEnabled(false);
72+
ui->xmlGroupBox->setEnabled(false);
73+
ui->customGroupBox->setEnabled(false);
6374
}
6475

6576
GoAddTagsDialog::~GoAddTagsDialog()
@@ -90,7 +101,7 @@ void GoAddTagsDialog::updateaAguments()
90101
QStringList tagList;
91102
QStringList optList;
92103
QString tranform;
93-
if (ui->jsonGroupBox->isChecked()) {
104+
if (ui->jsonCheckBox->isChecked()) {
94105
tagList << "json";
95106
if (ui->jsonOptionsCheckBox->isChecked()) {
96107
QStringList opt = ui->jsonOptionsLineEdit->text().trimmed().split(",",QString::SkipEmptyParts);
@@ -99,7 +110,7 @@ void GoAddTagsDialog::updateaAguments()
99110
}
100111
}
101112
}
102-
if (ui->xmlGroupBox->isChecked()) {
113+
if (ui->xmlCheckBox->isChecked()) {
103114
tagList << "xml";
104115
if (ui->xmlOptionsCheckBox->isChecked()) {
105116
QStringList opt = ui->xmlOptionsLineEdit->text().trimmed().split(",",QString::SkipEmptyParts);
@@ -108,7 +119,7 @@ void GoAddTagsDialog::updateaAguments()
108119
}
109120
}
110121
}
111-
if (ui->customGroupBox->isChecked()) {
122+
if (ui->customCheckBox->isChecked()) {
112123
QString tag1 = ui->customTagNameLineEdit1->text().trimmed();
113124
QStringList opt1 = ui->customTagOptionLineEdit1->text().trimmed().split(",",QString::SkipEmptyParts);
114125
QString tag2 = ui->customTagNameLineEdit2->text().trimmed();

liteidex/src/plugins/golangedit/goaddtagsdialog.ui

+44-7
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,30 @@
77
<x>0</x>
88
<y>0</y>
99
<width>550</width>
10-
<height>400</height>
10+
<height>441</height>
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
1414
<string>Add Tags To Struct Field</string>
1515
</property>
1616
<layout class="QVBoxLayout" name="verticalLayout_2">
17+
<property name="spacing">
18+
<number>2</number>
19+
</property>
20+
<item>
21+
<widget class="QCheckBox" name="jsonCheckBox">
22+
<property name="text">
23+
<string>Add JSON Tag</string>
24+
</property>
25+
</widget>
26+
</item>
1727
<item>
1828
<widget class="QGroupBox" name="jsonGroupBox">
1929
<property name="title">
20-
<string>Add JSON Tag</string>
30+
<string/>
2131
</property>
2232
<property name="checkable">
23-
<bool>true</bool>
33+
<bool>false</bool>
2434
</property>
2535
<property name="checked">
2636
<bool>false</bool>
@@ -58,13 +68,20 @@
5868
</layout>
5969
</widget>
6070
</item>
71+
<item>
72+
<widget class="QCheckBox" name="xmlCheckBox">
73+
<property name="text">
74+
<string>Add XML Tag</string>
75+
</property>
76+
</widget>
77+
</item>
6178
<item>
6279
<widget class="QGroupBox" name="xmlGroupBox">
6380
<property name="title">
64-
<string>Add XML Tag</string>
81+
<string/>
6582
</property>
6683
<property name="checkable">
67-
<bool>true</bool>
84+
<bool>false</bool>
6885
</property>
6986
<property name="checked">
7087
<bool>false</bool>
@@ -102,13 +119,20 @@
102119
</layout>
103120
</widget>
104121
</item>
122+
<item>
123+
<widget class="QCheckBox" name="customCheckBox">
124+
<property name="text">
125+
<string>Add Custom Tags</string>
126+
</property>
127+
</widget>
128+
</item>
105129
<item>
106130
<widget class="QGroupBox" name="customGroupBox">
107131
<property name="title">
108-
<string>Add Custom Tags</string>
132+
<string/>
109133
</property>
110134
<property name="checkable">
111-
<bool>true</bool>
135+
<bool>false</bool>
112136
</property>
113137
<property name="checked">
114138
<bool>false</bool>
@@ -296,6 +320,19 @@
296320
<item>
297321
<widget class="QPlainTextEdit" name="argumentsEdit"/>
298322
</item>
323+
<item>
324+
<spacer name="verticalSpacer">
325+
<property name="orientation">
326+
<enum>Qt::Vertical</enum>
327+
</property>
328+
<property name="sizeHint" stdset="0">
329+
<size>
330+
<width>20</width>
331+
<height>40</height>
332+
</size>
333+
</property>
334+
</spacer>
335+
</item>
299336
<item>
300337
<widget class="QDialogButtonBox" name="buttonBox">
301338
<property name="orientation">

liteidex/src/plugins/golangedit/goremovetagsdialog.ui

+17-1
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,16 @@
77
<x>0</x>
88
<y>0</y>
99
<width>550</width>
10-
<height>360</height>
10+
<height>395</height>
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
1414
<string>Remove Tags From Struct Field</string>
1515
</property>
1616
<layout class="QVBoxLayout" name="verticalLayout">
17+
<property name="spacing">
18+
<number>2</number>
19+
</property>
1720
<item>
1821
<widget class="QGroupBox" name="groupBox">
1922
<property name="title">
@@ -132,6 +135,19 @@
132135
<item>
133136
<widget class="QPlainTextEdit" name="argumentsEdit"/>
134137
</item>
138+
<item>
139+
<spacer name="verticalSpacer">
140+
<property name="orientation">
141+
<enum>Qt::Vertical</enum>
142+
</property>
143+
<property name="sizeHint" stdset="0">
144+
<size>
145+
<width>20</width>
146+
<height>40</height>
147+
</size>
148+
</property>
149+
</spacer>
150+
</item>
135151
<item>
136152
<widget class="QDialogButtonBox" name="buttonBox">
137153
<property name="orientation">

0 commit comments

Comments
 (0)