1. 17 Jul, 2019 3 commits
    • Oliver Sander's avatar
      Make the page outline one physical pixel wide · a0bd9c4d
      Oliver Sander authored
      Pages get a black rectangle around them as 'outline' after
      being rendered.  This rendering was not pixel-perfect at
      fractional scalings: apparently, fractional line widths and
      positions get rounded differently.  The result was that
      sometimes there was a small gap between outline and page.
      
      This pages fixes the problem by making the pen for the
      outline 'cosmetic', i.e., one physical pixel wide.
      With that, its position can be such that it encloses
      the page without any gap.
      a0bd9c4d
    • Oliver Sander's avatar
      Make page boundary rendering more robust · 9b34bfb4
      Oliver Sander authored
      Okular renders a simple 'shadow' at the right and the bottom of each
      page.  The code for this is a bit fragile:  After the page is rendered,
      Okular paints a black outline, and then the shadow.  The shadow is
      a hand-implemented gradient, painted line by line.  Finally, the
      remaining area is painted in the background color.  No pixel is
      ever touched twice.  Unfortunately, the code is buggy, and in hidpi /
      fractional scaling situations, some pixels are never touched.
      This results in rendering glitches as reported in
      
        https://bugs.kde.org/show_bug.cgi?id=383943
      
      Instead of trying to fix the previous approach, this patch makes the
      code more robust by changing the order of the painting operations.
      After painting the page, the code now first paints the background,
      which is now enlarged to cover everything off the page.  Finally,
      the black outline and shadow are drawn on the previously drawn
      background.  This makes sures that no pixel is ever left uninitialized.
      It also allows to simplify the shadow drawing operation a bit.
      
      BUG: 383943
      9b34bfb4
    • Oliver Sander's avatar
      Use range-based for to iterate over a QRegion · f681fb0e
      Oliver Sander authored
      According to
      
        https://doc.qt.io/qt-5/qregion-obsolete.html#rects
      
      the method QRegion::rects is obsolete and should be avoided.
      Let's do that by moving to a range-based for over the QRegion.
      That is easier to read anyway.
      f681fb0e
  2. 22 Jun, 2019 1 commit
  3. 06 Jun, 2019 4 commits
    • Noah Davis's avatar
      Change Text Selection icon to edit-select-text · 2c39981b
      Noah Davis authored
      Summary:
      The current icon (draw-text) is semantically incorrect. This patch makes the Text Selection tool use the icons added in D21632.
      
      BUG: 408391
      FIXED-IN: 1.8.0
      
      Test Plan: {F6874885, size=full}
      
      Reviewers: #vdg, #okular, ngraham
      
      Reviewed By: #vdg, ngraham
      
      Subscribers: okular-devel
      
      Tags: #okular
      
      Differential Revision: https://phabricator.kde.org/D21633
      2c39981b
    • Noah Davis's avatar
      Change Browse icon back to the hand shape · 9310bed6
      Noah Davis authored
      Summary: I changed the `input-mouse` icon so that it would look more like a real mouse. In order to keep the proper icon for the Browse tool, I have to change the icon to `transform-browse`.
      
      Test Plan: {F6874739, size=full}
      
      Reviewers: #okular, #vdg, ngraham
      
      Reviewed By: #vdg, ngraham
      
      Subscribers: ngraham, okular-devel
      
      Tags: #okular
      
      Differential Revision: https://phabricator.kde.org/D21630
      9310bed6
    • Nate Graham's avatar
      In Toolbar's selection mode menu, show "Text Selection" tool by default · e8473354
      Nate Graham authored
      Summary:
      Currently, the Toolbar's selection mode menu shows the rectangular selection mode
      by default, which is not the most useful or commonly used selection mode.
      
      This patch makes the Text Selection tool the one that's shown by default, since that's
      the kind of selection that's the most useful given the sort of document that Okular
      is typically used to view.
      
      Test Plan:
      - Delete `~/.config/okularrc` and `~/.config/okularpartrc`
      - Open Okular
      - See that the selection mode toolbar button shows Text Selection by default:
      {F6874497, size=full}
      
      Reviewers: #okular, #vdg, ndavis
      
      Reviewed By: #vdg, ndavis
      
      Subscribers: ndavis, okular-devel
      
      Tags: #okular
      
      Differential Revision: https://phabricator.kde.org/D21624
      e8473354
    • Nate Graham's avatar
      Regularize tool names · c325cb41
      Nate Graham authored
      Summary:
      Currently, some of the items in the {nav Tools} menu have "tool" in the name, and some
      do not. This is in any event redundant since they're in a menu with that word in it
      already. In the toolbar, these actions become more inconsistent since their names change
      and can even differ between what's shown in the pop-up menu and what's shown on the
      button text.
      
      This patch regularizes the names, stops changing the names for the toolbar versions, and
      updates the docbook accordingly.
      
      Test Plan:
      {F6874459, size=full}
      
      {F6874458, size=full}
      
      Reviewers: #okular, #vdg, filipf
      
      Reviewed By: #vdg, filipf
      
      Subscribers: filipf, okular-devel, kde-doc-english
      
      Tags: #okular, #documentation
      
      Differential Revision: https://phabricator.kde.org/D21621
      c325cb41
  4. 27 May, 2019 1 commit
  5. 21 May, 2019 1 commit
    • Kezi Olio's avatar
      Make selection scrolling go at 60 fps · e971c67c
      Kezi Olio authored
      Summary:
      When you select a square with the right mouse button, and you go past the margin of the window (but where there is still space to go), okular scrolls the document so you can select more.
      With this patch this automatic scrolling goes at 60 fps instead of 10, I made it so that the speed of the scroll is the same
      
      Reviewers: #okular, aacid, sander, ngraham
      
      Reviewed By: sander, ngraham
      
      Subscribers: sander, ngraham, aacid, ahmedbilal, okular-devel, kezik
      
      Tags: #okular
      
      Differential Revision: https://phabricator.kde.org/D20437
      e971c67c
  6. 21 Apr, 2019 1 commit
    • Shubham  .'s avatar
      Add action in Edit menu to select the text on current page · f788b5a3
      Shubham . authored
      BUG: 358868
      
      Test Plan: Click on "Select All Text on Current Page" entry in Edit menu to select the entire page. The selected text can then be copied via Edit menu item "Copy"
      
      Reviewers: aacid, #vdg, ngraham
      
      Reviewed By: #vdg, ngraham
      
      Subscribers: yurchor, michaelweghorn, kde-doc-english, davidhurka, abetts, loh.tar, alexde, ngraham, okular-devel
      
      Tags: #okular, #documentation
      
      Differential Revision: https://phabricator.kde.org/D18744
      f788b5a3
  7. 26 Mar, 2019 1 commit
  8. 13 Mar, 2019 1 commit
  9. 12 Mar, 2019 1 commit
  10. 26 Jan, 2019 1 commit
  11. 11 Jan, 2019 1 commit
  12. 10 Jan, 2019 1 commit
    • Chinmoy Ranjan Pradhan's avatar
      Implement digital signature support for PDF · a234a902
      Chinmoy Ranjan Pradhan authored
      This is a squash of the original branch
      
      It also contains fixes/rework from Albert Astals Cid
      
      If you're interested in its history have a look at the
      gsoc2018_digitalsignature branch
      
      The poppler dependency situation is:
       * With 0.51 you get most signature information
       * With 0.68 you also get signature location/reason information
       * With 0.73 you also get signature certificate information
      a234a902
  13. 09 Jan, 2019 1 commit
  14. 05 Dec, 2018 1 commit
  15. 29 Nov, 2018 1 commit
    • Tobias Deiminger's avatar
      Fix inconsistent viewport positioning in PageView · a29e4eaf
      Tobias Deiminger authored
      Summary:
      This diff unifies the calculation of the viewport position from a given DocumentViewport. PageView::notifyViewportChanged and PageView::slotRelayoutPages used to handle it differntly, which resulted in viewport jumps for no reason.
      
      It happened in various situations, e.g. when jumping to a page using the footer page navigation, or when reloading the document after presentation mode left, or when resizing the main window after presentation mode left.
      
      The diff selects the notifyViewportChanged way (align viewport top border with page top margin) as golden behavior in case of rePos.enabled == false.
      
      BUGS: 357958
      CCBUG: 341939
      CCBUG: 400890
      
      341939 and 400890 are fixed partially. These two still suffer from a minor displacement that happens when finished signal arrives from pixmap generation thread.
      
      Test Plan:
      - When using the footer page navigation to jump to different pages, new page top is always algined with viewport top.
      - After changing page with footer page navigation, press F5 to reload. Page top stays aligned with viewport top.
      - When exiting presentation mode, and touching the file, page top stays aligned with viewport top.
      - When exiting presentation mode, and changing main window size, page top stays aligned with viewport top.
      
      Reviewers: #okular, sander
      
      Reviewed By: sander
      
      Subscribers: ngraham, sander, aacid, okular-devel
      
      Tags: #okular
      
      Differential Revision: https://phabricator.kde.org/D16941
      a29e4eaf
  16. 14 Nov, 2018 1 commit
  17. 02 Nov, 2018 1 commit
  18. 27 Oct, 2018 1 commit
    • Nate Graham's avatar
      Create new "Zoom to 100%" action · 33ca396d
      Nate Graham authored
      Summary:
      This patch implements a "Zoom to 100%" action and sticks it in the {nav View} menu. Since it's a `KStandardAction` with a `KStandardShortcut`, we automatically get the correct icon and keyboard shortcut, but we do override the name to be "Zoom to 100%" since that's clearer for Okular's use case.
      
      FEATURE: 400048
      FIXED-IN: 18.12.0
      
      Test Plan:
      - Action works to zoom the document to 100% scale when invoked
      - Action is disabled when document is opened at 100% scale or is manually zoomed to 100% scale after being opened
      - All other zoom modes and action still work
      
      {F6341045}
      
      Reviewers: #okular, #vdg, abetts
      
      Reviewed By: #vdg, abetts
      
      Subscribers: davidhurka, sander, tobiasdeiminger, veqz, abetts, aacid, okular-devel
      
      Tags: #okular
      
      Differential Revision: https://phabricator.kde.org/D16345
      33ca396d
  19. 31 Aug, 2018 1 commit
  20. 29 Aug, 2018 1 commit
  21. 26 Jun, 2018 1 commit
    • Michael Eden's avatar
      Expose 'change colors' through dbus interface · 031b794e
      Michael Eden authored
      Summary:
      This exposes the Okular's functionality of changing the document's colors
      through its d-bus interface. This is mainly useful for scripting Okular to
      switch to a 'day mode' or 'night mode'.
      
      [Example] Switching themes of two applications with one hotkey:
      
      {F5905771}
      
      Reviewers: #okular, aacid
      
      Reviewed By: #okular, aacid
      
      Subscribers: okular-devel
      
      Tags: #okular
      
      Differential Revision: https://phabricator.kde.org/D13471
      031b794e
  22. 18 May, 2018 1 commit
  23. 09 Apr, 2018 1 commit
    • David Edmundson's avatar
      Fix rubber band selection drawing contents misaligned with scaling · 804d0bd4
      David Edmundson authored
      Summary:
      in drawPixmap(source, sourceRect) the source rect is in native pixels.
      
      In this code the size was scaled by the DPR, but the location was not.
      blendRect is the contents of a selection rectangle, offset from the
      bounding darker blue rectangle. Hence we haven't really noticed.
      
      This completely fixes the rectangle when the scale == 2.0/3.0
      
      Some smaller artifacts remain on fractional scale factors, which is a
      separate code bug with the same symptoms.
      
      CCBUG: 386111
      
      Reviewers: aacid, rkflx
      
      Reviewed By: rkflx
      
      Subscribers: sander, rkflx, anthonyfieroni, #okular
      
      Tags: #okular
      
      Differential Revision: https://phabricator.kde.org/D8980
      804d0bd4
  24. 25 Feb, 2018 1 commit
    • Tobias Deiminger's avatar
      Fix crash due to dangling pointer in MouseAnnotation · 3c4f16ea
      Tobias Deiminger authored
      Summary:
      BUG: 388228
      
      Diff applies to Applications/17.12, and should be easy to merge to master. It's kept quite minimal as suggested by Albert.
      
      Albert also suggested to add a dedicated unit test and I'd agree, but am not yet sure how to do it. The original bug involves several classes, including UI: Document, Page, AddAnnotationCommand, PageView, PageViewAnnotator, MouseAnnotation - to name a few. So a test for the exact bug scenario would become a bigger integration test rather than an isolated unit test. The other approach would be to do a real unit test on MouseAnnotation. But again, MouseAnnotation has nasty dependencies (e.g., needs a parent PageView) which I'd have to mock. Any ideas? I'd be interested in a discussion on this topic.
      
      Test Plan:
       # Load a document (e.g. [[ http://www.philipebert.info/resources/WhatMathematicalKnowledgeCouldNotBe.pdf | linked PDF from bug report ]]) and enable highlight toolbar (F6).
       # Create highlight annotation.
       # Move the view port so that the annotation position is right beside the highlight tool icon.
       # Move the mouse over the annotation, and then horizontally left until you reach the tool icon; it's important to stay over the highlight annotation as long as in viewport.
       # Press ctrl-z for undo.
       # Click on highlight tool, move right into the document, create new highlight annotation.
       # Okular doesn't crash.
      
      Reviewers: #okular
      
      Subscribers: aacid, ngraham
      
      Tags: #okular
      
      Differential Revision: https://phabricator.kde.org/D9852
      3c4f16ea
  25. 16 Nov, 2017 1 commit
  26. 28 Oct, 2017 1 commit
  27. 26 Oct, 2017 1 commit
    • Albert Astals Cid's avatar
      Implement swapBackingFile for the PDF backend · ca5422d0
      Albert Astals Cid authored
      How does it work:
       * What it does is really closing and opening the file again through poppler
       * This means that things that are generated in "open" time like Page, Rects, Annotations, Forms need to be updated
      	* For Page what we do is swap the PagePrivate so that other classes that hold Page* don't break
      		* Since some parts of the PagePrivate can be reused, we move them in PagePrivate::adoptGeneratedContents
      	* For all the commands in the undo stack we need to update the annotations/forms it refers to, added a new function to do that
      	* The annotationmodel needs updating it's pointers
      	* The widgets for the forms are reused and their form* updated
      	* the widgets for the videos are recreased since videos don't really hold much content (you lose the playing status on save but i think that's acceptable)
      
      TODO: Make this work for .okular files
      TODO: For files with password we will need to reload the file, asking for the password again and thus losing the undo stack, warn the user
      TODO: autotests
      ca5422d0
  28. 25 Oct, 2017 2 commits
  29. 14 Oct, 2017 1 commit
    • Lukas Hetzenecker's avatar
      HiDPI Support for Okular · ecc1141e
      Lukas Hetzenecker authored
      Summary:
      This patch enables HiDPI throughout the application
      
      Every pixmap is multiplied by the devicePixelRatioF
      QPainter code is ajusted to take the DPR value into account
      
      All pixmaps get cached with the highest DPR of all screens. When moving the application to another screen, the cache doesn't have to be invalidated.
      
      BUGS: 362856 383589
      REVIEW: D6268
      ecc1141e
  30. 11 Oct, 2017 1 commit
  31. 01 Oct, 2017 3 commits
    • Albert Freeman's avatar
      Custom background color · 1f6e8a47
      Albert Freeman authored
      Summary:
      BUG: 182994
      
      Adds an option to the config dialog that enables background color (the color around the displayed page) to be changed (while by default preserving the Qt toolkit selection as not to affect existing users).
      
      Reasons for this change:
      Accessibility, eye strain, aesthetic reasons, color displayed on monitor can affect power consumption (how: depends on display technology).
      Many people want this change occording to Bugzilla and other sources.
      
      Maintenance: Nearly no additional maintenance:
      This is no new subsystem but a trivial feature with no complex code dependencies, and we are already showing a colour selection dialog and setting colours in other places in Okular.
      
      {F4257766}
      
      Other less important information:
      https://git.reviewboard.kde.org/r/130219/
      https://mail.kde.org/pipermail/okular-devel/2017-September/025520.html
      
      Test Plan:
      Tested everything, it all works:
      Toggled the custom background color, changed custom background color, removed okular settings file (with: "rm ~/.config/okular*") to verify it uses the usual qt theme colour by default (where the settings file remembered the custom color).
      
      Reviewers: #okular, aacid, elvisangelaccio, rkflx, ngraham
      
      Reviewed By: ngraham
      
      Subscribers: aacid, ltoscano, ngraham
      
      Tags: #okular
      
      Differential Revision: https://phabricator.kde.org/D8051
      1f6e8a47
    • Luigi Toscano's avatar
      Revert "Custom background color" · d176914e
      Luigi Toscano authored
      Wrong authorship for the commit. Commit it again with the correct
      information.
      
      CCMAIL: pointedstick@zoho.com
      This reverts commit 6b5a7c9a.
      d176914e
    • Nathaniel Graham's avatar
      Custom background color · 6b5a7c9a
      Nathaniel Graham authored
      Summary:
      BUG: 182994
      
      Adds an option to the config dialog that enables background color (the color around the displayed page) to be changed (while by default preserving the Qt toolkit selection as not to affect existing users).
      
      Reasons for this change:
      Accessibility, eye strain, aesthetic reasons, color displayed on monitor can affect power consumption (how: depends on display technology).
      Many people want this change occording to Bugzilla and other sources.
      
      Maintenance: Nearly no additional maintenance:
      This is no new subsystem but a trivial feature with no complex code dependencies, and we are already showing a colour selection dialog and setting colours in other places in Okular.
      
      {F4257766}
      
      Other less important information:
      https://git.reviewboard.kde.org/r/130219/
      https://mail.kde.org/pipermail/okular-devel/2017-September/025520.html
      
      Test Plan:
      Tested everything, it all works:
      Toggled the custom background color, changed custom background color, removed okular settings file (with: "rm ~/.config/okular*") to verify it uses the usual qt theme colour by default (where the settings file remembered the custom color).
      
      Reviewers: #okular, aacid, elvisangelaccio, rkflx, ngraham
      
      Reviewed By: ngraham
      
      Subscribers: aacid, ltoscano, ngraham
      
      Tags: #okular
      
      Differential Revision: https://phabricator.kde.org/D8051
      6b5a7c9a
  32. 05 Sep, 2017 1 commit