File tree 6 files changed +136
-78
lines changed
6 files changed +136
-78
lines changed Original file line number Diff line number Diff line change @@ -360,6 +360,10 @@ class Settings {
360
360
/* * Enable the start and end date fields for new trips by default. */
361
361
inline static const Setting<bool > tripDialog_datesEnabledInitially = Setting<bool > (" tripDialog/datesEnabledInitially" , true );
362
362
363
+ // Ascent viewer
364
+ /* * Show the ascent title below the peak name in the peak info box instead of the ascent info box in the ascent viewer. */
365
+ inline static const Setting<bool > ascentViewer_ascentTitleUnderPeakName = Setting<bool > (" ascentViewer/ascentTitleUnderPeakName" , false );
366
+
363
367
364
368
// === IMPLICIT ===
365
369
Original file line number Diff line number Diff line change @@ -123,6 +123,8 @@ void SettingsWindow::loadSettings()
123
123
124
124
tripDatesCheckbox ->setChecked (tripDialog_datesEnabledInitially .get ());
125
125
126
+ ascentTitleUnderPeakNameCheckbox ->setChecked (ascentViewer_ascentTitleUnderPeakName .get ());
127
+
126
128
updateEnabled ();
127
129
}
128
130
@@ -163,6 +165,8 @@ void SettingsWindow::loadDefaults()
163
165
164
166
tripDatesCheckbox ->setChecked (tripDialog_datesEnabledInitially .getDefault ());
165
167
168
+ ascentTitleUnderPeakNameCheckbox ->setChecked (ascentViewer_ascentTitleUnderPeakName .getDefault ());
169
+
166
170
updateEnabled ();
167
171
}
168
172
@@ -211,6 +215,8 @@ void SettingsWindow::saveSettings()
211
215
212
216
tripDialog_datesEnabledInitially .set (tripDatesCheckbox ->isChecked ());
213
217
218
+ ascentViewer_ascentTitleUnderPeakName .set (ascentTitleUnderPeakNameCheckbox ->isChecked ());
219
+
214
220
if (languageBefore != language.get ()) {
215
221
QString title = tr (" Language setting changed" );
216
222
QString message = tr (" Changing the language requires a restart." );
@@ -391,4 +397,4 @@ void SettingsWindow::applyStyle(QString styleString)
391
397
void SettingsWindow::reject ()
392
398
{
393
399
handle_cancel ();
394
- }
400
+ }
Original file line number Diff line number Diff line change 62
62
<x >0</x >
63
63
<y >0</y >
64
64
<width >422</width >
65
- <height >844 </height >
65
+ <height >836 </height >
66
66
</rect >
67
67
</property >
68
68
<property name =" sizePolicy" >
524
524
<widget class =" QLabel" name =" ascentTitleLabel" >
525
525
<property name =" font" >
526
526
<font >
527
- <pointsize >20 </pointsize >
527
+ <pointsize >16 </pointsize >
528
528
</font >
529
529
</property >
530
530
<property name =" text" >
Original file line number Diff line number Diff line change 7
7
<x >0</x >
8
8
<y >0</y >
9
9
<width >400</width >
10
- <height >823 </height >
10
+ <height >895 </height >
11
11
</rect >
12
12
</property >
13
13
<property name =" sizePolicy" >
45
45
<number >10</number >
46
46
</property >
47
47
<item >
48
- <layout class =" QFormLayout" name =" topSettingsLayout " >
48
+ <layout class =" QFormLayout" name =" mainSettingsLayout " >
49
49
<property name =" horizontalSpacing" >
50
50
<number >10</number >
51
51
</property >
317
317
</widget >
318
318
</item >
319
319
<item >
320
- <widget class =" QGroupBox" name =" defaultValuesSettingsBox " >
320
+ <widget class =" QGroupBox" name =" defaultValuesBox " >
321
321
<property name =" title" >
322
322
<string >Default values for new items</string >
323
323
</property >
324
- <layout class =" QVBoxLayout" name =" defaultValuesSettingsBoxLayout " >
324
+ <layout class =" QVBoxLayout" name =" defaultValuesBoxLayout " >
325
325
<property name =" spacing" >
326
326
<number >5</number >
327
327
</property >
594
594
</layout >
595
595
</widget >
596
596
</item >
597
+ <item >
598
+ <widget class =" QGroupBox" name =" ascentViewerBox" >
599
+ <property name =" title" >
600
+ <string >Ascent Viewer</string >
601
+ </property >
602
+ <layout class =" QVBoxLayout" name =" ascentViewerBoxLayout" >
603
+ <property name =" spacing" >
604
+ <number >5</number >
605
+ </property >
606
+ <property name =" leftMargin" >
607
+ <number >10</number >
608
+ </property >
609
+ <property name =" topMargin" >
610
+ <number >5</number >
611
+ </property >
612
+ <property name =" rightMargin" >
613
+ <number >10</number >
614
+ </property >
615
+ <property name =" bottomMargin" >
616
+ <number >5</number >
617
+ </property >
618
+ <item >
619
+ <widget class =" QCheckBox" name =" ascentTitleUnderPeakNameCheckbox" >
620
+ <property name =" text" >
621
+ <string >Show ascent title below peak name, not in ascent box</string >
622
+ </property >
623
+ </widget >
624
+ </item >
625
+ </layout >
626
+ </widget >
627
+ </item >
597
628
<item >
598
629
<spacer name =" bottomSpacer" >
599
630
<property name =" orientation" >
Original file line number Diff line number Diff line change @@ -98,6 +98,13 @@ void AscentViewer::additionalUISetup()
98
98
rightSplitter ->setSizes ({ rightSplitter->size ().width () / 2 , rightSplitter->size ().width () / 2 });
99
99
100
100
101
+ // Move ascent title label if settings dictate
102
+ if (Settings::ascentViewer_ascentTitleUnderPeakName.get ()) {
103
+ peakInfoBoxLayout->insertWidget (1 , ascentInfoLine);
104
+ peakInfoBoxLayout->insertWidget (2 , ascentTitleLabel);
105
+ }
106
+
107
+
101
108
// Set icons for info boxes
102
109
tripInfoBox ->setIcon (QIcon (" :/icons/trip.svg" ), 28 , 28 );
103
110
peakInfoBox ->setIcon (QIcon (" :/icons/peak.svg" ), 28 , 28 );
You can’t perform that action at this time.
0 commit comments