summaryrefslogtreecommitdiffstats
path: root/ToolSelector.cpp
blob: 953487a6f47d2ffee18fed0721c99aeab80c7f00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include "ToolSelector.h"


ToolSelector::ToolSelector(EditManager *editManager) : sidebar(editManager) {
  this->editManager = editManager;
  
  image = gtk_image_new_from_stock(GTK_STOCK_MISSING_IMAGE, GTK_ICON_SIZE_BUTTON);
  g_object_ref_sink(G_OBJECT(image));
}

ToolSelector::~ToolSelector() {
  g_object_unref(G_OBJECT(image));
}

bool ToolSelector::buttonPress(unsigned int button, const Vertex *v) {
  if(button != 1)
    return false;
  
  editManager->setSelectedObject(editManager->getHoveredObject());
  
  editManager->redraw();
  sidebar.update();
  
  return true;
}