Skip to content

Commit 75c1736

Browse files
committed
Add toggle for background image and sync checkbox with config on load
1 parent af9c996 commit 75c1736

2 files changed

Lines changed: 23 additions & 1 deletion

File tree

src/preferences/graphicspage.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ GraphicsPage::GraphicsPage(QWidget *parent)
8181
&QCheckBox::stateChanged,
8282
this,
8383
&GraphicsPage::slot_drawUpperLayersTexturedStateChanged);
84+
connect(ui->backgroundImageCheckBox, &QCheckBox::toggled,
85+
[](bool checked) {
86+
setConfig().canvas.showBackgroundImage.set(checked);
87+
});
8488

8589
connect(ui->resourceLineEdit, &QLineEdit::textChanged, this, [](const QString &text) {
8690
setConfig().canvas.resourcesDirectory = text;
@@ -133,6 +137,8 @@ void GraphicsPage::slot_loadConfig()
133137
ui->drawDoorNames->setChecked(settings.drawDoorNames);
134138

135139
ui->resourceLineEdit->setText(settings.resourcesDirectory);
140+
141+
ui->backgroundImageCheckBox->setChecked(getConfig().canvas.showBackgroundImage.get());
136142
}
137143

138144
void GraphicsPage::changeColorClicked(XNamedColor &namedColor, QPushButton *const pushButton)

src/preferences/graphicspage.ui

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<x>0</x>
88
<y>0</y>
99
<width>445</width>
10-
<height>507</height>
10+
<height>568</height>
1111
</rect>
1212
</property>
1313
<property name="sizePolicy">
@@ -327,6 +327,22 @@
327327
</layout>
328328
</widget>
329329
</item>
330+
<item>
331+
<widget class="QGroupBox" name="groupBox_Background">
332+
<property name="title">
333+
<string>Map Background</string>
334+
</property>
335+
<layout class="QVBoxLayout" name="verticalLayout_Background">
336+
<item>
337+
<widget class="QCheckBox" name="backgroundImageCheckBox">
338+
<property name="text">
339+
<string>Show Background Image</string>
340+
</property>
341+
</widget>
342+
</item>
343+
</layout>
344+
</widget>
345+
</item>
330346
<item>
331347
<widget class="QGroupBox" name="groupBox_Advanced">
332348
<property name="title">

0 commit comments

Comments
 (0)