1. 11 Oct, 2020 1 commit
    • Tobias Deiminger's avatar
      Complete TextSelectorEngine if nothing selected · c8cf6513
      Tobias Deiminger authored
      Selecting highlight tool, pressing left mouse button while over text, and
      immediately releasing without dragging a selection caused inconsistent state.
      
      It left TextSelectorEnigne in the state m_creationCompleted == false and
      m_lockedItem == something. Then in continuous mode all events kept on being
      propagated to TextSelectorEngine::event, even if the user started unrelated
      interactions in the meantime. This caused various side effects.
      
      It notably happened when you double clicked a finished highlight annotation,
      as described in bug 426658.
      
      We can go to m_creationComplete after release even without a selection,
      because TextSelectorEngine::end and PageViewAnnotator::performRouteMouseOrTabletEvent
      handle the case just fine, i.e. don't create an annotation but reset the state machine.
      
      Fixes bug 426658 at least partially. I couldn't reproduce the described crash,
      so no idea if that's also fixed.
      
      BUG: 446658
      c8cf6513
  2. 30 Aug, 2020 1 commit
  3. 25 Aug, 2020 1 commit
    • Simone Gaiarin's avatar
      Store the state of the builtin annotations in a new config key · 10d92fbe
      Simone Gaiarin authored
      Using the new configuration key BuiltinAnnotationTools instead of AnnotationTools, we avoid any conflicts in the configuration files due to the fact that the key AnnotationTools had a different meaning in the previous versions of Okular. In particular we avoid the critical problem that the actions in the UI do not match the actual annotation tools. The conflict may happen if the kconf_update script is not executed for some reason (e.g. okular running from flatpack).
      
      BUG: 425354
      FIXED-IN: 1.11.1
      10d92fbe
  4. 05 Aug, 2020 1 commit
    • Simone Gaiarin's avatar
      Find built-in tool corresponding to quick tool at runtime · 72f5a2db
      Simone Gaiarin authored
      In this way it is possible to drop the `sourceId` attribute from the quick tools definition. This simplifies the code logic and makes it easier to update user settings from the previous version of Okular (because there is no need to add the attribute `sourceId`
      
      This also fixes the crash due to the fact that `sourceId` was not correctly created when a quick annotation is created from the Annotation page of Okualr Settings.
      
      BUG: 424810
      FIXED-IN: 1.11.0
      72f5a2db
  5. 16 Jul, 2020 1 commit
    • David Hurka's avatar
      Add Constrain Angle action for annotation tools, alternative to pressing Shift · 34708565
      David Hurka authored
      This adds a KToggleAction which sets annotation tools to constrain angle mode.
      It provides an alternative user interface to the Shift button, which is used to constrain angles since MR !210.
      The action and the Shift button are XOR-ed, i. e. if constrain angle mode is activated, pressing Shift temporarily disables it.
      
      The action state is remembered accross sessions, for consistency with most other actions. It should be difficult to check this action without knowing of its existence, since it is not in any toolbar or menu, just in the action collection.
      
      The meaning of AnnotatorEngine::Modifiers was generalized a bit, moving the responsibility about whether to constrain angles back to PageViewAnnotator, because AnnotatorEngine does not know about the action.
      
      FEATURE: 353560
      FIXED-IN: 1.11
      34708565
  6. 13 Jul, 2020 2 commits
  7. 11 Jul, 2020 1 commit
    • Albert Astals Cid's avatar
      Run clang-format · 19d98d6a
      Albert Astals Cid authored
      find . \( -name "*.cpp" -or -name "*.h"  -or -name "*.c"  -or -name "*.cc" \) -exec clang-format -i {} \;
      
      If you reached this file doing a git blame, please see README.clang-format (added 2 commits in the future of this one)
      19d98d6a
  8. 08 Jul, 2020 1 commit
  9. 04 Jun, 2020 1 commit
    • Simone Gaiarin's avatar
      Overhaul annotations UX · 0b05d7ce
      Simone Gaiarin authored
      Create a new new annotation toolbar to replace the current one as discussed in the task T8076.
      Fixes:
      BUG: 386578
      BUG: 374728
      BUG: 352310
      BUG: 330518
      BUG: 341914
      BUG: 157289
      BUG: 358057
      BUG: 412767
      BUG: 413595
      BUG: 420462
      FIXED-IN: 1.11.0
      
      Test Plan
      Before testing this revision
      Delete or Temporary move aside the following files:
      
      ~/.config/okularpartrc
      ~/.config/okularrc
      ~/.local/share/kxmlgui5/okular/part.rc
      ~/.local/share/kxmlgui5/okular/shell.rc
      
      Nomenclature
      Actions in the main toolbar:
      
      Quick annotations
      Actions in the annotation toolbar:
      
      Annotation actions Highlighter, Underline, Squiggle, Strike out, Typewriter,
      Inline note, Popup note, Freehand line, Arrow, Straight line, Rectangle, Ellipse,
      Polygon, Stamp
      
      Annotation config actions Line width, Color, Inner color, Opacity, Font, Annotation settings
      
      Other actions Add to Quick Annotations, Pin
      
      Autotests
      
       First run: annotation toolbar is not visible
      
       Selecting Tools > Annotations shows the annotation toolbar (below the main toolbar by default)
      
       Select an annotation > toolbar is shown
      
       Select a quick annotation > toolbar is shown
      
       Hide action (red cross) on the toolbar hides the toolbar
      
       Keys 1-9,0 select the (builtin) Annotation actions (one case tested)
      
       Keys Alt+1-9,0 select the quick annotation actions (one case tested)
      
       No annotation action selected: Quick Annotations is enabled, Add to quick annotations is disabled, Annotation config actions are disabled, Pin is enabled
      
       The current document is an image: Highlighter, Underline, Squiggle, Strike out are disabled (also in Quick annotations)
      
       The current document is protected: All actions are disabled
      
       Select annotation: the  Annotation config actions are enabled and their values set to the ones for the current annotation (taken from okularpartrc)
      
       Click an annotation action when none selected: browse mode is selected
      
       Click the currently selected annotation action: the action is unchecked and the tool disabled (back to browse mode)
      
       Click ESC: the currently selected annotation action is unchecked
      
       If Pin unchecked the selected annotation is unchecked after it has be used once and we are back to Browse mode
      
       The annotation systems works when multiple Okular tabs are open (the selected annotation is per-tab)
      
      Manual tests
      
      (TODO) Check that kconf_update updates the key AnnotationTools to QuickAnnotationTools in ~/.config/okularpartrc
      
      Color icon is a format-text-color (if inline note or typewriter) or format-stroke-color for all other annotations
      All actions have tooltips (some change based on the fact that the icon is enabled or not)
      If a custom Line Width or Opacity is set through the Annotation Settings dialog, its value appears as a new checked action in the Line width or Opacity menu
      If a custom stamp is selected through the Annotation Settings dialog, its name or filename (without path) appears as a new checked action in the Stamp menu
      In Configure Okular > Annotations it is only possible to configure the quick annotations. Modifying them here updates the Quick annotations list after clicking Apply
      
      The current document is an image: Highlighter, Underline, Squiggle, Strike out are disabled in Quick annotations
      The state of Pin action is remembered across Okular launches
      Selecting a quick action selects the corresponding action and loads its config values (color, line width, ...)
      Setting the color and fill color works for all annotations (to be tested carefully, can be problematic for typewriter and inline note given the different internal mechanism to store the color in the settings)
      Test stamp annotation (handled differently from the rest of the annotations)
      
      Merge Request: !105
      0b05d7ce
  10. 21 Feb, 2020 1 commit
  11. 23 Dec, 2019 1 commit
  12. 09 Dec, 2019 1 commit
  13. 01 Dec, 2019 1 commit
    • Tobias Deiminger's avatar
      Fix spurious dialogs in PickPointEngine · 00640370
      Tobias Deiminger authored
      In the case of multiple input events, the local event loop of
      QInputDialog was processing pending events before m_creationCompleted
      could be cleared. This allowed recursive calls to PickPointEngine::end,
      even on wrong events (e.g. MouseMove shouldn't cause end(), but it did).
      
      BUG: 409638
      BUG: 413990
      00640370
  14. 27 Jul, 2019 1 commit
  15. 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 previe...
      f15e8568
  16. 27 May, 2019 1 commit
  17. 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
  18. 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
  19. 13 Mar, 2019 1 commit
  20. 11 Jan, 2019 1 commit
  21. 04 Oct, 2018 1 commit
    • Dileep Sankhla's avatar
      Support setting text color for typewriter annotations · e44ff387
      Dileep Sankhla authored
      Summary:
      Changing typewriter text color can be done in the typewriter properties dialog, or programmatically via new okular API methods TextAnnotation::textColor and TextAnnotation::setTextColor.
      
      poppler >= 0.69 is required to store text color natively inside PDF documents. For other document types, text color is stored as metadata inside the document archive.
      
      This work was done during GSoC 2018. See https://community.kde.org/GSoC/2018/StatusReports/DileepSankhla for details.
      
      Test Plan:
      - properties dialog of typewriter annotation has "Font Color" picker
      - saving to PDF results in <r> <g> <b> rg operation in /DA
      - saving to archive results in fontColor="rrggbb" attribute in metadata.xml
      
      Reviewers: sander
      
      Reviewed By: sander
      
      Subscribers: kde-doc-english, sander, okular-devel
      
      Tags: #okular, #documentation
      
      Differential Revision: https://phabricator.kde.org/D15205
      e44ff387
  22. 25 Sep, 2018 1 commit
    • Dileep Sankhla's avatar
      Add typewriter annotation tool · 6dd7cf66
      Dileep Sankhla authored
      Summary:
      Typewriter is originally specified by the PDF reference as special FreeText annotation, where Intent=FreeTextTypewriter. It features opaque letters on transparent background, so that users can fill non interactive forms. Herewith typewriter is implemented natively for PDF, and there's also an Okular specific implementation for other document types. The added tool reuses the inline note UI.
      
      This work was done during GSoC 2018. See https://community.kde.org/GSoC/2018/StatusReports/DileepSankhla for details.
      
      FEATURE: 353401
      
      Test Plan:
      - okularpartrc is generated (if not yet existing) with typewriter as 10th tool
      - typewriter tool is also available in Annotation Tools -> Add, Typ "Typewriter"
      - selecting the tool and left click into document opens inline note input dialog
      - finishing creates an annotation similar to inline note, but with transparent background
      - saving into PDF results in /Subtype FreeText /IT /FreeTextTypeWriter
      - saving typewriter into archive stores color with alpha channel = 0x00
      - opening annotated archive works, if archive was created with old Okular, and opened in patched Okular
      - opening annotated archive works, if archive was created with patched Okular, and opened in old Okular
      
      Reviewers: sander
      
      Reviewed By: sander
      
      Subscribers: ngraham, sander, okular-devel
      
      Tags: #okular
      
      Differential Revision: https://phabricator.kde.org/D15204
      6dd7cf66
  23. 12 Sep, 2018 1 commit
  24. 17 Aug, 2018 1 commit
  25. 06 Apr, 2018 2 commits
    • Fabian Kosmale's avatar
      use correct filepath · c70485cd
      Fabian Kosmale authored
      Summary:
      Seems like someone forgot to consistently apply a change. Maybe the path
      construction should be factored into a reusable lambda?
      
      Test Plan:
      Open Okular, open settings > configure Okular. Without the patch, you'll get a
      "QFSFileEngine::open: No file name specified" warning, with the patch it
      disappears. Note that there is also an unrelated "Illegal icon group:  7"
      warning from KIconThemes, but I'm 99% certain that this is on KIconThemes doing
      a bogus check in KIconEffect::apply, not on Okular
      
      Reviewers: #okular, hetzenecker, aacid
      
      Reviewed By: #okular, aacid
      
      Subscribers: aacid, #okular
      
      Tags: #okular
      
      Differential Revision: https://phabricator.kde.org/D12001
      c70485cd
    • Fabian Kosmale's avatar
      use correct filepath · f8f7a77f
      Fabian Kosmale authored
      f8f7a77f
  26. 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
  27. 05 Sep, 2017 1 commit
  28. 29 Oct, 2016 1 commit
  29. 17 Oct, 2016 1 commit
    • Albert Astals Cid's avatar
      Remove the !this checks · f943f9ee
      Albert Astals Cid authored
      It's not part of the standard and GCC recently removed support for it
      
      Looking at the code it seems we only need one external check, let's hope i'm right :D
      f943f9ee
  30. 11 Jul, 2016 3 commits
  31. 24 Nov, 2015 1 commit
  32. 29 Oct, 2015 1 commit
  33. 19 Oct, 2014 1 commit
  34. 12 Oct, 2014 1 commit
  35. 01 Oct, 2014 2 commits