diff options
Diffstat (limited to 'SidebarToolbox.h')
-rw-r--r-- | SidebarToolbox.h | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/SidebarToolbox.h b/SidebarToolbox.h index 4982502..46af985 100644 --- a/SidebarToolbox.h +++ b/SidebarToolbox.h @@ -2,23 +2,30 @@ #define SIDEBARTOOLBOX_H_ #include <gtk/gtk.h> +#include <map> #include <list> -#include <set> +#include "EditManager.h" #include "Sidebar.h" #include "Tool.h" -class SidebarToolbox : Sidebar -{ +class SidebarToolbox : Sidebar { private: GtkWidget *widget; - std::list<GtkWidget*> buttonBoxes; - std::set<Tool*> tools; + std::list<Tool*> tools; + std::map<Tool*, GtkWidget*> buttons; + + int cols, rows; + + void updateRows(bool changed); // prevent shallow copy SidebarToolbox(const SidebarToolbox &w); const SidebarToolbox& operator=(const SidebarToolbox &w); + static void toolAction(GtkWidget *button, Tool *tool); + static void sizeAllocate(GtkWidget *widget, GtkAllocation *allocation, SidebarToolbox *toolbox); + public: SidebarToolbox(); virtual ~SidebarToolbox(); @@ -27,10 +34,10 @@ class SidebarToolbox : Sidebar return widget; } - void update(); + void addTool(Tool *tool); + void removeTool(Tool *tool); - bool addTool(Tool *tool); - bool removeTool(Tool *tool); + void update(); }; #endif /*SIDEBARTOOLBOX_H_*/ |