1. 30 May, 2020 2 commits
    • Igor Poboiko's avatar
      [RichTextComposerImages] Rescale QImage accordingly · 227f0335
      Igor Poboiko authored
      The width and height are currently used to set properties of
      QTextImageFormat, which then are used to set "width" and "height" html
      properties for img tag, so that rescaling will be done by whoever reads
      generated html. The image itself is not affected.
      By also rescaling the image itself, we can save some space and reduce
      the size of the document
      (e.g.: I tried to add a HD photo of original size 4000x2000, whose base64
      was ~12mb; I resized it to 500x250, and the size reduced to 300kb)
      227f0335
    • Igor Poboiko's avatar
      Don't crash if activateRichText was called before createActions · 7ebe6420
      Igor Poboiko authored
      activateRichText emits textModeChanged signal, which leads to
      richTextComposerActions::textModeChanged call. Which segfaults if table
      actions are not yet created by explicit createActions call.
      7ebe6420
  2. 29 May, 2020 1 commit
  3. 28 May, 2020 2 commits
  4. 26 May, 2020 3 commits
  5. 25 May, 2020 2 commits
    • Igor Poboiko's avatar
      Add support for QTextBlockFormat::marker · fb117ee6
      Igor Poboiko authored
      This patch enables use of QTextBlockFormat::marker introduced in Qt 5.14.
      Using it, any list element can be marked with interactive checkbox.
      
      It adds a `KToggleAction` with which user can toggle this checkbox.
      
      Brief explanation of the logic:
       - If the cursor is already on a list, we just toggle the marker
       - If the cursor is not on a list, we have to add a list first
         (having a marker without a list just does nothing)
       - If the cursor was on the single-element list, and we have disabled
         the marker, disable the list too.
      fb117ee6
    • Igor Poboiko's avatar
      64344901
  6. 24 May, 2020 3 commits
  7. 23 May, 2020 10 commits
  8. 21 May, 2020 1 commit
  9. 19 May, 2020 1 commit
    • Igor Poboiko's avatar
      Export RichTextEditFindBar headers · 29552a47
      Igor Poboiko authored
      The PlainTextEditFindBar is already exported, just do the same for
      RichTextEditFindBar.
      
      I am currently porting KJots to KPIMTextEdit, as it seems to be much
      nicer compared to KTextWidgets. One of the features I like is inline search,
      which I would like to have both for KJotsEdit (which can be RichTextComposer)
      and KJotsBrowser (which is QTextBrowser). Since QTextBrowser is a
      subclass of QTextEdit, having RichTextEditFindBar there would be useful :)
      29552a47
  10. 17 May, 2020 2 commits
  11. 12 May, 2020 1 commit
  12. 11 May, 2020 3 commits
  13. 10 May, 2020 1 commit
  14. 09 May, 2020 1 commit
  15. 04 May, 2020 3 commits
    • Igor Poboiko's avatar
      [KPIMTextEdit/FindBar] Respect rich formatting and user settings when replacing all · 408ad525
      Igor Poboiko authored
      Summary:
      Instead of converting document to plain text, just loop over all encounters of the search string in the document and replace those.
      Otherwise we will lose all formatting in `RichTextEditor`.
      
      This way we're also able to respect the search settings (case sensitivity, whole word search).
      Also, provide user with a visual indication showing how many replacements were made (the same way Kate/KWrite does it).
      The latter two points also apply `PlainTextEditFindBar`.
      
      (in principle, to avoid code duplication, we can move this to `FindBarBase`.
      We only need to access `mView->document()`, which depends on the underlying text widget,
      so we could add a `virtual QTextDocument *document()` method to FindBarBase and reimplement it)
      
      Test Plan:
      Tested case-sensitive and regular expression `Replace All` on a rich-text document (having a list is already sufficient),
      the formatting is not messed up
      
      Reviewers: mlaurent, dvratil
      
      Reviewed By: mlaurent
      
      Subscribers: dvratil, kde-pim
      
      Tags: #kde_pim
      
      Differential Revision: https://phabricator.kde.org/D29318
      408ad525
    • Laurent Montel's avatar
      55654e99
    • Laurent Montel's avatar
      Make it compile against qt < 5.14 · 9c2ebf2f
      Laurent Montel authored
      9c2ebf2f
  16. 30 Apr, 2020 4 commits