Disable remaining action buttons when accept is active

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
This commit is contained in:
Haris Gušić
2021-10-09 20:42:53 +02:00
parent f0adfabd47
commit 1d334d372b

View File

@@ -254,12 +254,14 @@ void CaptureWidget::initButtons()
allButtonTypes.removeOne(CaptureTool::TYPE_ACCEPT);
visibleButtonTypes.removeOne(CaptureTool::TYPE_ACCEPT);
} else {
allButtonTypes.removeOne(CaptureTool::TYPE_SAVE);
allButtonTypes.removeOne(CaptureTool::TYPE_COPY);
allButtonTypes.removeOne(CaptureTool::TYPE_IMAGEUPLOADER);
visibleButtonTypes.removeOne(CaptureTool::TYPE_SAVE);
visibleButtonTypes.removeOne(CaptureTool::TYPE_COPY);
visibleButtonTypes.removeOne(CaptureTool::TYPE_IMAGEUPLOADER);
// Remove irrelevant buttons from both lists
for (auto* buttonList : { &allButtonTypes, &visibleButtonTypes }) {
buttonList->removeOne(CaptureTool::TYPE_SAVE);
buttonList->removeOne(CaptureTool::TYPE_COPY);
buttonList->removeOne(CaptureTool::TYPE_IMAGEUPLOADER);
buttonList->removeOne(CaptureTool::TYPE_OPEN_APP);
buttonList->removeOne(CaptureTool::TYPE_PIN);
}
}
QVector<CaptureToolButton*> vectorButtons;