------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee. http://bugs.kde.org/show_bug.cgi?id=140131 ------- Additional Comments From marcel.wiesweg gmx de 2007-04-09 15:41 ------- It's technically not a problem to pan when dragging the mouse and exit on single click. The question is if this confuses users, or if it comes natural to expect. (Apart from the question of mouse dragging, personally I am very much in favor of the exit-on-click functionality. It is very convenient when browsing and quickly viewing some pictures. No need to move the mouse back to a tiny button somewhere. The whole picture is the largest possible mouse target.) _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Alan Flisch
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee. http://bugs.kde.org/show_bug.cgi?id=140131 ------- Additional Comments From hugelmopf web de 2007-04-09 19:28 ------- I just noticed, that I only sent my comment to the mailing list, and since that topic is discussed in this thread, I am sending a copy here now: Arnd Baecker wrote: > - And another one: I happen to press the left-mouse > (having panning in mind) quite frequently, which brings > me back to the thumbnail view (which I did not want;-) - not sure > if this is optimal from the useability point of view > (I know that the "return-on-left-click" was a wish brought > up a while ago...;-) It was me, who brought up this wish back then, and I still do like it very much to go forth and back with simple clicks. But of course these new developments in F3-preview require some adjustments. It would be perfect in my opinion, if you could go back on a single click, while it would pan on dragging your mouse (i.e. holding down the click and move the mouse). This would nicely account for both needs, wouldn't it? I don't know, whether this is easy with Qt/KDE. > There is maybe one very important point: > the zoom as it is presently done, uses a reduced-size version of the > underlying image, right? > So while it is nice to be able to zoom in, it does not allow for > a judgement of the image quality (in contrast to the image editor). > Do you think that there is a way to use the actual image > (maybe from a certain zoom-level on?) But that would (quite > certainly?) slow things down... > > In particular for the upcoming light-table I think it is important > to compare the real images, not just up-scaled ones > > Uups: I just realized that for zooming in, the image editor also > some interpolation is done, so that that one does not see the single > pixels, but some nicely interpolated version? A solution might be the following: While you move the slider, the image could be fast-scaled, and when you release the slider, the pixmap could be smoothly replaced in the background by the real picture. Same for Zoom+ and Zoom- buttons: on button click, immediately display a fast scaled version, and with a short delay after release, if the buttons has not been clicked again, replace it by the real picture. _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Alan Flisch
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee. http://bugs.kde.org/show_bug.cgi?id=140131 ------- Additional Comments From caulier.gilles gmail com 2007-04-10 08:20 ------- SVN commit 652122 by cgilles: digiKam from trunk : Zoom In/Out buttons are now in statusbar, around the zoom slider. CCBUGS: 140131 M +29 -2 digikamapp.cpp M +6 -0 digikamappprivate.h M +1 -4 digikamui.rc --- trunk/extragear/graphics/digikam/digikam/digikamapp.cpp #652121:652122 @ -30,6 +30,7 @ #include <qtooltip.h> #include <qsignalmapper.h> #include <qdockarea.h> +#include <qhbox.h> // KDE includes. @ -341,19 +342,43 @ d->statusProgressBar->setMaximumHeight(fontMetrics().height()+2); statusBar()->addWidget(d->statusProgressBar, 100, true); + //------------------------------------------------------------------------------ + + QHBox *zoomBar = new QHBox(statusBar()); + + d->zoomMinusButton = new QToolButton(zoomBar); + d->zoomMinusButton->setAutoRaise(true); + d->zoomMinusButton->setIconSet(SmallIconSet("viewmag-")); + QToolTip::add(d->zoomMinusButton, i18n("Zoom out")); + d->thumbSizeSlider = new QSlider(ThumbnailSize::Small, ThumbnailSize::Huge, ThumbnailSize::Step, ThumbnailSize::Medium, - Qt::Horizontal, statusBar()); + Qt::Horizontal, zoomBar); d->thumbSizeSlider->setMaximumHeight(fontMetrics().height()+2); d->thumbSizeSlider->setFixedWidth(120); + d->zoomPlusButton = new QToolButton(zoomBar); + d->zoomPlusButton->setAutoRaise(true); + d->zoomPlusButton->setIconSet(SmallIconSet("viewmag+")); + QToolTip::add(d->zoomPlusButton, i18n("Zoom in")); + d->thumbSizeTracker = new DTipTracker("", d->thumbSizeSlider); - statusBar()->addWidget(d->thumbSizeSlider, 1, true); + + statusBar()->addWidget(zoomBar, 1, true); + + //------------------------------------------------------------------------------ + d->statusNavigateBar = new StatusNavigateBar(statusBar()); d->statusNavigateBar->setMaximumHeight(fontMetrics().height()+2); statusBar()->addWidget(d->statusNavigateBar, 1, true); + connect(d->zoomMinusButton, SIGNAL(clicked()), + d->view, SLOT(slotZoomOut())); + + connect(d->zoomPlusButton, SIGNAL(clicked()), + d->view, SLOT(slotZoomIn())); + connect(d->thumbSizeSlider, SIGNAL(valueChanged(int)), this, SLOT(slotThumbSizeTimer(int))); @ -924,11 +949,13 @ void DigikamApp::enableThumbSizePlusAction(bool val) { d->thumbSizePlusAction->setEnabled(val); + d->zoomPlusButton->setEnabled(val); } void DigikamApp::enableThumbSizeMinusAction(bool val) { d->thumbSizeMinusAction->setEnabled(val); + d->zoomMinusButton->setEnabled(val); } void DigikamApp::enableAlbumBackwardHistory(bool enable) --- trunk/extragear/graphics/digikam/digikam/digikamappprivate.h #652121:652122 @ -24,6 +24,7 @ #include <qstring.h> #include <qmap.h> #include <qslider.h> +#include <qtoolbutton.h> #include <qtimer.h> // KDE includes. @ -131,6 +132,8 @ splashScreen = 0; thumbSizeSlider = 0; thumbSizeTracker = 0; + zoomMinusButton = 0; + zoomPlusButton = 0; } bool fullScreen; @ -150,6 +153,9 @ QString cameraGuiPath; + QToolButton *zoomPlusButton; + QToolButton *zoomMinusButton; + KPopupMenu *cameraMediaList; KAccel *accelerators; --- trunk/extragear/graphics/digikam/digikam/digikamui.rc #652121:652122 @ -1,5 +1,5 @ <!DOCTYPE kpartgui SYSTEM "kpartgui.dtd"> -<kpartgui version="22" name="digikam" > +<kpartgui version="23" name="digikam" > <MenuBar> @ -123,9 +123,6 @ <Action name="image_edit" /> <Action name="image_rename" /> <Separator/> - <Action name="album_zoomin" /> - <Action name="album_zoomout" /> - <Separator/> <Action name="full_screen" /> <Action name="slideshow" /> </ToolBar> _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Alan Flisch
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee. http://bugs.kde.org/show_bug.cgi?id=140131 ------- Additional Comments From arnd.baecker web de 2007-04-10 11:47 ------- In addition to the other points: using CTRL mousewheel, the slider position is not updated. The corrupted image problem on zooming seems to be gone. Frank suggested in #16: > A solution might be the following: While you move the slider, the image > could be fast-scaled, and when you release the slider, the pixmap could be > smoothly replaced in the background by the real picture. > Same for Zoom+ and Zoom- buttons: on button click, immediately display a > fast scaled version, and with a short delay after release, if the buttons > has not been clicked again, replace it by the real picture. I very much like this idea! _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Alan Flisch
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee. http://bugs.kde.org/show_bug.cgi?id=140131 ------- Additional Comments From fabien.ubuntu gmail com 2007-04-10 12:48 ------- About #15 Just for your information, gqview behaves this way : single click swith to next picture, middle-click switch to previous, drag the mouse pan in the picture and Ctrl+Mousewheel zoom in or out I think this behavior is quite intuitive... _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Alan Flisch
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee. http://bugs.kde.org/show_bug.cgi?id=140131 ------- Additional Comments From caulier.gilles gmail com 2007-04-10 13:18 ------- SVN commit 652199 by cgilles: digikam from trunk : handle properlly the zoom in/out action from preview widget changed by keyboard shorcut and mouse wheel. CCBUGS: 140131 M +5 -2 albumwidgetstack.cpp M +3 -2 albumwidgetstack.h M +3 -3 digikamview.cpp M +2 -0 imagepreviewwidget.cpp M +1 -0 imagepreviewwidget.h --- trunk/extragear/graphics/digikam/digikam/albumwidgetstack.cpp #652198:652199 @ -1,10 +1,10 @ /* ============================================================ - * Authors: Gilles Caulier + * Authors: Gilles Caulier <caulier dot gilles at gmail dot com> * Date : 2006-06-13 * Description : A widget stack to embedded album content view * or the current image preview. * - * Copyright 2006-2007 by Gilles Caulier <caulier dot gilles at gmail dot com> + * Copyright 2006-2007 by Gilles Caulier * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General @ -102,6 +102,9 @ connect(d->imagePreviewView, SIGNAL(signalSlideShow()), this, SIGNAL(signalSlideShow())); + + connect(d->imagePreviewView, SIGNAL(signalZoomFactorChanged(double)), + this, SIGNAL(signalZoomFactorChanged(double))); } AlbumWidgetStack::~AlbumWidgetStack() --- trunk/extragear/graphics/digikam/digikam/albumwidgetstack.h #652198:652199 @ -1,10 +1,10 @ /* ============================================================ - * Authors: Gilles Caulier + * Authors: Gilles Caulier <caulier dot gilles at gmail dot com> * Date : 2006-06-13 * Description : A widget stack to embedded album content view * or the current image preview. * - * Copyright 2006-2007 by Gilles Caulier <caulier dot gilles at gmail dot com> + * Copyright 2006-2007 by Gilles Caulier * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General @ -84,6 +84,7 @ void signalToggledToPreviewMode(bool); void signalBack2Album(); void signalSlideShow(); + void signalZoomFactorChanged(double); public slots: --- trunk/extragear/graphics/digikam/digikam/digikamview.cpp #652198:652199 @ -340,6 +340,9 @ connect(d->albumWidgetStack, SIGNAL(signalSlideShow()), this, SLOT(slotSlideShowAll())); + connect(d->albumWidgetStack, SIGNAL(signalZoomFactorChanged(double)), + this, SIGNAL(signalZoomChanged(double))); + // -- Selection timer --------------- connect(d->selectionTimer, SIGNAL(timeout()), @ -722,7 +725,6 @ double a = (zmax-b)/h; double z = a*size+b; d->albumWidgetStack->setZoomFactor(z); - emit signalZoomChanged(d->albumWidgetStack->zoomFactor()); } else if (d->albumWidgetStack->previewMode() == AlbumWidgetStack::PreviewAlbumMode) { @ -799,7 +801,6 @ { d->albumWidgetStack->increaseZoom(); toogleZoomActions(); - emit signalZoomChanged(d->albumWidgetStack->zoomFactor()); } } @ -815,7 +816,6 @ { d->albumWidgetStack->decreaseZoom(); toogleZoomActions(); - emit signalZoomChanged(d->albumWidgetStack->zoomFactor()); } } --- trunk/extragear/graphics/digikam/digikam/imagepreviewwidget.cpp #652198:652199 @ -435,6 +435,8 @ (int)(((cpy * d->zoom) * (d->tileSize / d->zoom)) / floor(d->tileSize / d->zoom))); viewport()->setUpdatesEnabled(true); viewport()->update(); + + emit signalZoomFactorChanged(d->zoom); } double ImagePreviewWidget::zoomFactor() --- trunk/extragear/graphics/digikam/digikam/imagepreviewwidget.h #652198:652199 @ -62,6 +62,7 @ void signalLeftButtonClicked(); void signalShowNextImage(); void signalShowPrevImage(); + void signalZoomFactorChanged(double); public slots: _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Alan Flisch
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee. http://bugs.kde.org/show_bug.cgi?id=140131 ------- Additional Comments From caulier.gilles gmail com 2007-04-10 14:43 ------- To Arnd, #18: >using CTRL mousewheel, the slider position is not updated. Fixed in svn. > The corrupted image problem on zooming seems to be gone. Patch ready to be applied to svn. I'm waiting feedback from Antionio Larrosa (who have reported also this problem and have proposed solution to fix it). Gilles _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Alan Flisch
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee. http://bugs.kde.org/show_bug.cgi?id=140131 ------- Additional Comments From caulier.gilles gmail com 2007-04-10 14:57 ------- To Arnd, #11 : >Wow - that zooming looks absolutely great!!!! Thanks >Some observations and comments: >- I also observe artefacts at different zoom-levels > (eg. at 92 % and at 397%, but these values differ from image to > image; also this only seems to happen when using CTRL+ and CTRL-, > but not the slider?) Artifact are give from FastScale algorithm from Antonio Larrossa. Investigation are under progress to fix it. Slider step is more fine than CTRL+/- or mouse wheel. This is why you can see a diff. >- pressing F4 to open the image editor: the zoom in the album view > is undone (however, moving the slider afterwards shows, that it is > still zoomed in) Hum, fixed in svn i think. >- maybe related: somehow the previous zoom-level is memorized: > F3 for an image and zoom in (e.g. 1000%) > ESC to leave > F3 again: the image is displayed to fit the available space, > but the slider is still on 1000%. Right, i will fix it. >- the zoom percentages do not seem to match with the values in > the image editor (but maybe I am wrong): I.e., > shouldn't 100% mean that one image pixel corresponds one > display pixel? 100% is the real image size on the screen. >- Maybe just a personal problem: I always find my to press CTRL-Q > to leave the large view (obviously because of the large display > some corner of my brain thinks that this must be the image editor), > but this does leave digikam (which does indeed leave the large view, > but not in the way I wanted ...) Here i use 3 flat screens with Xinerama. not reproductible. >- And another one: I happen to press the left-mouse > (having panning in mind) quite frequently, which brings > me back to the thumbnail view (which I did not want;-) - not sure > if this is optimal from the useability point of view > (I know that the "return-on-left-click" was a wish brought > up a while ago...;-) preview with zooming/scrooling work like old static preview mode : when you press on left mouse button, you go back to album view. F-spot work like this too. The canvas preview use the same implementation than canvas from editor. You pan the image when you use central mouse buttom. Gimp work like this. Some wishes: >- When zoomed in: a pan-window widget in the lower-right corner > where the scroll-bars meet > (as in the image editor) would be nice TODO >- it would be nice if the position of the mouse would be > the center around which the zoom is done > (I also mentioned this as a wish for the image editor zoom, > but did not yet manage to look into the logic there, should > be fairly easy to implement...) TODO >There is maybe one very important point: >the zoom as it is presently done, uses a reduced-size version of the >underlying image, right? yes >So while it is nice to be able to zoom in, it does not allow for >a judgement of the image quality (in contrast to the image editor). >Do you think that there is a way to use the actual image >(maybe from a certain zoom-level on?) But that would (quite >certainly?) slow things down... no. the implementation is not do in this way. All tool to change the image are in editor. Preview mode is not an editor. >In particular for the upcoming light-table I think it is important >to compare the real images, not just up-scaled ones Light Table is planed (:=))) Uups: I just realized that for zooming in, the image editor also some interpolation is done, so that that one does not see the single pixels, but some nicely interpolated version? You want mean to have an option to disable interpolation with Zoom in (named antialiasing in editor) ? Gilles _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
> >- pressing F4 to open the image editor: the zoom in the album view
> > is undone (however, moving the slider afterwards shows, that it is > > still zoomed in) > > Hum, fixed in svn i think. Just tried with revision 652228: the problem persists; steps to reproduce are: - F3 - zoom in (e.g. 1200%) - F4 ==> the zoom in the album view is undone. > >So while it is nice to be able to zoom in, it does not allow for > >a judgement of the image quality (in contrast to the image editor). > >Do you think that there is a way to use the actual image > >(maybe from a certain zoom-level on?) But that would (quite > >certainly?) slow things down... > > no. the implementation is not do in this way. All tool to change the image are in editor. Preview mode is not an editor. Well, I was not thinking of editing the image, but just displaying it at its actual resolution from a certain zoom-level on. I think Frank's suggestion in #16 would be a very good solution. > Uups: I just realized that for zooming in, the image editor also > some interpolation is done, so that that one does not see the single > pixels, but some nicely interpolated version? > > You want mean to have an option to disable interpolation with Zoom in (named antialiasing in editor) ? I think that this would be good to have. (The quality of the interpolation is very good, but to just judge the quality on the pixel-level alone it would be good to have no interpolation - e.g for gqview this corresponds to the "interpolation=nearest") _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Alan Flisch
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee. http://bugs.kde.org/show_bug.cgi?id=140131 ------- Additional Comments From arnd.baecker web de 2007-04-10 15:27 ------- > >- pressing F4 to open the image editor: the zoom in the album view > > is undone (however, moving the slider afterwards shows, that it is > > still zoomed in) > > Hum, fixed in svn i think. Just tried with revision 652228: the problem persists; steps to reproduce are: - F3 - zoom in (e.g. 1200%) - F4 ==> the zoom in the album view is undone. > >So while it is nice to be able to zoom in, it does not allow for > >a judgement of the image quality (in contrast to the image editor). > >Do you think that there is a way to use the actual image > >(maybe from a certain zoom-level on?) But that would (quite > >certainly?) slow things down... > > no. the implementation is not do in this way. All tool to change the image are in editor. Preview mode is not an editor. Well, I was not thinking of editing the image, but just displaying it at its actual resolution from a certain zoom-level on. I think Frank's suggestion in #16 would be a very good solution. > Uups: I just realized that for zooming in, the image editor also > some interpolation is done, so that that one does not see the single > pixels, but some nicely interpolated version? > > You want mean to have an option to disable interpolation with Zoom in (named antialiasing in editor) ? I think that this would be good to have. (The quality of the interpolation is very good, but to just judge the quality on the pixel-level alone it would be good to have no interpolation - e.g for gqview this corresponds to the "interpolation=nearest") _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Alan Flisch
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee. http://bugs.kde.org/show_bug.cgi?id=140131 ------- Additional Comments From caulier.gilles gmail com 2007-04-10 16:30 ------- >Just tried with revision 652228: the problem persists; steps to >reproduce are: >- F3 >- zoom in (e.g. 1200%) >- F4 ==> the zoom in the album view is undone. Fixed in svn... Gilles _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Alan Flisch
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee. http://bugs.kde.org/show_bug.cgi?id=140131 ------- Additional Comments From mikmach wp pl 2007-04-10 17:31 ------- > You want mean to have an option to disable interpolation with Zoom in > (named antialiasing in editor) ? Yes. Quality of interpolation is very good but sometimes I have to see real image. m. _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Gilles Caulier-4
> Patch ready to be applied to svn. I'm waiting feedback from Antionio
> Larrosa (who have reported also this problem and have proposed solution > to fix it). Not sure if patch was already applied but in ver. 652270 problem still exists. _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Alan Flisch
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee. http://bugs.kde.org/show_bug.cgi?id=140131 ------- Additional Comments From larrosa kde org 2007-04-11 03:20 ------- SVN commit 652434 by antlarr: Fixed a precision problem that produced some artifacts when zooming images in the preview and canvas since a wrong tile was chosen when painting. CCBUGS: 140131 M +6 -6 digikam/imagepreviewwidget.cpp M +16 -20 utilities/imageeditor/canvas/canvas.cpp --- trunk/extragear/graphics/digikam/digikam/imagepreviewwidget.cpp #652433:652434 @ -265,8 +265,8 @ pix->fill(d->bgColor); - sx = (int)floor(((double)i / d->zoom) / (d->tileSize / d->zoom)) * step; - sy = (int)floor(((double)j / d->zoom) / (d->tileSize / d->zoom)) * step; + sx = (int)floor((double)i / d->tileSize ) * step; + sy = (int)floor((double)j / d->tileSize ) * step; sw = step; sh = step; @ -427,8 +427,8 @ double cpx = contentsX() + visibleWidth() / 2.0; double cpy = contentsY() + visibleHeight() / 2.0; - cpx = ((cpx / d->zoom) / (d->tileSize / d->zoom)) * floor(d->tileSize / d->zoom); - cpy = ((cpy / d->zoom) / (d->tileSize / d->zoom)) * floor(d->tileSize / d->zoom); + cpx = ( cpx / d->tileSize ) * floor(d->tileSize / d->zoom); + cpy = ( cpy / d->tileSize ) * floor(d->tileSize / d->zoom); // To limit precision of zoom value and reduce error with check of max/min zoom. d->zoom = floor(zoom * 10000.0) / 10000.0; @ -438,8 +438,8 @ updateContentsSize(); viewport()->setUpdatesEnabled(false); - center((int)(((cpx * d->zoom) * (d->tileSize / d->zoom)) / floor(d->tileSize / d->zoom)), - (int)(((cpy * d->zoom) * (d->tileSize / d->zoom)) / floor(d->tileSize / d->zoom))); + center((int)((cpx * d->tileSize ) / floor(d->tileSize / d->zoom)), + (int)((cpy * d->tileSize ) / floor(d->tileSize / d->zoom))); viewport()->setUpdatesEnabled(true); viewport()->update(); --- trunk/extragear/graphics/digikam/utilities/imageeditor/canvas/canvas.cpp #652433:652434 @ -433,10 +433,10 @ { int xSel, ySel, wSel, hSel; d->im->getSelectedArea(xSel, ySel, wSel, hSel); - xSel = (int)(((xSel * d->zoom) * (d->tileSize / d->zoom)) / floor(d->tileSize / d->zoom)); - ySel = (int)(((ySel * d->zoom) * (d->tileSize / d->zoom)) / floor(d->tileSize / d->zoom)); - wSel = (int)(((wSel * d->zoom) * (d->tileSize / d->zoom)) / floor(d->tileSize / d->zoom)); - hSel = (int)(((hSel * d->zoom) * (d->tileSize / d->zoom)) / floor(d->tileSize / d->zoom)); + xSel = (int)((xSel * d->tileSize) / floor(d->tileSize / d->zoom)); + ySel = (int)((ySel * d->tileSize) / floor(d->tileSize / d->zoom)); + wSel = (int)((wSel * d->tileSize) / floor(d->tileSize / d->zoom)); + hSel = (int)((hSel * d->tileSize) / floor(d->tileSize / d->zoom)); d->rubber->setX(xSel); d->rubber->setY(ySel); d->rubber->setWidth(wSel); @ -550,8 +550,8 @ // The new implementation below fix this problem to handle properly the areas to // use from the source image to generate the canvas pixmap tiles. - sx = (int)floor(((double)i / d->zoom) / (d->tileSize / d->zoom)) * step; - sy = (int)floor(((double)j / d->zoom) / (d->tileSize / d->zoom)) * step; + sx = (int)floor((double)i / d->tileSize) * step; + sy = (int)floor((double)j / d->tileSize) * step; sw = step; sh = step; @ -933,8 +933,8 @ double cpx = contentsX() + visibleWidth() / 2.0; double cpy = contentsY() + visibleHeight() / 2.0; - cpx = ((cpx / d->zoom) / (d->tileSize / d->zoom)) * floor(d->tileSize / d->zoom); - cpy = ((cpy / d->zoom) / (d->tileSize / d->zoom)) * floor(d->tileSize / d->zoom); + cpx = (cpx / d->tileSize) * floor(d->tileSize / d->zoom); + cpy = (cpy / d->tileSize) * floor(d->tileSize / d->zoom); d->zoom = zoom; @ -942,8 +942,8 @ updateContentsSize(false); viewport()->setUpdatesEnabled(false); - center((int)(((cpx * d->zoom) * (d->tileSize / d->zoom)) / floor(d->tileSize / d->zoom)), - (int)(((cpy * d->zoom) * (d->tileSize / d->zoom)) / floor(d->tileSize / d->zoom))); + center((int)((cpx * d->tileSize) / floor(d->tileSize / d->zoom)), + (int)((cpy * d->tileSize) / floor(d->tileSize / d->zoom))); viewport()->setUpdatesEnabled(true); viewport()->update(); @ -974,8 +974,8 @ updateContentsSize(true); viewport()->setUpdatesEnabled(false); - center((int)(((cpx * d->zoom) * (d->tileSize / d->zoom)) / floor(d->tileSize / d->zoom)), - (int)(((cpy * d->zoom) * (d->tileSize / d->zoom)) / floor(d->tileSize / d->zoom))); + center((int)((cpx * d->tileSize) / floor(d->tileSize / d->zoom)), + (int)((cpy * d->tileSize) / floor(d->tileSize / d->zoom))); viewport()->setUpdatesEnabled(true); viewport()->update(); @ -1194,17 +1194,13 @ { r.moveBy(- d->pixmapRect.x(), - d->pixmapRect.y()); - int step = (int)floor(d->tileSize / d->zoom); + x = (int)(((double)r.x() / d->tileSize) * floor(d->tileSize / d->zoom)); + y = (int)(((double)r.y() / d->tileSize) * floor(d->tileSize / d->zoom)); + w = (int)(((double)r.width() / d->tileSize) * floor(d->tileSize / d->zoom)); + h = (int)(((double)r.height() / d->tileSize) * floor(d->tileSize / d->zoom)); - x = (int)((((double)r.x() / d->zoom) / (d->tileSize / d->zoom)) * step); - y = (int)((((double)r.y() / d->zoom) / (d->tileSize / d->zoom)) * step); - - w = (int)((((double)r.width() / d->zoom) / (d->tileSize / d->zoom)) * step); - h = (int)((((double)r.height() / d->zoom) / (d->tileSize / d->zoom)) * step); - x = QMIN(imageWidth(), QMAX(x, 0)); y = QMIN(imageHeight(), QMAX(y, 0)); - w = QMIN(imageWidth(), QMAX(w, 0)); h = QMIN(imageHeight(), QMAX(h, 0)); _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Alan Flisch
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee. http://bugs.kde.org/show_bug.cgi?id=140131 ------- Additional Comments From caulier.gilles gmail com 2007-04-12 09:15 ------- SVN commit 652884 by cgilles: digikam from trunk : pan icon widget is back with Preview Mode... CCBUGS: 140131 M +107 -10 digikam/imagepreviewwidget.cpp M +4 -0 digikam/imagepreviewwidget.h M +2 -2 libs/widgets/common/Makefile.am AM libs/widgets/common/paniconwidget.cpp [License: GPL] AM libs/widgets/common/paniconwidget.h [License: GPL] --- trunk/extragear/graphics/digikam/digikam/imagepreviewwidget.cpp #652883:652884 @ -24,6 +24,7 @ // Qt includes. +#include <qtooltip.h> #include <qcache.h> #include <qpainter.h> #include <qimage.h> @ -31,12 +32,15 @ #include <qrect.h> #include <qtimer.h> #include <qguardedptr.h> +#include <qtoolbutton.h> // KDE include. #include <kcursor.h> #include <kprocess.h> #include <klocale.h> +#include <kdatetbl.h> +#include <kiconloader.h> // Local includes. @ -44,6 +48,7 @ #include "fastscale.h" #include "themeengine.h" #include "albumsettings.h" +#include "paniconwidget.h" #include "imagepreviewwidget.h" #include "imagepreviewwidget.moc" @ -57,16 +62,19 @ ImagePreviewWidgetPriv() : tileSize(128), minZoom(0.1), maxZoom(12.0), zoomMultiplier(1.2) { - pressedMoving = false; - midButtonPressed = false; - midButtonX = 0; - midButtonY = 0; - autoZoom = false; - fullScreen = false; - zoom = 1.0; - zoomWidth = 0; - zoomHeight = 0; - tileTmpPix = new QPixmap(tileSize, tileSize); + pressedMoving = false; + midButtonPressed = false; + midButtonX = 0; + midButtonY = 0; + autoZoom = false; + fullScreen = false; + zoom = 1.0; + zoomWidth = 0; + zoomHeight = 0; + panIconPopup = 0; + panIconWidget = 0; + cornerButton = 0; + tileTmpPix = new QPixmap(tileSize, tileSize); tileCache.setMaxCost((10*1024*1024)/(tileSize*tileSize*4)); tileCache.setAutoDelete(true); @ -88,6 +96,8 @ const double maxZoom; const double zoomMultiplier; + QToolButton *cornerButton; + QRect pixmapRect; QCache<QPixmap> tileCache; @ -97,6 +107,10 @ QColor bgColor; QImage preview; + + KPopupFrame *panIconPopup; + + PanIconWidget *panIconWidget; }; ImagePreviewWidget::ImagePreviewWidget(QWidget *parent) @ -112,8 +126,20 @ setMargin(0); setLineWidth(1); + d->cornerButton = new QToolButton(this); + d->cornerButton->setIconSet(SmallIcon("move")); + d->cornerButton->hide(); + QToolTip::add(d->cornerButton, i18n("Pan the image to a region")); + setCornerWidget(d->cornerButton); + // ------------------------------------------------------------ + connect(this, SIGNAL(signalZoomFactorChanged(double)), + this, SLOT(slotZoomChanged(double))); + + connect(d->cornerButton, SIGNAL(pressed()), + this, SLOT(slotCornerButtonPressed())); + connect(ThemeEngine::instance(), SIGNAL(signalThemeChanged()), this, SLOT(slotThemeChanged())); } @ -156,6 +182,8 @ d->zoom = calcAutoZoomFactor(); d->zoomWidth = (int)(d->preview.width() * d->zoom); d->zoomHeight = (int)(d->preview.height() * d->zoom); + + emit signalZoomFactorChanged(d->zoom); } double ImagePreviewWidget::calcAutoZoomFactor() @ -210,6 +238,10 @ // No need to repaint. its called // automatically after resize + + // To be sure than corner widget used to pan image will be hide/show + // accordinly with resize event. + slotZoomChanged(d->zoom); } void ImagePreviewWidget::viewportPaintEvent(QPaintEvent *e) @ -463,10 +495,75 @ if (d->autoZoom) updateAutoZoom(); else + { d->zoom = 1.0; + emit signalZoomFactorChanged(d->zoom); + } updateContentsSize(); viewport()->update(); } +void ImagePreviewWidget::slotCornerButtonPressed() +{ + if (d->panIconPopup) + { + d->panIconPopup->hide(); + delete d->panIconPopup; + d->panIconPopup = 0; + } + + d->panIconPopup = new KPopupFrame(this); + PanIconWidget *pan = new PanIconWidget(d->panIconPopup); + pan->setImage(180, 120, d->preview); + d->panIconPopup->setMainWidget(pan); + + QRect r((int)(contentsX() / d->zoom), (int)(contentsY() / d->zoom), + (int)(visibleWidth() / d->zoom), (int)(visibleHeight() / d->zoom)); + pan->setRegionSelection(r); + pan->setMouseFocus(); + + connect(pan, SIGNAL(signalSelectionMoved(QRect, bool)), + this, SLOT(slotPanIconSelectionMoved(QRect, bool))); + + connect(pan, SIGNAL(signalHiden()), + this, SLOT(slotPanIconHiden())); + + QPoint g = mapToGlobal(viewport()->pos()); + g.setX(g.x()+ viewport()->size().width()); + g.setY(g.y()+ viewport()->size().height()); + d->panIconPopup->popup(QPoint(g.x() - d->panIconPopup->width(), + g.y() - d->panIconPopup->height())); + + pan->setCursorToLocalRegionSelectionCenter(); +} + +void ImagePreviewWidget::slotPanIconHiden() +{ + d->cornerButton->blockSignals(true); + d->cornerButton->animateClick(); + d->cornerButton->blockSignals(false); +} + +void ImagePreviewWidget::slotPanIconSelectionMoved(QRect r, bool b) +{ + setContentsPos((int)(r.x()*d->zoom), (int)(r.y()*d->zoom)); + + if (b) + { + d->panIconPopup->hide(); + delete d->panIconPopup; + d->panIconPopup = 0; + slotPanIconHiden(); + } +} + +void ImagePreviewWidget::slotZoomChanged(double zoom) +{ + if (zoom > calcAutoZoomFactor()) + d->cornerButton->show(); + else + d->cornerButton->hide(); +} + } // NameSpace Digikam --- trunk/extragear/graphics/digikam/digikam/imagepreviewwidget.h #652883:652884 @ -85,6 +85,10 @ private slots: void slotThemeChanged(); + void slotCornerButtonPressed(); + void slotZoomChanged(double); + void slotPanIconSelectionMoved(QRect, bool); + void slotPanIconHiden(); private: --- trunk/extragear/graphics/digikam/libs/widgets/common/Makefile.am #652883:652884 @ -5,7 +5,7 @ libcommonwidgets_la_SOURCES = histogramwidget.cpp colorgradientwidget.cpp curveswidget.cpp \ sidebar.cpp squeezedcombobox.cpp filesaveoptionsbox.cpp \ dpopupmenu.cpp statusnavigatebar.cpp statusprogressbar.cpp \ - dcursortracker.cpp + dcursortracker.cpp paniconwidget.cpp libcommonwidgets_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) @ -17,6 +17,6 @ $(all_includes) digikaminclude_HEADERS = histogramwidget.h colorgradientwidget.h sidebar.h curveswidget.h \ - squeezedcombobox.h dcursortracker.h + squeezedcombobox.h dcursortracker.h paniconwidget.h digikamincludedir = $(includedir)/digikam ** trunk/extragear/graphics/digikam/libs/widgets/common/paniconwidget.cpp #property svn:eol-style + native ** trunk/extragear/graphics/digikam/libs/widgets/common/paniconwidget.h #property svn:eol-style + native _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Alan Flisch
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee. http://bugs.kde.org/show_bug.cgi?id=140131 ------- Additional Comments From arnd.baecker web de 2007-04-12 10:23 ------- Very nice! (Only clicking onto the thumb in the album view does not bring up the preview mode, while F3/F4 still work) Two minor questions: - would it technically be possible to have the current percentage displayed as a small transient window, also when using the + - buttons and the CTRL- mousewheel? - would it technically be possible to make the 100% view as one step in the sequence of possible zoom values? (Neither with CTRL+- or CTRL mousewheel I manage to get to that value) Presumably the answer to this is the following: The reason is of course that one starts from a view which fits the available space, leading to a certain percentage. Increasing the zoom, a factor gets multiplied onto the current zoom percentage in each step. Now the 100% is usually not in this sequence of numbers. Actually, I just realized, that it is even not possible to get back to the initial "fit to the available space" once one went to the borders (10% or 1200%) of the zoom-range. OK, and here my question ends, because these are two incompatible goals: having both the 100% view and the "fit-to-the available-space" percentage in the same sequence of number is not possible (in general). The only possible solution would be to specially set anything near 100% to 100% view and do something similar for the "fit-to-the available-space" percentag but I am really not sure whether this is worth the effort ... _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Alan Flisch
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee. http://bugs.kde.org/show_bug.cgi?id=140131 ------- Additional Comments From caulier.gilles gmail com 2007-04-12 10:33 ------- >(Only clicking onto the thumb in the album view does not bring up >the preview mode, while F3/F4 still work) This behaviours can be set in Config dialog. >Two minor questions: >- would it technically be possible to have the current percentage > displayed as a small transient window, also > when using the + - buttons and the CTRL- mousewheel? just move the mouse cursor over the zoom slider on status bar, you will see the zoom factor value like a tool tip. >- would it technically be possible to make the 100% view > as one step in the sequence of possible zoom values? > (Neither with CTRL+- or CTRL mousewheel I manage to get to that value) > Presumably the answer to this is the following: > The reason is of course that one starts from a view which > fits the available space, leading to a certain percentage. > Increasing the zoom, a factor gets multiplied onto the current zoom > percentage in each step. Now the 100% is usually not in this > sequence of numbers. > Actually, I just realized, that it is even not possible > to get back to the initial "fit to the available space" > once one went to the borders (10% or 1200%) of the zoom-range. Like a keyboard shorcut, yes, it possible... If you know a standard shorcut to toogle on 100% zoom factor, let's me hear... Gilles _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
> >(Only clicking onto the thumb in the album view does not bring up > >the preview mode, while F3/F4 still work) > > This behaviours can be set in Config dialog. I know, and it is set to "show embedded preview", but it does not work anymore! (I.e., can you reproduce this?) > >Two minor questions: > >- would it technically be possible to have the current percentage > > displayed as a small transient window, also > > when using the + - buttons and the CTRL- mousewheel? > > just move the mouse cursor over the zoom slider on status bar, > you will see the zoom factor value like a tool tip. Yes, I know, but would it be possible to display a small tool tip also when using the + - buttons and the mousewheel? > >- would it technically be possible to make the 100% view > > as one step in the sequence of possible zoom values? > > (Neither with CTRL+- or CTRL mousewheel I manage to get to that value) > > > Presumably the answer to this is the following: > > The reason is of course that one starts from a view which > > fits the available space, leading to a certain percentage. > > Increasing the zoom, a factor gets multiplied onto the current zoom > > percentage in each step. Now the 100% is usually not in this > > sequence of numbers. > > > Actually, I just realized, that it is even not possible > > to get back to the initial "fit to the available space" > > once one went to the borders (10% or 1200%) of the zoom-range. > > Like a keyboard shorcut, yes, it possible... Yes, that's a **much** better solution. > If you know a standard shorcut to toogle on 100% zoom factor, let's me hear... gqview uses: "Z" Zoom 1:1 "X" Zoom to fit If these where added to the View menu entry (greyed out when not in preview mode), the user could easily find them. _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Alan Flisch
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee. http://bugs.kde.org/show_bug.cgi?id=140131 ------- Additional Comments From arnd.baecker web de 2007-04-12 10:47 ------- > >(Only clicking onto the thumb in the album view does not bring up > >the preview mode, while F3/F4 still work) > > This behaviours can be set in Config dialog. I know, and it is set to "show embedded preview", but it does not work anymore! (I.e., can you reproduce this?) > >Two minor questions: > >- would it technically be possible to have the current percentage > > displayed as a small transient window, also > > when using the + - buttons and the CTRL- mousewheel? > > just move the mouse cursor over the zoom slider on status bar, > you will see the zoom factor value like a tool tip. Yes, I know, but would it be possible to display a small tool tip also when using the + - buttons and the mousewheel? > >- would it technically be possible to make the 100% view > > as one step in the sequence of possible zoom values? > > (Neither with CTRL+- or CTRL mousewheel I manage to get to that value) > > > Presumably the answer to this is the following: > > The reason is of course that one starts from a view which > > fits the available space, leading to a certain percentage. > > Increasing the zoom, a factor gets multiplied onto the current zoom > > percentage in each step. Now the 100% is usually not in this > > sequence of numbers. > > > Actually, I just realized, that it is even not possible > > to get back to the initial "fit to the available space" > > once one went to the borders (10% or 1200%) of the zoom-range. > > Like a keyboard shorcut, yes, it possible... Yes, that's a **much** better solution. > If you know a standard shorcut to toogle on 100% zoom factor, let's me hear... gqview uses: "Z" Zoom 1:1 "X" Zoom to fit If these where added to the View menu entry (greyed out when not in preview mode), the user could easily find them. _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
> If you know a standard shorcut to toogle on 100% zoom factor, let's me
> hear... GIMP uses 1 for 1:1 Shift-Ctrl-E dla 'fit to window' ---------------------------------------------------- Każdy ma jakieś tajemnice. Ale co byłbyś w stanie zrobić, by ukryć prawdę? Bruce Willis, Halle Berry w thrillerze KTOŚ CAŁKIEM OBCY - w kinach od 13 kwietnia! http://klik.wp.pl/?adr=http%3A%2F%2Fadv.reklama.wp.pl%2Fas%2Fktos.html&sid=1099 _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
Free forum by Nabble | Edit this page |