Solving issue 997: Selection of crop selection tool should open crop settings

Now clicking on the toolbar's white balance, straighten or crop button jump to the corresponding tool.
This commit is contained in:
Hombre 2011-10-20 20:51:47 +02:00
parent ad7c97202c
commit 77a2acd033
2 changed files with 24 additions and 0 deletions

View File

@ -184,6 +184,7 @@ ToolPanelCoordinator::ToolPanelCoordinator () : ipc(NULL) {
icm->setICMPanelListener (this);
toolBar = new ToolBar ();
toolBar->setToolBarListener(this);
}
void ToolPanelCoordinator::addPanel (Gtk::Box* where, FoldableToolPanel* panel, Glib::ustring label) {
@ -562,3 +563,23 @@ void ToolPanelCoordinator::updateTPVScrollbar (bool hide) {
void ToolPanelCoordinator::updateTabsUsesIcons (bool useIcons) {
updateTabsHeader (useIcons);
}
void ToolPanelCoordinator::toolSelected (ToolMode tool) {
switch (tool) {
case TMCropSelect:
crop->exp->set_expanded(true);
toolPanelNotebook->set_current_page(toolPanelNotebook->page_num(*transformPanelSW));
break;
case TMSpotWB:
whitebalance->exp->set_expanded(true);
toolPanelNotebook->set_current_page(toolPanelNotebook->page_num(*colorPanelSW));
break;
case TMStraighten:
lensgeom->exp->set_expanded(true);
rotate->exp->set_expanded(true);
toolPanelNotebook->set_current_page(toolPanelNotebook->page_num(*transformPanelSW));
break;
default:
break;
}
}

View File

@ -63,6 +63,7 @@
class ImageEditorCoordinator;
class ToolPanelCoordinator : public ToolPanelListener,
public ToolBarListener,
public ProfileChangeListener,
public WBProvider,
public DFProvider,
@ -226,6 +227,8 @@ class ToolPanelCoordinator : public ToolPanelListener,
void updateTPVScrollbar (bool hide);
void updateTabsUsesIcons (bool useIcons);
bool handleShortcutKey (GdkEventKey* event);
void toolSelected (ToolMode tool);
};
#endif