Skip to content

Commit 58cb954

Browse files
ui: popups layuout improvements
- Removed hardcoded sizes for buttons. - Buttons horizontal layout adjusted to properly show the countdown (#1274). Note: 'Maximum' vertical policy does not seem to work with qt-material and QToolButton, the button height is resized to 0. 'Preferred' seems to work as expected.
1 parent 7ea473f commit 58cb954

File tree

1 file changed

+30
-124
lines changed

1 file changed

+30
-124
lines changed

ui/opensnitch/res/prompt.ui

Lines changed: 30 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>563</width>
10-
<height>339</height>
9+
<width>560</width>
10+
<height>316</height>
1111
</rect>
1212
</property>
1313
<property name="sizePolicy">
@@ -36,12 +36,12 @@
3636
<number>3</number>
3737
</property>
3838
<item row="1" column="0">
39-
<layout class="QHBoxLayout" name="horizontalLayout" stretch="3,2,1,1,0">
39+
<layout class="QHBoxLayout" name="horizontalLayout" stretch="3,2,2,1,0">
4040
<property name="spacing">
41-
<number>6</number>
41+
<number>3</number>
4242
</property>
4343
<property name="topMargin">
44-
<number>4</number>
44+
<number>3</number>
4545
</property>
4646
<item>
4747
<widget class="QComboBox" name="whatCombo">
@@ -51,18 +51,6 @@
5151
<verstretch>0</verstretch>
5252
</sizepolicy>
5353
</property>
54-
<property name="minimumSize">
55-
<size>
56-
<width>97</width>
57-
<height>26</height>
58-
</size>
59-
</property>
60-
<property name="maximumSize">
61-
<size>
62-
<width>204</width>
63-
<height>30</height>
64-
</size>
65-
</property>
6654
<item>
6755
<property name="text">
6856
<string>from this executable</string>
@@ -103,18 +91,6 @@
10391
<verstretch>0</verstretch>
10492
</sizepolicy>
10593
</property>
106-
<property name="minimumSize">
107-
<size>
108-
<width>97</width>
109-
<height>26</height>
110-
</size>
111-
</property>
112-
<property name="maximumSize">
113-
<size>
114-
<width>204</width>
115-
<height>30</height>
116-
</size>
117-
</property>
11894
<property name="currentText">
11995
<string>once</string>
12096
</property>
@@ -163,23 +139,11 @@
163139
<item>
164140
<widget class="QToolButton" name="actionButton">
165141
<property name="sizePolicy">
166-
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
142+
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
167143
<horstretch>0</horstretch>
168144
<verstretch>0</verstretch>
169145
</sizepolicy>
170146
</property>
171-
<property name="minimumSize">
172-
<size>
173-
<width>97</width>
174-
<height>26</height>
175-
</size>
176-
</property>
177-
<property name="maximumSize">
178-
<size>
179-
<width>204</width>
180-
<height>30</height>
181-
</size>
182-
</property>
183147
<property name="styleSheet">
184148
<string notr="true"/>
185149
</property>
@@ -206,18 +170,6 @@
206170
<verstretch>0</verstretch>
207171
</sizepolicy>
208172
</property>
209-
<property name="minimumSize">
210-
<size>
211-
<width>97</width>
212-
<height>26</height>
213-
</size>
214-
</property>
215-
<property name="maximumSize">
216-
<size>
217-
<width>204</width>
218-
<height>30</height>
219-
</size>
220-
</property>
221173
<property name="text">
222174
<string>Allow</string>
223175
</property>
@@ -230,21 +182,15 @@
230182
<item>
231183
<widget class="QPushButton" name="checkAdvanced">
232184
<property name="sizePolicy">
233-
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
185+
<sizepolicy hsizetype="Minimum" vsizetype="Maximum">
234186
<horstretch>0</horstretch>
235187
<verstretch>0</verstretch>
236188
</sizepolicy>
237189
</property>
238-
<property name="minimumSize">
239-
<size>
240-
<width>26</width>
241-
<height>26</height>
242-
</size>
243-
</property>
244190
<property name="maximumSize">
245191
<size>
246-
<width>40</width>
247-
<height>30</height>
192+
<width>35</width>
193+
<height>16777215</height>
248194
</size>
249195
</property>
250196
<property name="text">
@@ -469,7 +415,7 @@
469415
<item row="3" column="0">
470416
<widget class="QLabel" name="messageLabel">
471417
<property name="sizePolicy">
472-
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
418+
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
473419
<horstretch>0</horstretch>
474420
<verstretch>0</verstretch>
475421
</sizepolicy>
@@ -484,7 +430,7 @@
484430
<bool>true</bool>
485431
</property>
486432
<property name="margin">
487-
<number>5</number>
433+
<number>2</number>
488434
</property>
489435
<property name="textInteractionFlags">
490436
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
@@ -601,7 +547,7 @@
601547
</property>
602548
<property name="font">
603549
<font>
604-
<pointsize>16</pointsize>
550+
<pointsize>12</pointsize>
605551
<weight>75</weight>
606552
<bold>true</bold>
607553
<kerning>true</kerning>
@@ -727,7 +673,7 @@
727673
<item row="0" column="1">
728674
<widget class="QLabel" name="label_2">
729675
<property name="sizePolicy">
730-
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
676+
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
731677
<horstretch>0</horstretch>
732678
<verstretch>0</verstretch>
733679
</sizepolicy>
@@ -754,6 +700,12 @@
754700
</item>
755701
<item row="7" column="3">
756702
<widget class="QLabel" name="checksumLabel">
703+
<property name="sizePolicy">
704+
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
705+
<horstretch>0</horstretch>
706+
<verstretch>0</verstretch>
707+
</sizepolicy>
708+
</property>
757709
<property name="font">
758710
<font>
759711
<pointsize>10</pointsize>
@@ -781,23 +733,10 @@
781733
</property>
782734
</widget>
783735
</item>
784-
<item row="1" column="2">
785-
<spacer name="horizontalSpacer">
786-
<property name="orientation">
787-
<enum>Qt::Horizontal</enum>
788-
</property>
789-
<property name="sizeHint" stdset="0">
790-
<size>
791-
<width>20</width>
792-
<height>20</height>
793-
</size>
794-
</property>
795-
</spacer>
796-
</item>
797736
<item row="6" column="1">
798737
<widget class="QLabel" name="label_6">
799738
<property name="sizePolicy">
800-
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
739+
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
801740
<horstretch>0</horstretch>
802741
<verstretch>0</verstretch>
803742
</sizepolicy>
@@ -825,7 +764,7 @@
825764
<item row="2" column="1">
826765
<widget class="QLabel" name="label_3">
827766
<property name="sizePolicy">
828-
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
767+
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
829768
<horstretch>0</horstretch>
830769
<verstretch>0</verstretch>
831770
</sizepolicy>
@@ -846,17 +785,11 @@
846785
<item row="2" column="3">
847786
<widget class="QLabel" name="destIPLabel">
848787
<property name="sizePolicy">
849-
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
788+
<sizepolicy hsizetype="Minimum" vsizetype="Maximum">
850789
<horstretch>0</horstretch>
851790
<verstretch>0</verstretch>
852791
</sizepolicy>
853792
</property>
854-
<property name="minimumSize">
855-
<size>
856-
<width>90</width>
857-
<height>0</height>
858-
</size>
859-
</property>
860793
<property name="font">
861794
<font>
862795
<pointsize>10</pointsize>
@@ -895,17 +828,11 @@
895828
<item row="0" column="3">
896829
<widget class="QLabel" name="cwdLabel">
897830
<property name="sizePolicy">
898-
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
831+
<sizepolicy hsizetype="Minimum" vsizetype="Maximum">
899832
<horstretch>0</horstretch>
900833
<verstretch>0</verstretch>
901834
</sizepolicy>
902835
</property>
903-
<property name="minimumSize">
904-
<size>
905-
<width>90</width>
906-
<height>0</height>
907-
</size>
908-
</property>
909836
<property name="font">
910837
<font>
911838
<pointsize>10</pointsize>
@@ -922,24 +849,18 @@
922849
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
923850
</property>
924851
<property name="textInteractionFlags">
925-
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
852+
<set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
926853
</property>
927854
</widget>
928855
</item>
929856
<item row="6" column="3">
930857
<widget class="QLabel" name="uidLabel">
931858
<property name="sizePolicy">
932-
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
859+
<sizepolicy hsizetype="Minimum" vsizetype="Maximum">
933860
<horstretch>0</horstretch>
934861
<verstretch>0</verstretch>
935862
</sizepolicy>
936863
</property>
937-
<property name="minimumSize">
938-
<size>
939-
<width>90</width>
940-
<height>0</height>
941-
</size>
942-
</property>
943864
<property name="font">
944865
<font>
945866
<pointsize>10</pointsize>
@@ -963,14 +884,11 @@
963884
<item row="2" column="2">
964885
<widget class="QComboBox" name="whatIPCombo">
965886
<property name="sizePolicy">
966-
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
887+
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
967888
<horstretch>0</horstretch>
968889
<verstretch>0</verstretch>
969890
</sizepolicy>
970891
</property>
971-
<property name="minimumContentsLength">
972-
<number>0</number>
973-
</property>
974892
</widget>
975893
</item>
976894
<item row="2" column="0">
@@ -983,7 +901,7 @@
983901
<item row="5" column="1">
984902
<widget class="QLabel" name="destPortLabel_1">
985903
<property name="sizePolicy">
986-
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
904+
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
987905
<horstretch>0</horstretch>
988906
<verstretch>0</verstretch>
989907
</sizepolicy>
@@ -1004,17 +922,11 @@
1004922
<item row="5" column="3">
1005923
<widget class="QLabel" name="destPortLabel">
1006924
<property name="sizePolicy">
1007-
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
925+
<sizepolicy hsizetype="Minimum" vsizetype="Maximum">
1008926
<horstretch>0</horstretch>
1009927
<verstretch>0</verstretch>
1010928
</sizepolicy>
1011929
</property>
1012-
<property name="minimumSize">
1013-
<size>
1014-
<width>90</width>
1015-
<height>0</height>
1016-
</size>
1017-
</property>
1018930
<property name="font">
1019931
<font>
1020932
<pointsize>10</pointsize>
@@ -1038,7 +950,7 @@
1038950
<item row="1" column="1">
1039951
<widget class="QLabel" name="label">
1040952
<property name="sizePolicy">
1041-
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
953+
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
1042954
<horstretch>0</horstretch>
1043955
<verstretch>0</verstretch>
1044956
</sizepolicy>
@@ -1059,17 +971,11 @@
1059971
<item row="1" column="3">
1060972
<widget class="QLabel" name="sourceIPLabel">
1061973
<property name="sizePolicy">
1062-
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
974+
<sizepolicy hsizetype="Minimum" vsizetype="Maximum">
1063975
<horstretch>0</horstretch>
1064976
<verstretch>0</verstretch>
1065977
</sizepolicy>
1066978
</property>
1067-
<property name="minimumSize">
1068-
<size>
1069-
<width>90</width>
1070-
<height>0</height>
1071-
</size>
1072-
</property>
1073979
<property name="font">
1074980
<font>
1075981
<pointsize>10</pointsize>

0 commit comments

Comments
 (0)