From edbd2cf025cf95a299ba63255c7fe147a6d85b4d Mon Sep 17 00:00:00 2001 From: Robert Colton Date: Sat, 29 Aug 2020 14:00:11 -0400 Subject: [PATCH] Sprite Show CheckBox Labels (#172) Use the checkbox label for the text instead of creating a redundant label thus fixing the clicking of the label to toggle the checkbox. --- Editors/SpriteEditor.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/Editors/SpriteEditor.cpp b/Editors/SpriteEditor.cpp index f9a19f555..c704c7fd1 100644 --- a/Editors/SpriteEditor.cpp +++ b/Editors/SpriteEditor.cpp @@ -20,18 +20,14 @@ SpriteEditor::SpriteEditor(MessageModel* model, QWidget* parent) connect(_ui->actionSave, &QAction::triggered, this, &BaseEditor::OnSave); _ui->scrollAreaWidget->SetAssetView(_ui->subimagePreview); - QLabel* bboxLabel = new QLabel(tr("Show BBox ")); - QCheckBox* showBBox = new QCheckBox(this); + QCheckBox* showBBox = new QCheckBox(tr("Show BBox"),this); showBBox->setChecked(true); - _ui->mainToolBar->addWidget(bboxLabel); - _ui->mainToolBar->addWidget(showBBox); - connect(showBBox, &QCheckBox::stateChanged, _ui->subimagePreview, &SpriteView::SetShowBBox); - - QLabel* originLabel = new QLabel(tr("Show Origin ")); - QCheckBox* showOrigin = new QCheckBox(this); + QCheckBox* showOrigin = new QCheckBox(tr("Show Origin"),this); showOrigin->setChecked(true); - _ui->mainToolBar->addWidget(originLabel); + + _ui->mainToolBar->addWidget(showBBox); _ui->mainToolBar->addWidget(showOrigin); + connect(showBBox, &QCheckBox::stateChanged, _ui->subimagePreview, &SpriteView::SetShowBBox); connect(showOrigin, &QCheckBox::stateChanged, _ui->subimagePreview, &SpriteView::SetShowOrigin); _nodeMapper->addMapping(_ui->nameEdit, TreeNode::kNameFieldNumber);