WIP
This commit is contained in:
parent
c6713d0876
commit
6a484c615a
17 changed files with 175 additions and 7 deletions
|
|
@ -3,6 +3,7 @@
|
|||
#include "ui_TagListDock.h"
|
||||
|
||||
#include <QMessageBox>
|
||||
#include <QToolbar>
|
||||
|
||||
Numberator::Numberator(QWidget *parent)
|
||||
: QMainWindow(parent)
|
||||
|
|
@ -88,6 +89,30 @@ Numberator::Numberator(QWidget *parent)
|
|||
}
|
||||
});
|
||||
|
||||
QToolBar *tools_tb = new QToolBar("Tools", this);
|
||||
struct tool_def {
|
||||
ToolType type;
|
||||
QString filename;
|
||||
QString name;
|
||||
};
|
||||
|
||||
std::initializer_list<struct tool_def> tool_defs = {
|
||||
{SELECTION_TOOL, ":/icons/selection_tool.png", "Select"},
|
||||
{TAG_TOOL, ":/icons/tag.png", "Add Tag"},
|
||||
{MOVE_TOOL, ":/icons/move_tool.png", "Move Tag"},
|
||||
{EDIT_TOOL, ":/icons/edit_tool.png", "Edit Tag"},
|
||||
};
|
||||
QActionGroup toolsActionGroup(this);
|
||||
for (auto tool : tool_defs) {
|
||||
auto action = tools_tb->addAction(QIcon(tool.filename), tool.name, [=](){
|
||||
setTool(tool.type);
|
||||
});
|
||||
action->setCheckable(true);
|
||||
toolsActionGroup.addAction(action);
|
||||
}
|
||||
toolsActionGroup.actions().first()->setChecked(true);
|
||||
this->addToolBar(Qt::TopToolBarArea, tools_tb);
|
||||
|
||||
ui->menuView->addAction(dock->toggleViewAction());
|
||||
connect(ui->actionReload_Image, &QAction::triggered, &proj, &SQLiteSaveFile::reloadImageFromDisk);
|
||||
|
||||
|
|
@ -151,6 +176,11 @@ Numberator::~Numberator()
|
|||
delete ui;
|
||||
}
|
||||
|
||||
void Numberator::setTool(Numberator::ToolType tool)
|
||||
{
|
||||
ui->graphicsView->scene()->setTool(tool);
|
||||
}
|
||||
|
||||
bool Numberator::showConfirmDiscardDialog()
|
||||
{
|
||||
if (!proj.isMemory() || !proj.isDirty())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue