Left and right panels of the directory browser and the editor tab now remember theire position when RT is restarted. When a new editor tab opens, it remember the last width value. Morever, if you change the width if the left or right panel in one editor tab, it does propagate in all the others.
Those values are stored in the options file. This is not related to the automatic grow of the window when an editor opens (not solved yet). To avoid having too wide windows at the first start, the font of all styles are now "sans 10".
This commit is contained in:
parent
2cb62531a6
commit
05f70a7a99
@ -65,8 +65,8 @@ SaveParamsToCache=true
|
||||
LoadParamsFromLocation=0
|
||||
|
||||
[GUI]
|
||||
WindowWidth=1000
|
||||
WindowHeight=900
|
||||
WindowWidth=900
|
||||
WindowHeight=560
|
||||
WindowMaximized=false
|
||||
FileBrowserHeight=250
|
||||
ToolPanelWidth=300
|
||||
|
@ -65,8 +65,8 @@ SaveParamsToCache=true
|
||||
LoadParamsFromLocation=0
|
||||
|
||||
[GUI]
|
||||
WindowWidth=1000
|
||||
WindowHeight=900
|
||||
WindowWidth=900
|
||||
WindowHeight=560
|
||||
WindowMaximized=false
|
||||
FileBrowserHeight=250
|
||||
ToolPanelWidth=300
|
||||
|
@ -65,8 +65,8 @@ SaveParamsToCache=true
|
||||
LoadParamsFromLocation=0
|
||||
|
||||
[GUI]
|
||||
WindowWidth=1000
|
||||
WindowHeight=900
|
||||
WindowWidth=900
|
||||
WindowHeight=560
|
||||
WindowMaximized=false
|
||||
FileBrowserHeight=250
|
||||
ToolPanelWidth=300
|
||||
|
@ -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 }
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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 8"
|
||||
|
||||
GtkRange::trough_border = 0
|
||||
GtkRange::slider_width = 14
|
||||
|
@ -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
|
||||
|
@ -192,7 +192,8 @@ EditorPanel::EditorPanel () : beforePreviewHandler(NULL), beforeIarea(NULL), par
|
||||
|
||||
hpanedr->pack1(*hpanedl, true, true);
|
||||
hpanedr->pack2(*vboxright, false, true);
|
||||
//hpanedr->set_position(options.toolPanelWidth);
|
||||
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 ();
|
||||
@ -263,6 +264,40 @@ EditorPanel::~EditorPanel () {
|
||||
delete saveAsDialog;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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) {
|
||||
|
||||
// initialize everything
|
||||
@ -849,12 +884,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) {
|
||||
|
||||
|
@ -104,6 +104,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; }
|
||||
|
||||
@ -138,7 +142,7 @@ class EditorPanel : public Gtk::VBox,
|
||||
Glib::ustring getFileName ();
|
||||
bool handleShortcutKey (GdkEventKey* event);
|
||||
|
||||
void saveOptions ();
|
||||
//void saveOptions ();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -47,7 +47,7 @@ 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());
|
||||
@ -88,8 +88,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);
|
||||
@ -99,9 +99,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);
|
||||
|
||||
@ -111,6 +109,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 ();
|
||||
@ -161,9 +168,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;
|
||||
@ -58,6 +59,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); }
|
||||
|
||||
|
@ -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;
|
||||
@ -252,6 +253,7 @@ if (keyFile.has_group ("GUI")) {
|
||||
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");
|
||||
@ -381,6 +383,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;
|
||||
|
@ -47,6 +47,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);
|
||||
@ -108,9 +109,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);
|
||||
@ -133,7 +155,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);
|
||||
|
||||
@ -144,7 +168,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);
|
||||
@ -222,14 +246,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();
|
||||
|
@ -52,6 +52,8 @@ 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 ();
|
||||
|
Loading…
x
Reference in New Issue
Block a user