1. 11 Aug, 2019 3 commits
  2. 10 Aug, 2019 1 commit
  3. 07 Aug, 2019 1 commit
    • Andrey Yashkin's avatar
      Fix an incorrect text bounding rectangle calculation inside the sidebar · 5099b615
      Andrey Yashkin authored
      Summary:
      Now //fontBoundaries// always has smaller width than //boundingRect// from
      ```
      void QPainter::drawText(const QRect &rectangle, int flags, const QString &text, QRect *boundingRect = nullptr)
      ```
      which is required to enclose the whole text. The difference is only several pixels, but sometimes it can cause visual problems. You can see the sidebar without and with this patch in Russian language with Noto Sans 10pt font on a picture below.
      {F7177644}
      Now the first and the last symbols are fully visible.
      
      Reviewers: #okular
      
      Subscribers: okular-devel
      
      Tags: #okular
      
      Differential Revision: https://phabricator.kde.org/D23012
      5099b615
  4. 01 Aug, 2019 3 commits
  5. 27 Jul, 2019 2 commits
  6. 25 Jul, 2019 1 commit
    • Simone Gaiarin's avatar
      General improvements to stamp annotation · f15e8568
      Simone Gaiarin authored
      Summary:
      Configuration:
      - Add push button to select custom stamp image
      - Check if loaded image is usable as stamp or throw error
      - Keep image proportions in previewer
      - Move previewer below the combobox to display larger preview
      
      Annotation tool:
      - Keep stamp image proportion in annotation preview (while left mouse button is down)
      - Adding the annotation with one-click (without holding the left mouse button and dragging) adds the stamp with original proportions
      
      BUG: 370381
      BUG: 383652
      CCBUG: 383651
      FIXED-IN: 1.9.0
      
      Closes T8074
      
      TODO:
      - [ ] Check if filters in file chooser make sense / propose better alternative
      - [x] Update doc ( @yurchor will do it after we merge this)
      
      Test Plan:
      From stamp annotation configuration dialog:
      - Show a warning regarding limitations of the feature's current implementation
      - Click push button next to combo box opens a file selector
      - Selecting a corrupted image file should throw an error
      - Selecting a good image file shows the preview of the image
      - Select a horizontal image shows a large clear preview
      - Select a vertical image file shows a smaller preview without messing up the visual of the config dialog
      - Input a valid icon name in the combobox and the preview of the icon is shown
      
      From page view, select the stamp annotation with horizontal image file (not squared):
      - Click and hold. The preview maintains proportions
      - Single click. The stamp image in the pdf maintains proportions and has the same size of the click and hold preview.
      - Add an annotation of the Okular custom stamps (internal SVG so treated slightly differently) do not create problems
      
      Reviewers: #okular, ngraham
      
      Reviewed By: ngraham
      
      Subscribers: pino, aacid, yurchor, ngraham, okular-devel
      
      Tags: #okular
      
      Maniphest Tasks: T8074
      
      Differential Revision: https://phabricator.kde.org/D22064
      f15e8568
  7. 22 Jul, 2019 1 commit
  8. 20 Jul, 2019 2 commits
  9. 17 Jul, 2019 4 commits
    • Oliver Sander's avatar
      Fix page boundary gradients on scaled displays · 8e1d9aa4
      Oliver Sander authored
      The code that draws a thin gradient at the right and bottom
      boundaries of a page implicitly assumed that the display was
      not scaled, i.e., that logical pixel where identical to
      physical pixels.  Nobody really noticed because that gradient
      was so thin.  Anyway, this patch fixes the gradient for
      scaled displays.
      
      I considered using a QLinearGradient, but decided against it:
      The code would have been longer, and the manual code in the
      patch can exploit the fact that all lines are horizontal
      or vertical.  Therefore, expensive scan-conversion can be
      avoided.
      8e1d9aa4
    • 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
  10. 03 Jul, 2019 2 commits
  11. 24 Jun, 2019 1 commit
  12. 22 Jun, 2019 2 commits
  13. 06 Jun, 2019 5 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
      Use a more conventional dropdown menu style instead of press-and-hold · c7924445
      Nate Graham authored
      Summary:
      Currently, `ToolAction` menus (of which there is only one, the selection tool menu)
      activate the current tool on click, and require a click-and-hold to choose a new tool.
      This is a somewhat unfamiliar user interface that I myself struggled with when initially
      encountering it, and I've encountered user complaints about it as well.
      
      This patch adjusts the behavior so that clicking on the arrow on the right side of the
      button will open the pop-up and allow choosing another tool, which is a more common
      method of implementing the feature. The patch also adjusts the tooltop accordingly.
      
      Test Plan: {F6874466, size=full}
      
      Reviewers: #okular, #vdg, ndavis
      
      Reviewed By: #vdg, ndavis
      
      Subscribers: ndavis, abetts, filipf, okular-devel
      
      Tags: #okular
      
      Differential Revision: https://phabricator.kde.org/D21622
      c7924445
    • 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
  14. 03 Jun, 2019 1 commit
  15. 02 Jun, 2019 1 commit
  16. 01 Jun, 2019 2 commits
    • Tobias Deiminger's avatar
      Add icons for line annotation arrow styles to combo box · 1b89f220
      Tobias Deiminger authored
      Summary:
      Use `LineAnnotPainter` to generate accurate icons.
      
      Looks like this:
      {F6852054}
      
      Depends on D21248
      
      Test Plan:
      - open "Edit annotation tool" for straight line and check combo box items for start and stop style
      - test on HiDPI
      
      Reviewers: #okular, sander
      
      Reviewed By: sander
      
      Subscribers: davidhurka, knambiar, ngraham, okular-devel
      
      Tags: #okular
      
      Differential Revision: https://phabricator.kde.org/D21416
      1b89f220
    • Tobias Deiminger's avatar
      Add line annotation ending arrows for non PDF documents · d0e3a77d
      Tobias Deiminger authored
      Summary:
      This implements drawing the various line ending styles for 2 point lines in non-PDF documents.
      
      Looks like this:
      {F6833437}
      
      CCBUG: 381629
      
      Test Plan:
      - open a *.txt document
      - draw line annotations with different arrow styles: Square, Diamond, OpenArrow, ClosedArrow, ROpenArrow, RClosedArrow, Butt, Slash, Circle
      - ... as start and as end style (start needs D21238 to be configurable in GUI)
      - ... filled or not (fill color can't be configured in GUI yet)
      - ... with different leader line settings
      - ... at various angles
      - rotate and scale page
      - leader line with setting 100 gives 100 pixel line at 100% zoom (use kruler to verify)
      
      Reviewers: #okular, aacid, sander
      
      Reviewed By: sander
      
      Subscribers: ngraham, sander, knambiar, okular-devel
      
      Tags: #okular
      
      Differential Revision: https://phabricator.kde.org/D21248
      d0e3a77d
  17. 27 May, 2019 1 commit
  18. 26 May, 2019 1 commit
    • Rajeesh K V's avatar
      Okular Annotation: add line start/end style config only for Straight Line tool · b1c30cd0
      Rajeesh K V authored
      Summary:
      “Inner Color” configuration of Polygon tool was overlapping with the line start/end styles intended for only Straight Line tool. Fix it.
      
      CCBUG: 381629
      
      Test Plan:
      1. Configure annotations
      2. Create/Edit Polygon tool
      3. Observe that no Line Start/End styles are visible
      4. Create/Edit Straight Line tool
      5. Observe that line start/end styles can be configured
      
      Reviewers: #okular, tobiasdeiminger
      
      Reviewed By: tobiasdeiminger
      
      Subscribers: tobiasdeiminger, okular-devel
      
      Tags: #okular
      
      Differential Revision: https://phabricator.kde.org/D21332
      b1c30cd0
  19. 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
  20. 19 May, 2019 1 commit
    • Rajeesh K V's avatar
      Okular Annotation: add support for line start style for Straight Line tool · 59a86c3f
      Rajeesh K V authored
      Summary: Similar to the line ending style, add support for line start style for the Straight Line annotation tool
      
      Test Plan:
      1. Go to Configure annotations
      2. Create (or edit existing) Straight Line tool
      3. Set the ‘Line Start’ option on Style and Apply
      4. Use the Straight Line tool to draw a line and check the line starting style.
      
      Reviewers: #okular, tobiasdeiminger
      
      Reviewed By: tobiasdeiminger
      
      Subscribers: ngraham, tobiasdeiminger, okular-devel
      
      Tags: #okular
      
      Differential Revision: https://phabricator.kde.org/D21238
      59a86c3f
  21. 14 May, 2019 1 commit
    • Tobias Deiminger's avatar
      Fix line annotation leader line angle · a0045a97
      Tobias Deiminger authored
      Summary:
      For "Straight Line" annotations, the "Leader Lines" (if any) shall be perpendicular to the main line segment. Current code missed to consider page aspect ratio when calculating the main segment angle, which caused non-perpendicular leader lines.
      
      Note: Bug is only visible with non-PDF documents (i.e. where Okular draws line annotation, instead of generator).
      
      Before:
      {F6818453}
      
      After:
      {F6818452}
      
      Test Plan:
      - open a txt file, the generated page will have aspect ratio 3:4
      - configure a "Straight Line" annotation with long leader line
      - create a line annotation at 45 degree angle
      - check the leader line, it shall be perpendicular to the main line
      
      Reviewers: sander
      
      Reviewed By: sander
      
      Subscribers: aacid, okular-devel
      
      Tags: #okular
      
      Differential Revision: https://phabricator.kde.org/D21136
      a0045a97
  22. 12 May, 2019 1 commit
  23. 07 May, 2019 1 commit
    • Rajeesh K V's avatar
      Okular Annotation: add support for line ending style for Straight Line tool · db2dcdad
      Rajeesh K V authored
      Summary:
      Poppler and Okular already have support for specifying Line End style (`TermStyle`) for the Straight Line tool. Expose the functionality in configuration and hook up the correct slots.
      
      Configure annotations (before):
      {F6788150}
      
      Configure annotations (after):
      {F6788151}
      
      Straight Line tool with Open Arrow end in action:
      {F6788153}
      
      Test Plan:
      1. Open a PDF in Okular
      2. Enable Review
      3. Right click on Review toolbar and Configure annotations
      4. Create (or edit existing) Straight Line tool
      5. Set the ‘Line End’ option on Style and Apply
      6. Use the Straight Line tool to draw a line and check the line ending style.
      
      Reviewers: #okular, #vdg, sander, ngraham
      
      Reviewed By: #vdg, sander, ngraham
      
      Subscribers: pino, sander, davidhurka, tobiasdeiminger, ngraham, okular-devel
      
      Tags: #okular
      
      Differential Revision: https://phabricator.kde.org/D20760
      db2dcdad
  24. 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