diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2005-11-07 08:39:23 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2005-11-07 08:39:23 +0000 |
| commit | 0a41e770c38a284612730ff7f4b229ef21123ddf (patch) | |
| tree | 8ff2e552faded7015ff712fb50f7ff18429ae571 /src/Fl_File_Chooser2.cxx | |
| parent | 1fe85a8c181587a6f6f88fab08c7f9a316d4759d (diff) | |
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
Diffstat (limited to 'src/Fl_File_Chooser2.cxx')
| -rw-r--r-- | src/Fl_File_Chooser2.cxx | 17 |
1 files changed, 10 insertions, 7 deletions
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(); } |
