From 0a41e770c38a284612730ff7f4b229ef21123ddf Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Mon, 7 Nov 2005 08:39:23 +0000 Subject: STR #1062: updated code to resize the preview panel of the file chooser and hide it entirely if unused git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4643 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_File_Chooser2.cxx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/Fl_File_Chooser2.cxx') diff --git a/src/Fl_File_Chooser2.cxx b/src/Fl_File_Chooser2.cxx index 128a28bf9..a761e52f6 100644 --- a/src/Fl_File_Chooser2.cxx +++ b/src/Fl_File_Chooser2.cxx @@ -788,20 +788,23 @@ Fl_File_Chooser::preview(int e)// I - 1 = enable preview, 0 = disable preview previewButton->value(e); prefs_.set("preview", e); + Fl_Group *p = previewBox->parent(); if (e) { - int w = previewBox->h() * 2 / 3; + int w = p->w() * 2 / 3; fileList->resize(fileList->x(), fileList->y(), - window->w() - 20 - w, fileList->h()); - previewBox->resize(window->w() - 10 - w, previewBox->y(), - w, previewBox->h()); - + w, fileList->h()); + previewBox->resize(fileList->x()+w, previewBox->y(), + p->w()-w, previewBox->h()); + previewBox->show(); update_preview(); } else { fileList->resize(fileList->x(), fileList->y(), - window->w() - 20, fileList->h()); - previewBox->resize(window->w() - 10, previewBox->y(), + p->w(), fileList->h()); + previewBox->resize(p->x()+p->w(), previewBox->y(), 0, previewBox->h()); + previewBox->hide(); } + p->init_sizes(); fileList->parent()->redraw(); } -- cgit v1.2.3