Make file catalog work in both main and editor panels!!!
This commit is contained in:
@@ -187,19 +187,24 @@ EditorPanel::EditorPanel (FilePanel* filePanel) : beforePreviewHandler(NULL), be
|
||||
}
|
||||
|
||||
ipc = NULL;
|
||||
btpCoordinator = new BatchToolPanelCoordinator (filePanel);
|
||||
fCatalog = new FileCatalog (btpCoordinator->coarse, btpCoordinator->getToolBar()); //, filePanel->fileCatalog->fileBrowser);
|
||||
filePanel->dirBrowser->addDirSelectionListener (fCatalog);
|
||||
// fCatalog->setFilterPanel (filePanel->filterPanel);
|
||||
fCatalog->setImageAreaToolListener (btpCoordinator);
|
||||
fCatalog->setFileSelectionListener (filePanel);
|
||||
fCatalog->setFileSelectionChangeListener (btpCoordinator);
|
||||
fCatalog->setEnabled(true);
|
||||
// btpCoordinator = new BatchToolPanelCoordinator (filePanel);
|
||||
// fCatalog = new FileCatalog (btpCoordinator->coarse, btpCoordinator->getToolBar()); //, filePanel->fileCatalog->fileBrowser);
|
||||
// filePanel->dirBrowser->addDirSelectionListener (fCatalog);
|
||||
// // fCatalog->setFilterPanel (filePanel->filterPanel);
|
||||
// fCatalog->setImageAreaToolListener (btpCoordinator);
|
||||
// fCatalog->setFileSelectionListener (filePanel);
|
||||
// fCatalog->setFileSelectionChangeListener (btpCoordinator);
|
||||
// fCatalog->setEnabled(true);
|
||||
|
||||
catalogPane = new Gtk::Paned();
|
||||
|
||||
Gtk::VPaned * viewpaned = Gtk::manage (new Gtk::VPaned());
|
||||
viewpaned->pack1(*fCatalog, false, true);
|
||||
viewpaned->pack1(*catalogPane, false, true);
|
||||
viewpaned->pack2(*editbox, true, true);
|
||||
|
||||
fPanel = filePanel;
|
||||
fCatalog = filePanel->fileCatalog;
|
||||
|
||||
Gtk::Frame* vbfr = Gtk::manage (new Gtk::Frame ());
|
||||
vbfr->add (*viewpaned);
|
||||
hpanedl->pack2(*vbfr, true, true);
|
||||
@@ -274,7 +279,7 @@ EditorPanel::~EditorPanel () {
|
||||
delete green;
|
||||
delete leftbox;
|
||||
delete vboxright;
|
||||
|
||||
delete catalogPane;
|
||||
delete saveAsDialog;
|
||||
}
|
||||
|
||||
@@ -976,3 +981,15 @@ void EditorPanel::histogramChanged (unsigned int* rh, unsigned int* gh, unsigned
|
||||
histogramPanel->histogramChanged (rh, gh, bh, lh);
|
||||
tpc->updateCurveBackgroundHistogram (bcrgb, bcl);
|
||||
}
|
||||
|
||||
bool EditorPanel::on_expose_event(GdkEventExpose* event)
|
||||
{
|
||||
|
||||
if(catalogPane->get_children().size() ==0 ){
|
||||
fPanel->dirpaned->remove(*fPanel->fileCatalog);
|
||||
catalogPane->add(*fCatalog);
|
||||
fCatalog->fileBrowser->setArrangement(ThumbBrowserBase::TB_Horizontal);
|
||||
fCatalog->redrawAll();
|
||||
}
|
||||
return Gtk::VBox::on_expose_event(event);
|
||||
}
|
@@ -84,6 +84,8 @@ class EditorPanel : public Gtk::VBox,
|
||||
SaveAsDialog* saveAsDialog;
|
||||
BatchToolPanelCoordinator* btpCoordinator;
|
||||
FileCatalog* fCatalog;
|
||||
FilePanel* fPanel;
|
||||
|
||||
|
||||
Thumbnail* openThm;
|
||||
rtengine::InitialImage* isrc;
|
||||
@@ -142,6 +144,9 @@ class EditorPanel : public Gtk::VBox,
|
||||
bool handleShortcutKey (GdkEventKey* event);
|
||||
|
||||
void saveOptions ();
|
||||
|
||||
Gtk::Paned *catalogPane;
|
||||
bool on_expose_event(GdkEventExpose* event);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -38,7 +38,7 @@ FilePanel::FilePanel () : parent(NULL) {
|
||||
placesBrowser = new PlacesBrowser ();
|
||||
recentBrowser = new RecentBrowser ();
|
||||
|
||||
placespaned = new Gtk::HPaned ();
|
||||
placespaned = new Gtk::VPaned ();
|
||||
placespaned->set_position (options.dirBrowserHeight);
|
||||
|
||||
Gtk::VBox* obox = Gtk::manage (new Gtk::VBox ());
|
||||
@@ -51,6 +51,20 @@ FilePanel::FilePanel () : parent(NULL) {
|
||||
dirpaned->pack1 (*placespaned, true, true);
|
||||
tpc = new BatchToolPanelCoordinator (this);
|
||||
|
||||
fileCatalog = new FileCatalog (tpc->coarse, tpc->getToolBar());
|
||||
dirpaned->pack2 (*fileCatalog, true, true);
|
||||
dirBrowser->addDirSelectionListener (fileCatalog);
|
||||
fileCatalog->setFileSelectionListener (this);
|
||||
fileCatalog->setFileSelectionChangeListener (tpc);
|
||||
Gtk::ScrolledWindow* sFilterPanel = new Gtk::ScrolledWindow();
|
||||
filterPanel = new FilterPanel ();
|
||||
sFilterPanel->add (*filterPanel);
|
||||
sFilterPanel->set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
|
||||
|
||||
fileCatalog->setFilterPanel (filterPanel);
|
||||
fileCatalog->setImageAreaToolListener (tpc);
|
||||
|
||||
|
||||
placesBrowser->setDirBrowserRemoteInterface (dirBrowser);
|
||||
recentBrowser->setDirBrowserRemoteInterface (dirBrowser);
|
||||
dirBrowser->addDirSelectionListener (recentBrowser);
|
||||
@@ -163,3 +177,16 @@ bool FilePanel::handleShortcutKey (GdkEventKey* event) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool FilePanel::on_expose_event(GdkEventExpose* event)
|
||||
{
|
||||
|
||||
if(dirpaned->get_children().size() ==1 ){
|
||||
|
||||
parent->epanel->catalogPane->remove(*fileCatalog);
|
||||
fileCatalog->fileBrowser->setArrangement(ThumbBrowserBase::TB_Vertical);
|
||||
dirpaned->pack2(*fileCatalog,true,true);
|
||||
fileCatalog->redrawAll();
|
||||
}
|
||||
return Gtk::HPaned::on_expose_event(event);
|
||||
}
|
||||
|
||||
|
@@ -39,7 +39,7 @@ class FilePanel : public Gtk::HPaned,
|
||||
|
||||
protected:
|
||||
Gtk::Paned* placespaned;
|
||||
Gtk::HPaned* dirpaned;
|
||||
|
||||
//DirBrowser* dirBrowser;
|
||||
PlacesBrowser* placesBrowser;
|
||||
RecentBrowser* recentBrowser;
|
||||
@@ -59,6 +59,7 @@ class FilePanel : public Gtk::HPaned,
|
||||
DirBrowser* dirBrowser;
|
||||
FilterPanel* filterPanel;
|
||||
FileCatalog* fileCatalog;
|
||||
Gtk::HPaned* dirpaned;
|
||||
|
||||
void setParent (RTWindow* p) { parent = p; }
|
||||
void init (); // dont call it directly, the constructor calls it as idle source
|
||||
@@ -76,6 +77,7 @@ class FilePanel : public Gtk::HPaned,
|
||||
bool imageLoaded( Thumbnail* thm, ProgressConnector<rtengine::InitialImage*> * );
|
||||
|
||||
bool handleShortcutKey (GdkEventKey* event);
|
||||
bool on_expose_event(GdkEventExpose* event);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user