Merge with trunk
This commit is contained in:
@@ -92,7 +92,7 @@ CropWindow::CropWindow (ImageArea* parent, rtengine::StagedImageProcessor* ipc_)
|
||||
|
||||
minWidth = bsw + iw + 2*sideBorderWidth;
|
||||
|
||||
setSize (300, 300);
|
||||
setSize (100, 100);
|
||||
cropHandler.newImage (ipc_);
|
||||
cropHandler.setPosition (0,0);
|
||||
cropHandler.setEnabled (true);
|
||||
|
@@ -40,6 +40,7 @@ EditorPanel::EditorPanel (FilePanel* filePanel) : beforePreviewHandler(NULL), be
|
||||
// build left side panel
|
||||
leftbox = new Gtk::VBox ();
|
||||
leftbox->set_border_width (4);
|
||||
leftbox->set_size_request(100,250);
|
||||
|
||||
histogramPanel = Gtk::manage (new HistogramPanel ());
|
||||
histogramPanel->set_size_request (-1, 150);
|
||||
@@ -122,6 +123,8 @@ EditorPanel::EditorPanel (FilePanel* filePanel) : beforePreviewHandler(NULL), be
|
||||
|
||||
// build right side panel
|
||||
vboxright = new Gtk::VBox (false, 0);
|
||||
vboxright->set_size_request(100,250);
|
||||
|
||||
vboxright->set_border_width (4);
|
||||
vboxright->pack_start (*histogramPanel, Gtk::PACK_SHRINK, 4);
|
||||
vboxright->pack_start (*ppframe, Gtk::PACK_SHRINK, 4);
|
||||
@@ -197,12 +200,15 @@ EditorPanel::EditorPanel (FilePanel* filePanel) : beforePreviewHandler(NULL), be
|
||||
viewpaned->pack2(*editbox, true, true);
|
||||
|
||||
|
||||
Gtk::Frame* vbfr = Gtk::manage (new Gtk::Frame ());
|
||||
Gtk::Frame* vbfr = Gtk::manage (new Gtk::Frame ());
|
||||
vbfr->add (*viewpaned);
|
||||
vbfr->set_size_request(100,250);
|
||||
hpanedl->pack2(*vbfr, true, true);
|
||||
|
||||
hpanedr->pack1(*hpanedl, true, true);
|
||||
hpanedr->pack2(*vboxright, false, true);
|
||||
hpanedl->signal_button_release_event().connect_notify( sigc::mem_fun(*this, &EditorPanel::leftPaneButtonReleased) );
|
||||
hpanedr->signal_button_release_event().connect_notify( sigc::mem_fun(*this, &EditorPanel::rightPaneButtonReleased) );
|
||||
|
||||
pack_start (*hpanedr);
|
||||
show_all ();
|
||||
@@ -271,6 +277,43 @@ EditorPanel::~EditorPanel () {
|
||||
delete catalogPane;
|
||||
}
|
||||
|
||||
void EditorPanel::leftPaneButtonReleased(GdkEventButton *event) {
|
||||
if (event->button == 1) {
|
||||
// Button 1 released : it's a resize
|
||||
options.historyPanelWidth = hpanedl->get_position();
|
||||
}
|
||||
/*else if (event->button == 3) {
|
||||
}*/
|
||||
}
|
||||
|
||||
void EditorPanel::rightPaneButtonReleased(GdkEventButton *event) {
|
||||
if (event->button == 1) {
|
||||
int winW, winH;
|
||||
parent->get_size(winW, winH);
|
||||
// Button 1 released : it's a resize
|
||||
options.toolPanelWidth = winW - hpanedr->get_position();
|
||||
}
|
||||
/*else if (event->button == 3) {
|
||||
}*/
|
||||
}
|
||||
|
||||
void EditorPanel::setAspect () {
|
||||
int winW, winH;
|
||||
parent->get_size(winW, winH);
|
||||
hpanedl->set_position(options.historyPanelWidth);
|
||||
hpanedr->set_position(winW - options.toolPanelWidth);
|
||||
// initialize components
|
||||
if (info->get_active() != options.showInfo)
|
||||
info->set_active (options.showInfo);
|
||||
}
|
||||
|
||||
void EditorPanel::on_realize () {
|
||||
|
||||
Gtk::VBox::on_realize ();
|
||||
// This line is needed to avoid autoexpansion of the window :-/
|
||||
vboxright->set_size_request (options.toolPanelWidth, -1);
|
||||
}
|
||||
|
||||
void EditorPanel::open (Thumbnail* tmb, rtengine::InitialImage* isrc) {
|
||||
|
||||
if (ipc) close();
|
||||
@@ -891,13 +934,10 @@ bool EditorPanel::idle_sentToGimp(ProgressConnector<int> *pc,rtengine::IImage16*
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
void EditorPanel::saveOptions () {
|
||||
|
||||
//options.historyPanelWidth = hpanedl->get_position ();//older code
|
||||
//options.toolPanelWidth = vboxright->get_width ();//older code
|
||||
//options.toolPanelWidth = hpanedr->get_position ();//Hombre's change which screws up OSX build
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
void EditorPanel::historyBeforeLineChanged (const rtengine::procparams::ProcParams& params) {
|
||||
|
||||
|
@@ -108,6 +108,10 @@ class EditorPanel : public Gtk::VBox,
|
||||
virtual ~EditorPanel ();
|
||||
|
||||
void open (Thumbnail* tmb, rtengine::InitialImage* isrc);
|
||||
void setAspect ();
|
||||
void on_realize ();
|
||||
void leftPaneButtonReleased(GdkEventButton *event);
|
||||
void rightPaneButtonReleased(GdkEventButton *event);
|
||||
|
||||
void setParent (RTWindow* p) { parent = p; }
|
||||
|
||||
@@ -142,7 +146,7 @@ class EditorPanel : public Gtk::VBox,
|
||||
Glib::ustring getFileName ();
|
||||
bool handleShortcutKey (GdkEventKey* event);
|
||||
|
||||
void saveOptions ();
|
||||
//void saveOptions ();
|
||||
|
||||
Gtk::Paned *catalogPane;
|
||||
};
|
||||
|
@@ -39,6 +39,7 @@ FilePanel::FilePanel () : parent(NULL) {
|
||||
recentBrowser = new RecentBrowser ();
|
||||
|
||||
placespaned = new Gtk::VPaned ();
|
||||
placespaned->set_size_request(50,100);
|
||||
placespaned->set_position (options.dirBrowserHeight);
|
||||
|
||||
Gtk::VBox* obox = Gtk::manage (new Gtk::VBox ());
|
||||
@@ -48,12 +49,13 @@ FilePanel::FilePanel () : parent(NULL) {
|
||||
placespaned->pack1 (*placesBrowser, false, true);
|
||||
placespaned->pack2 (*obox, true, true);
|
||||
|
||||
dirpaned->pack1 (*placespaned, true, true);
|
||||
dirpaned->pack1 (*placespaned, false, true);
|
||||
|
||||
tpc = new BatchToolPanelCoordinator (this);
|
||||
fileCatalog = new FileCatalog (tpc->coarse, tpc->getToolBar());
|
||||
ribbonPane = new Gtk::Paned();
|
||||
ribbonPane->add(*fileCatalog);
|
||||
ribbonPane->set_size_request(50,150);
|
||||
dirpaned->pack2 (*ribbonPane, true, true);
|
||||
|
||||
placesBrowser->setDirBrowserRemoteInterface (dirBrowser);
|
||||
@@ -64,6 +66,7 @@ FilePanel::FilePanel () : parent(NULL) {
|
||||
fileCatalog->setFileSelectionListener (this);
|
||||
|
||||
rightBox = new Gtk::HBox ();
|
||||
rightBox->set_size_request(50,100);
|
||||
rightNotebook = new Gtk::Notebook ();
|
||||
Gtk::VBox* taggingBox = new Gtk::VBox ();
|
||||
|
||||
@@ -91,8 +94,8 @@ FilePanel::FilePanel () : parent(NULL) {
|
||||
Gtk::Label* tagLab = new Gtk::Label (M("MAIN_TAB_TAGGING"));
|
||||
tagLab->set_angle (90);
|
||||
|
||||
Gtk::VPaned* tpcPaned = new Gtk::VPaned ();
|
||||
tpcPaned->pack1 (*tpc->toolPanelNotebook, true, true);
|
||||
tpcPaned = new Gtk::VPaned ();
|
||||
tpcPaned->pack1 (*tpc->toolPanelNotebook, false, true);
|
||||
tpcPaned->pack2 (*history, true, true);
|
||||
|
||||
rightNotebook->append_page (*tpcPaned, *devLab);
|
||||
@@ -102,9 +105,7 @@ FilePanel::FilePanel () : parent(NULL) {
|
||||
rightBox->pack_start (*rightNotebook);
|
||||
|
||||
pack1(*dirpaned, true, true);
|
||||
pack2(*rightBox, true, true);
|
||||
|
||||
//set_position(options.browserToolPanelWidth);////Hombre's change which screws up OSX build
|
||||
pack2(*rightBox, false, true);
|
||||
|
||||
fileCatalog->setFileSelectionChangeListener (tpc);
|
||||
|
||||
@@ -114,6 +115,15 @@ FilePanel::FilePanel () : parent(NULL) {
|
||||
show_all ();
|
||||
}
|
||||
|
||||
void FilePanel::setAspect () {
|
||||
int winW, winH;
|
||||
parent->get_size(winW, winH);
|
||||
placespaned->set_position(options.dirBrowserHeight);
|
||||
dirpaned->set_position(options.dirBrowserWidth);
|
||||
tpcPaned->set_position(options.browserToolPanelHeight);
|
||||
set_position(winW - options.browserToolPanelWidth);
|
||||
}
|
||||
|
||||
void FilePanel::init () {
|
||||
|
||||
dirBrowser->fillDirTree ();
|
||||
@@ -178,9 +188,12 @@ bool FilePanel::imageLoaded( Thumbnail* thm, ProgressConnector<rtengine::Initial
|
||||
|
||||
void FilePanel::saveOptions () {
|
||||
|
||||
//options.dirBrowserWidth = dirpaned->get_position ();
|
||||
//options.dirBrowserHeight = placespaned->get_position ();
|
||||
//options.browserToolPanelWidth = get_position();
|
||||
int winW, winH;
|
||||
parent->get_size(winW, winH);
|
||||
options.dirBrowserWidth = dirpaned->get_position ();
|
||||
options.dirBrowserHeight = placespaned->get_position ();
|
||||
options.browserToolPanelWidth = winW - get_position();
|
||||
options.browserToolPanelHeight = tpcPaned->get_position ();
|
||||
if (options.startupDir==STARTUPDIR_LAST && fileCatalog->lastSelectedDir ()!="")
|
||||
options.startupPath = fileCatalog->lastSelectedDir ();
|
||||
fileCatalog->closeDir ();
|
||||
|
@@ -45,6 +45,7 @@ class FilePanel : public Gtk::HPaned,
|
||||
RecentBrowser* recentBrowser;
|
||||
// FileCatalog* fileCatalog; // filecatalog is the file browser with the button bar above it
|
||||
Gtk::HBox* rightBox;
|
||||
Gtk::VPaned* tpcPaned;
|
||||
BatchToolPanelCoordinator* tpc;
|
||||
History* history;
|
||||
//FilterPanel* filterPanel;
|
||||
@@ -63,6 +64,7 @@ class FilePanel : public Gtk::HPaned,
|
||||
|
||||
void setParent (RTWindow* p) { parent = p; }
|
||||
void init (); // dont call it directly, the constructor calls it as idle source
|
||||
void setAspect();
|
||||
void open (const Glib::ustring& d); // open a file or a directory
|
||||
void refreshEditedState (const std::set<Glib::ustring>& efiles) { fileCatalog->refreshEditedState (efiles); }
|
||||
|
||||
|
@@ -26,7 +26,6 @@
|
||||
|
||||
ImageArea::ImageArea (ImageAreaPanel* p) : parent(p) {
|
||||
|
||||
showInfo = false;
|
||||
infotext = "";
|
||||
cropgl = NULL;
|
||||
pmlistener = NULL;
|
||||
@@ -122,8 +121,8 @@ void ImageArea::setInfoText (Glib::ustring text) {
|
||||
|
||||
void ImageArea::infoEnabled (bool e) {
|
||||
|
||||
if (showInfo!=e) {
|
||||
showInfo = e;
|
||||
if (options.showInfo!=e) {
|
||||
options.showInfo = e;
|
||||
queue_draw ();
|
||||
}
|
||||
}
|
||||
@@ -149,7 +148,7 @@ bool ImageArea::on_expose_event(GdkEventExpose* event) {
|
||||
if (mainCropWindow)
|
||||
mainCropWindow->expose (cr);
|
||||
|
||||
if (showInfo==true && infotext!="") {
|
||||
if (options.showInfo==true && infotext!="") {
|
||||
int fnw, fnh;
|
||||
ilayout->get_pixel_size (fnw, fnh);
|
||||
window->draw_pixbuf (get_style()->get_base_gc (Gtk::STATE_NORMAL), ipixbuf, 0, 0, 4, 4, fnw+8, fnh+8, Gdk::RGB_DITHER_NONE, 0, 0);
|
||||
|
@@ -37,7 +37,6 @@ class ImageArea : public Gtk::DrawingArea, public CropWindowListener {
|
||||
|
||||
protected:
|
||||
|
||||
bool showInfo;
|
||||
Glib::ustring infotext;
|
||||
Glib::RefPtr<Pango::Layout> ilayout;
|
||||
Glib::RefPtr<Pango::Layout> deglayout;
|
||||
|
@@ -38,8 +38,8 @@ const char *DefaultLanguage = "English (US)";
|
||||
|
||||
void Options::setDefaults () {
|
||||
|
||||
windowWidth = 1000;
|
||||
windowHeight = 600;
|
||||
windowWidth = 900;
|
||||
windowHeight = 560;
|
||||
windowMaximized = false;
|
||||
firstRun = true;
|
||||
savesParamsAtExit = true;
|
||||
@@ -50,7 +50,7 @@ void Options::setDefaults () {
|
||||
saveFormat.tiffBits = 8;
|
||||
saveFormat.tiffUncompressed = true;
|
||||
saveFormat.saveParams = false;
|
||||
savePathTemplate = "\%p1/converted/\%f";
|
||||
savePathTemplate = "%p1/converted/%f";
|
||||
savePathFolder = "";
|
||||
saveUsePathTemplate = true;
|
||||
defProfRaw = "default";
|
||||
@@ -63,6 +63,7 @@ void Options::setDefaults () {
|
||||
dirBrowserHeight = 150;
|
||||
toolPanelWidth = 300;
|
||||
browserToolPanelWidth = 300;
|
||||
browserToolPanelHeight = 300;
|
||||
historyPanelWidth = 150;
|
||||
lastScale = 4;
|
||||
lastCropSize = 1;
|
||||
@@ -248,12 +249,13 @@ if (keyFile.has_group ("GUI")) {
|
||||
if (keyFile.has_key ("GUI", "WindowWidth")) windowWidth = keyFile.get_integer ("GUI", "WindowWidth");
|
||||
if (keyFile.has_key ("GUI", "WindowHeight")) windowHeight = keyFile.get_integer ("GUI", "WindowHeight");
|
||||
if (keyFile.has_key ("GUI", "WindowMaximized")) windowMaximized = keyFile.get_boolean ("GUI", "WindowMaximized");
|
||||
if (keyFile.has_key ("GUI", "DirBrowserWidth")) dirBrowserWidth = keyFile.get_integer ("GUI", "DirBrowserWidth");
|
||||
if (keyFile.has_key ("GUI", "DirBrowserHeight")) dirBrowserHeight = keyFile.get_integer ("GUI", "DirBrowserHeight");
|
||||
if (keyFile.has_key ("GUI", "SaveAsDialogWidth")) saveAsDialogWidth = keyFile.get_integer ("GUI", "SaveAsDialogWidth");
|
||||
if (keyFile.has_key ("GUI", "SaveAsDialogHeight")) saveAsDialogHeight = keyFile.get_integer ("GUI", "SaveAsDialogHeight");
|
||||
if (keyFile.has_key ("GUI", "ToolPanelWidth")) toolPanelWidth = keyFile.get_integer ("GUI", "ToolPanelWidth");
|
||||
if (keyFile.has_key ("GUI", "BrowserToolPanelWidth"))browserToolPanelWidth = keyFile.get_integer ("GUI", "BrowserToolPanelWidth");
|
||||
if (keyFile.has_key ("GUI", "DirBrowserWidth")) dirBrowserWidth = keyFile.get_integer ("GUI", "DirBrowserWidth");
|
||||
if (keyFile.has_key ("GUI", "DirBrowserHeight")) dirBrowserHeight = keyFile.get_integer ("GUI", "DirBrowserHeight");
|
||||
if (keyFile.has_key ("GUI", "SaveAsDialogWidth")) saveAsDialogWidth = keyFile.get_integer ("GUI", "SaveAsDialogWidth");
|
||||
if (keyFile.has_key ("GUI", "SaveAsDialogHeight")) saveAsDialogHeight = keyFile.get_integer ("GUI", "SaveAsDialogHeight");
|
||||
if (keyFile.has_key ("GUI", "ToolPanelWidth")) toolPanelWidth = keyFile.get_integer ("GUI", "ToolPanelWidth");
|
||||
if (keyFile.has_key ("GUI", "BrowserToolPanelWidth"))browserToolPanelWidth = keyFile.get_integer ("GUI", "BrowserToolPanelWidth");
|
||||
if (keyFile.has_key ("GUI", "BrowserToolPanelHeight"))browserToolPanelHeight = keyFile.get_integer ("GUI", "BrowserToolPanelHeight");
|
||||
if (keyFile.has_key ("GUI", "HistoryPanelWidth")) historyPanelWidth = keyFile.get_integer ("GUI", "HistoryPanelWidth");
|
||||
if (keyFile.has_key ("GUI", "LastPreviewScale")) lastScale = keyFile.get_integer ("GUI", "LastPreviewScale");
|
||||
if (keyFile.has_key ("GUI", "LastCropSize")) lastCropSize = keyFile.get_integer ("GUI", "LastCropSize");
|
||||
@@ -385,6 +387,7 @@ int Options::saveToFile (Glib::ustring fname) {
|
||||
keyFile.set_integer ("GUI", "SaveAsDialogHeight", saveAsDialogHeight);
|
||||
keyFile.set_integer ("GUI", "ToolPanelWidth", toolPanelWidth);
|
||||
keyFile.set_integer ("GUI", "BrowserToolPanelWidth", browserToolPanelWidth);
|
||||
keyFile.set_integer ("GUI", "BrowserToolPanelHeight", browserToolPanelHeight);
|
||||
keyFile.set_integer ("GUI", "HistoryPanelWidth", historyPanelWidth);
|
||||
keyFile.set_integer ("GUI", "LastPreviewScale", lastScale);
|
||||
keyFile.set_integer ("GUI", "LastCropSize", lastCropSize);
|
||||
|
@@ -66,6 +66,7 @@ class Options {
|
||||
int saveAsDialogHeight;
|
||||
int toolPanelWidth;
|
||||
int browserToolPanelWidth;
|
||||
int browserToolPanelHeight;
|
||||
int historyPanelWidth;
|
||||
int windowWidth;
|
||||
int windowHeight;
|
||||
|
@@ -48,6 +48,7 @@ RTWindow::RTWindow () {
|
||||
|
||||
mainNB = Gtk::manage (new Gtk::Notebook ());
|
||||
mainNB->set_scrollable (true);
|
||||
mainNB->signal_switch_page().connect_notify( sigc::mem_fun(*this, &RTWindow::on_mainNB_switch_page) );
|
||||
|
||||
fpanel = new FilePanel ();
|
||||
fpanel->setParent (this);
|
||||
@@ -127,9 +128,30 @@ void RTWindow::on_realize () {
|
||||
|
||||
Gtk::Window::on_realize ();
|
||||
|
||||
fpanel->setAspect();
|
||||
|
||||
cursorManager.init (get_window());
|
||||
}
|
||||
|
||||
bool RTWindow::on_my_window_state_event(GdkEventWindowState* event) {
|
||||
if (!event->new_window_state) {
|
||||
// Window mode
|
||||
options.windowMaximized = false;
|
||||
}
|
||||
else if (event->new_window_state & (GDK_WINDOW_STATE_MAXIMIZED|GDK_WINDOW_STATE_FULLSCREEN)) {
|
||||
// Fullscreen mode
|
||||
options.windowMaximized = true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void RTWindow::on_mainNB_switch_page(GtkNotebookPage* page, guint page_num) {
|
||||
if (page_num > 1) {
|
||||
EditorPanel *ep = (EditorPanel *)mainNB->get_nth_page(page_num);
|
||||
ep->setAspect();
|
||||
}
|
||||
}
|
||||
|
||||
void RTWindow::addEditorPanel (EditorPanel* ep, const std::string &name) {
|
||||
|
||||
ep->setParent (this);
|
||||
@@ -152,7 +174,9 @@ void RTWindow::addEditorPanel (EditorPanel* ep, const std::string &name) {
|
||||
hb->pack_end (*closeb);
|
||||
hb->set_spacing (2);
|
||||
hb->show_all ();
|
||||
|
||||
mainNB->append_page (*ep, *hb);
|
||||
//ep->setAspect ();
|
||||
mainNB->set_current_page (mainNB->page_num (*ep));
|
||||
mainNB->set_tab_reorderable (*ep, true);
|
||||
|
||||
@@ -163,7 +187,7 @@ void RTWindow::addEditorPanel (EditorPanel* ep, const std::string &name) {
|
||||
|
||||
void RTWindow::remEditorPanel (EditorPanel* ep) {
|
||||
|
||||
ep->saveOptions ();
|
||||
//ep->saveOptions ();
|
||||
epanels.erase (ep->getFileName());
|
||||
filesEdited.erase (ep->getFileName ());
|
||||
fpanel->refreshEditedState (filesEdited);
|
||||
@@ -243,14 +267,10 @@ bool RTWindow::on_delete_event(GdkEventAny* event) {
|
||||
options.fbArrangement = fileBrowser->getFileCatalog()->getArrangement ();
|
||||
options.firstRun = false;
|
||||
*/
|
||||
Gdk::WindowState state = get_window()->get_state();
|
||||
if (!(state & (Gdk::WINDOW_STATE_MAXIMIZED | Gdk::WINDOW_STATE_FULLSCREEN))) {
|
||||
if (!options.windowMaximized) {
|
||||
options.windowWidth = get_width();
|
||||
options.windowHeight = get_height();
|
||||
options.windowMaximized = false;
|
||||
}
|
||||
else
|
||||
options.windowMaximized = true;
|
||||
|
||||
Options::save ();
|
||||
hide();
|
||||
|
@@ -53,7 +53,9 @@ class RTWindow : public Gtk::Window, public rtengine::ProgressListener{
|
||||
|
||||
bool keyPressed (GdkEventKey* event);
|
||||
bool on_delete_event(GdkEventAny* event);
|
||||
|
||||
bool on_my_window_state_event(GdkEventWindowState* event);
|
||||
void on_mainNB_switch_page(GtkNotebookPage* page, guint page_num);
|
||||
|
||||
void imageDeveloped (Glib::ustring fname); // called by the batchqueue when it finishes an image
|
||||
void showPreferences ();
|
||||
void on_realize ();
|
||||
|
Reference in New Issue
Block a user