Skip to content

Commit

Permalink
Sprite Show CheckBox Labels (#172)
Browse files Browse the repository at this point in the history
Use the checkbox label for the text instead of creating a redundant label thus fixing the clicking of the label to toggle the checkbox.
  • Loading branch information
RobertBColton authored Aug 29, 2020
1 parent 4414a49 commit edbd2cf
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions Editors/SpriteEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit edbd2cf

Please sign in to comment.