1. 19 Apr, 2020 1 commit
    • Martin Tobias Holmedahl Sandsmark's avatar
      Fix segfault/call on invalid pointer · 6cc5a511
      Martin Tobias Holmedahl Sandsmark authored
      We didn't set the AbstractImageView in AbstractImageViewPrivate early
      enough, and createAlphaBackgroundTexture() tried to call stuff on q.
      
      Quote from asan:
      
      ==161679==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7fa8cdcc193a bp 0x7ffe601e4a00 sp 0x7ffe601e48f0 T0)
      ==161679==The signal is caused by a READ memory access.
      ==161679==Hint: address points to the zero page.
          #0 0x7fa8cdcc1939 in Gwenview::AbstractImageViewPrivate::createAlphaBackgroundTexture() (gwenview/build/bin/libgwenviewlib.so.5+0x108a939)
          #1 0x7fa8cdcc28b8 in Gwenview::AbstractImageViewPrivate::AbstractImageViewPrivate() (gwenview/build/bin/libgwenviewlib.so.5+0x108b8b8)
          #2 0x7fa8cdca46a2 in Gwenview::AbstractImageView::AbstractImageView(QGraphicsItem*) ../lib/documentview/abstractimageview.cpp:145
          #3 0x7fa8cdd500a5 in Gwenview::RasterImageView::RasterImageView(QGraphicsItem*) ../lib/documentview/rasterimageview.cpp:194
      
      Reviewed By: ngraham
      
      Differential Revision: https://phabricator.kde.org/D28345
      6cc5a511
  2. 09 Jan, 2020 1 commit
  3. 04 Apr, 2019 1 commit
    • Alexander Volkov's avatar
      HiDPI Support for Gwenview · 97e7de52
      Alexander Volkov authored
      Summary:
      Initial support for HiDPI-scaling of documents in RasterImageView.
      
      This patch scales up images to display them correctly on HiDPI-enabled screens.
      
      TODO:
      - SVG documents and videos
      - Scaling of thumbnails
      
      BUG: 373178
      
      Reviewers: davidedmundson, rkflx, hetzenecker, ngraham, #gwenview
      
      Reviewed By: ngraham, #gwenview
      
      Subscribers: volkov, asturmlechner, fvogt, abalaji, rkflx, ngraham, anthonyfieroni, cfeck, asn
      
      Tags: #gwenview
      
      Differential Revision: https://phabricator.kde.org/D7581
      97e7de52
  4. 11 Jan, 2019 1 commit
  5. 12 Oct, 2018 1 commit
  6. 28 Sep, 2018 1 commit
  7. 19 Jul, 2018 2 commits
    • Peter Mühlenpfordt's avatar
      Center zoom to cursor position for zoom In/Out, Fill and 100% actions · 8cbc6377
      Peter Mühlenpfordt authored
      Summary:
      Zooming by mouse click/wheel and shortcut toggling from {nav Fit}/
      {nav Fill} to {nav 100%} already centers the zoom to the current
      cursor position.
      This patch also centers the zoom on the cursor position for:
      * triggering {nav Fill} zoom ({key Shift} middle click/{key Shift F})
      * shortcut zooming in/out ({key Ctrl +}/{key Ctrl -})
      * shortcut zooming to 100% (if `Actual Size` shortcut set)
      
      Test Plan:
      * Try different zoom actions by mouse/shortcut
      * Check if zoom centers to current cursor position (inside image view)
      * Check compare mode
      
      Reviewers: #gwenview, rkflx
      
      Reviewed By: #gwenview, rkflx
      
      Subscribers: rkflx
      
      Differential Revision: https://phabricator.kde.org/D14181
      8cbc6377
    • Peter Mühlenpfordt's avatar
      Center zoom to cursor position for zoom In/Out, Fill and 100% actions · e6026082
      Peter Mühlenpfordt authored
      Summary:
      Zooming by mouse click/wheel and shortcut toggling from {nav Fit}/
      {nav Fill} to {nav 100%} already centers the zoom to the current
      cursor position.
      This patch also centers the zoom on the cursor position for:
      * triggering {nav Fill} zoom ({key Shift} middle click/{key Shift F})
      * shortcut zooming in/out ({key Ctrl +}/{key Ctrl -})
      * shortcut zooming to 100% (if `Actual Size` shortcut set)
      
      Test Plan:
      * Try different zoom actions by mouse/shortcut
      * Check if zoom centers to current cursor position (inside image view)
      * Check compare mode
      
      Reviewers: #gwenview, rkflx
      
      Reviewed By: #gwenview, rkflx
      
      Subscribers: rkflx
      
      Differential Revision: https://phabricator.kde.org/D14181
      e6026082
  8. 16 Jul, 2018 2 commits
    • rkflx's avatar
      Add mouse shortcut for Fill and adapt docbook · 11ed44cd
      rkflx authored
      Summary:
      D14093 will add back middle-clicking to toggle between {nav Fit} (with
      {key F} as its keyboard shortcut) and {nav 100%} zoom. In addition,
      D14094 sets {key Shift F} as a shortcut for {nav Fill}.
      
      Going along with this, here we add {key Shift}-middle-clicking for
      {nav Fill}. The code is moved to `DocumentView` in order not to
      duplicate the handling of the toggling behaviour.
      
      We also adapt the docbook accordingly, as some users still seem to read
      the manual.
      
      CCBUG: 396360
      
      Depends on D14093
      
      Test Plan:
      Middle-click multiple times on an image in {nav View} mode and observe
      {nav Fit} is toggled. Repeat while holding down {key Shift} for
      {nav Fill}.
      Proof-read docbook ("View mode" and "Tips" sections).
      
      Reviewers: #gwenview, muhlenpfordt
      
      Reviewed By: #gwenview, muhlenpfordt
      
      Subscribers: muhlenpfordt, kde-doc-english
      
      Tags: #documentation
      
      Differential Revision: https://phabricator.kde.org/D14103
      11ed44cd
    • Peter Mühlenpfordt's avatar
      Toggle between zoom options "Fit"/"Fill" and "100%" on multiple activation · 945c8a7a
      Peter Mühlenpfordt authored
      Summary:
      In previous versions of Gwenview it was possible to toggle between
      {nav Fit} and {nav 100%} zoom factors using the shortcut {key F}.
      After 3e10699a added the {nav Fit Width} zoom option this feature
      did not work any more.
      This patch adds toggling for both {nav Fit} and {nav Fill} zoom
      options if the shortcut {key F} or one of the buttons is pressed
      multiple times. Zooming to 100% is centered to the current cursor
      position like middle click works.
      
      BUG: 396360
      
      Test Plan:
      # Open Gwenview in View Mode
      # Use zoom buttons {nav Fit}/{nav Fill} or {key F} multiple times
      # The zoom should toggle between {nav Fit} and {nav 100%},
        respectively between {nav Fill} and {nav 100%}
      
      Reviewers: #gwenview, rkflx
      
      Reviewed By: #gwenview, rkflx
      
      Subscribers: rkflx
      
      Differential Revision: https://phabricator.kde.org/D14093
      945c8a7a
  9. 14 Jul, 2018 1 commit
    • rkflx's avatar
      Improve experience when using mouse clicks to zoom · cb014a6c
      rkflx authored
      Summary:
      Gwenview allows to {key Ctrl}-click to zoom in, and
      {key Ctrl}-right-click zooms out. However, when clicking fast only every
      other click resulted in a zooming action, making the experience feel
      slow and cumbersome.
      
      The cause for this is that fast clicks are detected as double-clicks,
      with only the first single-click being delivered to Gwenview.
      
      By also zooming when double-clicking, for fast clicks each and every
      click will result in an action, making zooming feel natural again.
      Luckily there still won't be any duplicate clicks.
      
      Test Plan:
      Hold {key Ctrl}, repeatedly press left and right mouse buttons (start
      slowly and then increase clicking rate). Zooming should work reliably
      now.
      
      Reviewers: #gwenview, ngraham
      
      Reviewed By: #gwenview, ngraham
      
      Subscribers: ngraham
      
      Differential Revision: https://phabricator.kde.org/D14104
      cb014a6c
  10. 09 Jul, 2018 2 commits
    • rkflx's avatar
      Fix issues with cursors and unwanted actions when right-clicking · 20d474e0
      rkflx authored
      Summary:
      After showing and closing the context menu by right-clicking in
      {nav View} mode, the cursor would be set to `ClosedHandCursor`. Only
      after another click the cursor would be set back to the regular
      `OpenHandCursor`.
      
      The issue can be fixed by not changing the cursor shape in the first
      place for showing the context menu, i.e. when right-clicking.
      
      While using the {nav Red Eye Reduction} tool, the patch will prevent
      the unwanted placement of corrections on the canvas when right-clicking.
      
      {nav Fullscreen} mode could be toggled by double-clicking the middle
      mouse button, but it should only work for the left button.
      
      Test Plan:
      Right-click on an image in {nav View} mode to show the context menu and
      dismiss it again. The cursor should look as before. Also try right-clicking
      over the Bird's eye view and in the {nav Crop} tool.
      
      In the {nav Red Eye Reduction} tool, right-clicking should not change the
      position of the correction anymore.
      
      Entering {nav Fullscreen} should only work for double-clicking with the left
      mouse button. Note that accidentally clicking on the {nav Fullscreen} checkbox
      of the context menu when right-clicking and moving the cursor slightly
      might still be possible, but having that action as the first entry is
      more important than the very minor imperfection in that case.
      
      Reviewers: #gwenview, huoni
      
      Reviewed By: #gwenview, huoni
      
      Subscribers: huoni
      
      Differential Revision: https://phabricator.kde.org/D13723
      20d474e0
    • rkflx's avatar
      Reset zoom cursor more reliably · 84e6a0a9
      rkflx authored
      Summary:
      In {nav View} mode a magnifying glass is shown while pressing {key Ctrl}
      to indicate the image's zoom level could be changed in that state.
      
      Restoring the regular cursor after the user stopped holding the modifier
      relied on `AbstractImageView::keyReleaseEvent`. However, that event is
      not guaranteed to be delivered, e.g. when another window got focus
      before releasing the modifier.
      
      The issue can be mitigated by updating the cursor more eagerly for focus
      changes.
      
      FIXED-IN: 18.04.3
      
      Test Plan:
      - In {nav View} mode with the cursor over the image, press {key Ctrl O} and close the dialog again.
      - With the "focus follows mouse" policy set, hold {key Ctrl} while moving the cursor to another window, release the modifier and move the cursor back to Gwenview.
      - With focusing on another application, press {key Ctrl}, move cursor back to Gwenview and focus the window while still holding the modifier.
      In all cases the zoom cursor should be set correctly according to the actual keyboard state.
      
      Reviewers: #gwenview, muhlenpfordt
      
      Reviewed By: #gwenview, muhlenpfordt
      
      Subscribers: muhlenpfordt
      
      Differential Revision: https://phabricator.kde.org/D13894
      84e6a0a9
  11. 26 Jun, 2018 1 commit
  12. 24 Jun, 2018 1 commit
    • Huon Imberger's avatar
      Allow dragging from View mode to external applications · 984b9737
      Huon Imberger authored
      Summary:
      This patch adds drag functionality to {nav View} mode. A
      drag operation is only initiated if dragging wouldn't
      otherwise do something, e.g. when zoomed and the image is
      pannable, or the crop tool is active.
      
      In order to get a drag pixmap for all cases (videos
      included), we use a ThumbnailProvider to generate a file
      preview. However, if the image is modified, we generate a
      new pixmap using the edited version. Using
      `MimeTypeUtils::selectionMimeData`, this should mean the
      drag pixmap always matches the image the receiving
      application gets.
      
      BUG: 386034
      FIXED-IN: 18.08.0
      
      {F5781358}
      
      Test Plan:
      Drag from View mode, comparison mode.
      Try raster, SVG, and video file types, including when the
      image is modified (cropped or rotated).
      Panning a zoomed image should still be possible.
      Drag operation should always get a thumbnail/icon pixmap
      representing the dropped image.
      
      Reviewers: #gwenview, rkflx
      
      Reviewed By: #gwenview, rkflx
      
      Tags: #gwenview
      
      Differential Revision: https://phabricator.kde.org/D11877
      984b9737
  13. 16 Apr, 2018 1 commit
    • Peter Mühlenpfordt's avatar
      Center image after edit operation changed size · b0111d43
      Peter Mühlenpfordt authored
      Summary:
      After editing an image which changes its size (crop, resize) or
      undoing this operation the image is not centered in the viewport
      in some cases.
      This patch adds a check if document size changed when calculating
      zoom factor and view offset.
      
      FIXED-IN: 18.04.1
      
      Test Plan:
      * Open image in View Mode with zoom option {nav Fit} and fit height
      * Edit one time to show save bar (e.g. rotate or resize)
      * Crop to a narrow upright bar (zoom should not change)
      * Undo
      * Previous image should display complete and centered
      
      {F5806553}
      
      * Open image in View Mode
      * Resize to a size smaller than viewport
      * Resize to an even smaller size
      * Image should display centered
      
      {F5806555}
      
      Reviewers: #gwenview, rkflx
      
      Reviewed By: #gwenview, rkflx
      
      Subscribers: rkflx
      
      Differential Revision: https://phabricator.kde.org/D12167
      b0111d43
  14. 09 Apr, 2018 1 commit
    • Huon Imberger's avatar
      Add support for configurable transparent background to SVGs · 836ec0e4
      Huon Imberger authored
      Summary:
      SVGs do not honor the "Transparent background" config option, and simply have no
      background at all. This patch ensures this option is applied to SVGs as well as
      raster images.
      
      Unlike `RasterImageView` that uses a `QPixmap` buffer (`mCurrentBuffer`) for drawing
      the background and the image, SVGs are rendered directly on top of `SvgImageView`
      (`QGraphicsWidget`). Therefore we just paint the background in `SvgImageView::paint`
      which happens before the SVG is rendered.
      
      We move the checkboard texture code to `AbstractImageView` now that it's used by
      both subclasses `RasterImageView` and `SvgImageView`.
      
      This patch also configures kconf_update due to the moving of the above enum.
      Since I didn't want to litter `/app` with files, I've moved the update files to
      `/kconf_update`.
      
      Fixes T8125
      
      Before:
      {F5764298}
      
      After:
      {F5764299}
      {F5764300}
      
      Test Plan:
        - Open an SVG with solid color config option
        - Open and SVG with checkboard background config. At a high enough zoom (where the
          birdseye view shows up), panning/scrolling should have the checkboard pattern
          fixed to the image, like raster images
        - Ensure raster images with transparent backgrounds are unaffected
      
      ## kconf_update
      The script `gwenview-imageview-alphabackgroundmode-update.pl` must be in
      `/usr/share/kconf_update` in order for `/usr/lib/kf5/kconf_update` to find it.
      If successfull, instances of `RasterImageView::AlphaBackground*` should change to
      `AbstractImageView::AlphaBackground*`.
      
      Reviewers: #gwenview, rkflx, ngraham
      
      Reviewed By: #gwenview, rkflx, ngraham
      
      Tags: #gwenview
      
      Maniphest Tasks: T8125
      
      Differential Revision: https://phabricator.kde.org/D11629
      836ec0e4
  15. 07 Apr, 2018 1 commit
    • Huon Imberger's avatar
      Fix SVGs overlapping selection rect in View compare mode · d5ab1869
      Huon Imberger authored
      Summary:
      Zooming an SVG in compare mode allowed the SVG to be painted outside its
      parent widget `SvgImageView`, effectively overlapping the selection rect
      which is drawn in `DocumentView::paint`. This patch clips all painting
      done by children of `AbstractImageView` to its own shape, therefore
      fixing the issue.
      
      Before:
      {F5790186, size=full}
      
      After:
      {F5790283, size=full}
      
      Test Plan:
      Open an SVG image in comparison mode.
      Zoom in enough so it fills the entire document view (and therefore
      can be panned).
      Image should not draw over the selection rectangle.
      
      Reviewers: #gwenview, rkflx
      
      Reviewed By: #gwenview, rkflx
      
      Subscribers: muhlenpfordt
      
      Differential Revision: https://phabricator.kde.org/D11942
      d5ab1869
  16. 15 Mar, 2018 1 commit
    • Peter Mühlenpfordt's avatar
      Keep click position in focus on middle-click zoom · 1e66de8f
      Peter Mühlenpfordt authored
      Summary:
      Clicking on an image in View Mode with the middle mouse button toggles
      between `Fit` and `100%` zoom modes. The image zoomed to `100%` is
      always scrolled to the image center.
      This patch keeps the clicked location in focus as it is done while
      zooming with {key Ctrl Scroll}.
      
      FEATURE: 308335
      
      Test Plan:
      * Open a big image in View Mode
      * Middle-click on different locations over the image
      * The `100%` zoom view should keep the clicked location in focus
      
      Reviewers: #gwenview, rkflx
      
      Reviewed By: #gwenview, rkflx
      
      Subscribers: rkflx, huoni
      
      Differential Revision: https://phabricator.kde.org/D11336
      1e66de8f
  17. 28 Feb, 2018 1 commit
    • Silas Lenz's avatar
      Replace "Fit Width" feature with "Fill" · ba63c8a4
      Silas Lenz authored
      Summary:
      Fit width is arguably less useful than a more general Fill feature. This replaces "Fit Width" with "Fill", fitting width or height, depending on what fills the window.
      
      FEATURE: 195579
      
      Test Plan: Use Fill with landscape and portrait pictures with the window in landscape and portrait size.
      
      Reviewers: #gwenview, ngraham, rkflx
      
      Reviewed By: #gwenview, ngraham, rkflx
      
      Subscribers: rkflx, muhlenpfordt, ngraham, #gwenview
      
      Tags: #gwenview
      
      Differential Revision: https://phabricator.kde.org/D10844
      ba63c8a4
  18. 27 Mar, 2017 1 commit
  19. 02 Nov, 2014 1 commit
  20. 13 Oct, 2014 1 commit
  21. 10 Oct, 2014 1 commit
  22. 05 Oct, 2014 1 commit
  23. 03 Oct, 2014 1 commit
  24. 13 Aug, 2014 2 commits
  25. 20 Mar, 2014 1 commit
  26. 02 May, 2013 1 commit
  27. 18 Jan, 2013 2 commits
  28. 10 Jan, 2013 1 commit
    • Benjamin Löwe's avatar
      Fixes to panning improvements: · aac14e32
      Benjamin Löwe authored
      - Don't pan if Ctrl key is pressed.
      - fixed: ClosedHandCursor was not shown when dragging (while whole image is visible)
      - use overrideCursor to always hide mouse cursor during panning
      - update Cursor in keyPressEvent to switch to zoom cursor if Ctrl was pressed
      aac14e32
  29. 04 Jan, 2013 1 commit
    • Benjamin Löwe's avatar
      Improved panning of zoomed images: · bfac8b37
      Benjamin Löwe authored
      - Panning in images is faster now
      - When panning, the mouse pointer becomes invisible. After panning
        it reappears at the position where panning started.
      - Don't switch to panning mode when whole image is visible. Instead
        the image could be dragged and dropped somewhere (not implemented
        yet).
      
      See review request for remaining issues.
      
      REVIEW: 107985
      CCBUG: 293340
      bfac8b37
  30. 10 Dec, 2012 1 commit
  31. 21 Nov, 2012 1 commit
  32. 12 Jun, 2012 2 commits
  33. 11 Jun, 2012 1 commit
  34. 09 Jun, 2012 1 commit