diff --git a/rtdata/options/options.lin b/rtdata/options/options.lin index 5dc0b9389..e046ff2f2 100644 --- a/rtdata/options/options.lin +++ b/rtdata/options/options.lin @@ -66,8 +66,8 @@ SaveParamsToCache=true LoadParamsFromLocation=0 [GUI] -WindowWidth=1000 -WindowHeight=900 +WindowWidth=900 +WindowHeight=560 WindowMaximized=false FileBrowserHeight=250 ToolPanelWidth=300 diff --git a/rtdata/options/options.osx b/rtdata/options/options.osx index 1dc8880c3..5d9d4f813 100644 --- a/rtdata/options/options.osx +++ b/rtdata/options/options.osx @@ -66,8 +66,8 @@ SaveParamsToCache=true LoadParamsFromLocation=0 [GUI] -WindowWidth=1000 -WindowHeight=900 +WindowWidth=900 +WindowHeight=560 WindowMaximized=false FileBrowserHeight=250 ToolPanelWidth=300 diff --git a/rtdata/options/options.win b/rtdata/options/options.win index 2021a0fb5..4c450f427 100644 --- a/rtdata/options/options.win +++ b/rtdata/options/options.win @@ -66,8 +66,8 @@ SaveParamsToCache=true LoadParamsFromLocation=0 [GUI] -WindowWidth=1000 -WindowHeight=900 +WindowWidth=900 +WindowHeight=560 WindowMaximized=false FileBrowserHeight=250 ToolPanelWidth=300 diff --git a/rtdata/themes/ClearLooks (Dark Orange) b/rtdata/themes/ClearLooks (Dark Orange) index 74f839aed..dc86995e6 100644 --- a/rtdata/themes/ClearLooks (Dark Orange) +++ b/rtdata/themes/ClearLooks (Dark Orange) @@ -23,6 +23,7 @@ style "clearlooks-default" { + font_name = "sans 8" GtkMenuItem::selected_shadow_type = none GtkWidget::interior_focus = 1 GtkButton::default_border = { 3, 3, 3, 3 } diff --git a/rtdata/themes/Dark b/rtdata/themes/Dark index 11e332b29..3d1d6dded 100644 --- a/rtdata/themes/Dark +++ b/rtdata/themes/Dark @@ -26,7 +26,7 @@ style "clearlooks-default" { - font_name = "tahoma 8" + font_name = "sans 8" GtkButton ::default_border = { 0, 0, 0, 0 } GtkComboBox ::default_border = { 0, 0, 0, 0 } GtkRange ::trough_border = 0 diff --git a/rtdata/themes/Default b/rtdata/themes/Default index 9693e0ba5..600eeefa2 100644 --- a/rtdata/themes/Default +++ b/rtdata/themes/Default @@ -26,7 +26,7 @@ style "clearlooks-default" { -font_name = "tahoma 8" + font_name = "sans 8" GtkButton ::default_border = { 0, 0, 0, 0 } GtkRange ::trough_border = 0 GtkPaned ::handle_size = 6 diff --git a/rtdata/themes/Gray b/rtdata/themes/Gray index 12e794db5..9a5cf0170 100644 --- a/rtdata/themes/Gray +++ b/rtdata/themes/Gray @@ -19,7 +19,7 @@ style "theme-default" { - font_name = "tahoma 12" + font_name = "sans 8" GtkButton ::default_border = { 0, 0, 0, 0 } GtkRange ::trough_border = 1 diff --git a/rtdata/themes/Gray Textured b/rtdata/themes/Gray Textured index 1576fcba2..f906abd87 100644 --- a/rtdata/themes/Gray Textured +++ b/rtdata/themes/Gray Textured @@ -32,7 +32,7 @@ style "clearlooks-default" # change it to use an actual font, enter the full name of the font # here, along with optional style and size, e.g. # "Monaco Bold 15". - font_name = "Default" + font_name = "sans 10" GtkRange::trough_border = 0 GtkRange::slider_width = 14 diff --git a/rtdata/themes/Light b/rtdata/themes/Light index 92064a2a2..05e7d6621 100644 --- a/rtdata/themes/Light +++ b/rtdata/themes/Light @@ -23,7 +23,7 @@ style "clearlooks-default" { -font_name = "sans 8" + font_name = "sans 8" GtkButton ::default_border = { 0, 0, 0, 0 } GtkRange ::trough_border = 0 GtkPaned ::handle_size = 6 diff --git a/rtgui/cropwindow.cc b/rtgui/cropwindow.cc index e42834067..c0988ccae 100644 --- a/rtgui/cropwindow.cc +++ b/rtgui/cropwindow.cc @@ -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); diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index ea4fac5de..4ec439529 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -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 *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) { diff --git a/rtgui/editorpanel.h b/rtgui/editorpanel.h index 27c5e4484..211df5fd2 100644 --- a/rtgui/editorpanel.h +++ b/rtgui/editorpanel.h @@ -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; }; diff --git a/rtgui/filepanel.cc b/rtgui/filepanel.cc index a9e647d6c..c3d0edd9b 100644 --- a/rtgui/filepanel.cc +++ b/rtgui/filepanel.cc @@ -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, ProgressConnectorget_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 (); diff --git a/rtgui/filepanel.h b/rtgui/filepanel.h index 3d416ad6d..0cef8b289 100644 --- a/rtgui/filepanel.h +++ b/rtgui/filepanel.h @@ -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& efiles) { fileCatalog->refreshEditedState (efiles); } diff --git a/rtgui/imagearea.cc b/rtgui/imagearea.cc index 167670c0a..ede4567a4 100644 --- a/rtgui/imagearea.cc +++ b/rtgui/imagearea.cc @@ -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); diff --git a/rtgui/imagearea.h b/rtgui/imagearea.h index 9b519b2db..cbf489c60 100644 --- a/rtgui/imagearea.h +++ b/rtgui/imagearea.h @@ -37,7 +37,6 @@ class ImageArea : public Gtk::DrawingArea, public CropWindowListener { protected: - bool showInfo; Glib::ustring infotext; Glib::RefPtr ilayout; Glib::RefPtr deglayout; diff --git a/rtgui/options.cc b/rtgui/options.cc index 7f1de6407..f2442c8bf 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -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); diff --git a/rtgui/options.h b/rtgui/options.h index 0537bc859..5e9b6fbb7 100644 --- a/rtgui/options.h +++ b/rtgui/options.h @@ -66,6 +66,7 @@ class Options { int saveAsDialogHeight; int toolPanelWidth; int browserToolPanelWidth; + int browserToolPanelHeight; int historyPanelWidth; int windowWidth; int windowHeight; diff --git a/rtgui/rtwindow.cc b/rtgui/rtwindow.cc index 47dcb6065..dd2155bcf 100644 --- a/rtgui/rtwindow.cc +++ b/rtgui/rtwindow.cc @@ -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(); diff --git a/rtgui/rtwindow.h b/rtgui/rtwindow.h index 9956aae42..4e966be01 100644 --- a/rtgui/rtwindow.h +++ b/rtgui/rtwindow.h @@ -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 ();