summaryrefslogtreecommitdiffstats
path: root/ToolSelector.cpp
blob: 46ee6d293cbea9aa41c7eacd0a7a4d0ec87ef306 (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) {
  if(button != 1)
    return false;
  
  editManager->setSelectedObject(editManager->getHoveredObject());
  
  editManager->redraw();
  sidebar.update();
  
  return true;
}