Skip to content

Commit 820e169

Browse files
committed
GUI: Improve the Application dialog layoyt.
In GNOME the whole big text area was not shown without making the dialog bigger. So improve the layout for better scaling and adjust dialog size when it gets initialized.
1 parent cfd570e commit 820e169

File tree

2 files changed

+91
-62
lines changed

2 files changed

+91
-62
lines changed

gui/application.ui

Lines changed: 90 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,33 @@
1010
<x>0</x>
1111
<y>0</y>
1212
<width>569</width>
13-
<height>328</height>
13+
<height>471</height>
1414
</rect>
1515
</property>
16+
<property name="sizePolicy">
17+
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
18+
<horstretch>0</horstretch>
19+
<verstretch>0</verstretch>
20+
</sizepolicy>
21+
</property>
1622
<property name="windowTitle">
1723
<string>Add an application</string>
1824
</property>
19-
<layout class="QVBoxLayout" name="verticalLayout">
25+
<layout class="QVBoxLayout" name="verticalLayout_4">
2026
<item>
2127
<widget class="QLabel" name="label">
28+
<property name="sizePolicy">
29+
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
30+
<horstretch>0</horstretch>
31+
<verstretch>0</verstretch>
32+
</sizepolicy>
33+
</property>
34+
<property name="minimumSize">
35+
<size>
36+
<width>0</width>
37+
<height>0</height>
38+
</size>
39+
</property>
2240
<property name="text">
2341
<string>Here you can add an application that can open error files. Specify a name for the application, the application executable and command line parameters for the application.
2442

@@ -29,92 +47,102 @@ The following texts in parameters are replaced with appropriate values when appl
2947
(severity) - Error severity
3048

3149
Example opening a file with Kate and make Kate scroll to the correct line:
32-
executable: kate
33-
parameters: -l(line) (file)</string>
50+
Executable: kate
51+
Parameters: -l(line) (file)</string>
3452
</property>
3553
<property name="textFormat">
3654
<enum>Qt::AutoText</enum>
3755
</property>
56+
<property name="scaledContents">
57+
<bool>false</bool>
58+
</property>
59+
<property name="alignment">
60+
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
61+
</property>
3862
<property name="wordWrap">
3963
<bool>true</bool>
4064
</property>
4165
</widget>
4266
</item>
4367
<item>
44-
<layout class="QHBoxLayout" name="horizontalLayout_2">
68+
<layout class="QVBoxLayout" name="verticalLayout_3">
4569
<item>
46-
<layout class="QVBoxLayout" name="verticalLayout_3">
70+
<layout class="QHBoxLayout" name="horizontalLayout">
4771
<item>
48-
<widget class="QLabel" name="label_2">
49-
<property name="text">
50-
<string>&amp;Application's name:</string>
51-
</property>
52-
<property name="buddy">
53-
<cstring>mName</cstring>
54-
</property>
55-
</widget>
72+
<layout class="QVBoxLayout" name="verticalLayout_2">
73+
<item>
74+
<widget class="QLabel" name="label_2">
75+
<property name="text">
76+
<string>&amp;Name:</string>
77+
</property>
78+
<property name="buddy">
79+
<cstring>mName</cstring>
80+
</property>
81+
</widget>
82+
</item>
83+
<item>
84+
<widget class="QLabel" name="label_3">
85+
<property name="text">
86+
<string>&amp;Executable:</string>
87+
</property>
88+
<property name="buddy">
89+
<cstring>mPath</cstring>
90+
</property>
91+
</widget>
92+
</item>
93+
<item>
94+
<widget class="QLabel" name="label_4">
95+
<property name="text">
96+
<string>&amp;Parameters:</string>
97+
</property>
98+
<property name="buddy">
99+
<cstring>mParameters</cstring>
100+
</property>
101+
</widget>
102+
</item>
103+
</layout>
56104
</item>
57105
<item>
58-
<widget class="QLabel" name="label_3">
59-
<property name="text">
60-
<string>&amp;Executable:</string>
61-
</property>
62-
<property name="buddy">
63-
<cstring>mPath</cstring>
64-
</property>
65-
</widget>
66-
</item>
67-
<item>
68-
<widget class="QLabel" name="label_4">
69-
<property name="text">
70-
<string>&amp;Parameters:</string>
71-
</property>
72-
<property name="buddy">
73-
<cstring>mParameters</cstring>
74-
</property>
75-
</widget>
106+
<layout class="QVBoxLayout" name="verticalLayout">
107+
<item>
108+
<widget class="QLineEdit" name="mName"/>
109+
</item>
110+
<item>
111+
<widget class="QLineEdit" name="mPath"/>
112+
</item>
113+
<item>
114+
<widget class="QLineEdit" name="mParameters"/>
115+
</item>
116+
</layout>
76117
</item>
77118
</layout>
78119
</item>
79120
<item>
80-
<layout class="QVBoxLayout" name="verticalLayout_2">
81-
<item>
82-
<widget class="QLineEdit" name="mName"/>
83-
</item>
121+
<layout class="QHBoxLayout" name="horizontalLayout_2">
84122
<item>
85-
<widget class="QLineEdit" name="mPath"/>
123+
<spacer name="horizontalSpacer">
124+
<property name="orientation">
125+
<enum>Qt::Horizontal</enum>
126+
</property>
127+
<property name="sizeHint" stdset="0">
128+
<size>
129+
<width>40</width>
130+
<height>20</height>
131+
</size>
132+
</property>
133+
</spacer>
86134
</item>
87135
<item>
88-
<widget class="QLineEdit" name="mParameters"/>
136+
<widget class="QPushButton" name="mButtonBrowse">
137+
<property name="text">
138+
<string>Browse</string>
139+
</property>
140+
</widget>
89141
</item>
90142
</layout>
91143
</item>
92144
</layout>
93145
</item>
94-
<item>
95-
<layout class="QHBoxLayout" name="horizontalLayout">
96-
<item>
97-
<spacer name="horizontalSpacer">
98-
<property name="orientation">
99-
<enum>Qt::Horizontal</enum>
100-
</property>
101-
<property name="sizeHint" stdset="0">
102-
<size>
103-
<width>40</width>
104-
<height>20</height>
105-
</size>
106-
</property>
107-
</spacer>
108-
</item>
109-
<item>
110-
<widget class="QPushButton" name="mButtonBrowse">
111-
<property name="text">
112-
<string>Browse</string>
113-
</property>
114-
</widget>
115-
</item>
116-
</layout>
117-
</item>
118146
<item>
119147
<widget class="QDialogButtonBox" name="mButtons">
120148
<property name="orientation">

gui/applicationdialog.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ ApplicationDialog::ApplicationDialog(const QString &title,
4040
mUI.mName->setText(app.getName());
4141
mUI.mParameters->setText(app.getParameters());
4242
setWindowTitle(title);
43+
adjustSize();
4344
}
4445

4546

0 commit comments

Comments
 (0)