Skip to content

Commit e571885

Browse files
committed
UX improvements to photo, web view and external resource widget config
- Better explanatory text - Change '0' values to 'Auto' - Ad 'px' suffix to values - Allow resetting sizes to Auto with clear button
1 parent bcb2c73 commit e571885

File tree

3 files changed

+60
-12
lines changed

3 files changed

+60
-12
lines changed

src/ui/editorwidgets/qgsexternalresourceconfigdlg.ui

+21-5
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
<property name="geometry">
4646
<rect>
4747
<x>0</x>
48-
<y>-206</y>
48+
<y>-210</y>
4949
<width>465</width>
5050
<height>621</height>
5151
</rect>
@@ -316,9 +316,12 @@
316316
</widget>
317317
</item>
318318
<item row="2" column="2">
319-
<widget class="QSpinBox" name="mDocumentViewerHeight">
319+
<widget class="QgsSpinBox" name="mDocumentViewerHeight">
320+
<property name="specialValueText">
321+
<string>Auto</string>
322+
</property>
320323
<property name="suffix">
321-
<string/>
324+
<string> px</string>
322325
</property>
323326
<property name="prefix">
324327
<string/>
@@ -329,7 +332,13 @@
329332
</widget>
330333
</item>
331334
<item row="1" column="2">
332-
<widget class="QSpinBox" name="mDocumentViewerWidth">
335+
<widget class="QgsSpinBox" name="mDocumentViewerWidth">
336+
<property name="specialValueText">
337+
<string>Auto</string>
338+
</property>
339+
<property name="suffix">
340+
<string> px</string>
341+
</property>
333342
<property name="maximum">
334343
<number>10000</number>
335344
</property>
@@ -345,7 +354,7 @@
345354
<item row="1" column="3" rowspan="2">
346355
<widget class="QLabel" name="label_2">
347356
<property name="text">
348-
<string>Specify the size of the preview. If you leave it set to 0, an optimal size will be estimated.</string>
357+
<string>Specify the size of the preview. If you leave it set to Auto, an optimal size will be calculated.</string>
349358
</property>
350359
<property name="wordWrap">
351360
<bool>true</bool>
@@ -384,6 +393,13 @@
384393
</item>
385394
</layout>
386395
</widget>
396+
<customwidgets>
397+
<customwidget>
398+
<class>QgsSpinBox</class>
399+
<extends>QSpinBox</extends>
400+
<header>qgsspinbox.h</header>
401+
</customwidget>
402+
</customwidgets>
387403
<tabstops>
388404
<tabstop>scrollArea</tabstop>
389405
<tabstop>mRootPath</tabstop>

src/ui/editorwidgets/qgsphotoconfigdlgbase.ui

+20-4
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,13 @@
4141
</widget>
4242
</item>
4343
<item row="1" column="1">
44-
<widget class="QSpinBox" name="sbWidgetWidth">
44+
<widget class="QgsSpinBox" name="sbWidgetWidth">
45+
<property name="specialValueText">
46+
<string>Auto</string>
47+
</property>
48+
<property name="suffix">
49+
<string> px</string>
50+
</property>
4551
<property name="maximum">
4652
<number>10000</number>
4753
</property>
@@ -55,9 +61,12 @@
5561
</widget>
5662
</item>
5763
<item row="2" column="1">
58-
<widget class="QSpinBox" name="sbWidgetHeight">
64+
<widget class="QgsSpinBox" name="sbWidgetHeight">
65+
<property name="specialValueText">
66+
<string>Auto</string>
67+
</property>
5968
<property name="suffix">
60-
<string/>
69+
<string> px</string>
6170
</property>
6271
<property name="prefix">
6372
<string/>
@@ -70,7 +79,7 @@
7079
<item row="0" column="0" colspan="2">
7180
<widget class="QLabel" name="label">
7281
<property name="text">
73-
<string>Specify the size of the preview. If you leave it set to 0, an optimal size will be estimated.</string>
82+
<string>Specify the size of the preview. If you leave it set to &lt;i&gt;Auto&lt;/i&gt;, an optimal size will be calculated.</string>
7483
</property>
7584
<property name="wordWrap">
7685
<bool>true</bool>
@@ -82,6 +91,13 @@
8291
</item>
8392
</layout>
8493
</widget>
94+
<customwidgets>
95+
<customwidget>
96+
<class>QgsSpinBox</class>
97+
<extends>QSpinBox</extends>
98+
<header>qgsspinbox.h</header>
99+
</customwidget>
100+
</customwidgets>
85101
<resources/>
86102
<connections/>
87103
</ui>

src/ui/editorwidgets/qgswebviewconfigdlgbase.ui

+19-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,13 @@
4242
</spacer>
4343
</item>
4444
<item row="1" column="1">
45-
<widget class="QSpinBox" name="sbWidgetWidth">
45+
<widget class="QgsSpinBox" name="sbWidgetWidth">
46+
<property name="specialValueText">
47+
<string>Auto</string>
48+
</property>
49+
<property name="suffix">
50+
<string> px</string>
51+
</property>
4652
<property name="maximum">
4753
<number>10000</number>
4854
</property>
@@ -56,9 +62,12 @@
5662
</widget>
5763
</item>
5864
<item row="2" column="1">
59-
<widget class="QSpinBox" name="sbWidgetHeight">
65+
<widget class="QgsSpinBox" name="sbWidgetHeight">
66+
<property name="specialValueText">
67+
<string>Auto</string>
68+
</property>
6069
<property name="suffix">
61-
<string/>
70+
<string> px</string>
6271
</property>
6372
<property name="prefix">
6473
<string/>
@@ -83,6 +92,13 @@
8392
</item>
8493
</layout>
8594
</widget>
95+
<customwidgets>
96+
<customwidget>
97+
<class>QgsSpinBox</class>
98+
<extends>QSpinBox</extends>
99+
<header>qgsspinbox.h</header>
100+
</customwidget>
101+
</customwidgets>
86102
<resources/>
87103
<connections/>
88104
</ui>

0 commit comments

Comments
 (0)