The same can be achieve with a factory method in `Command`, similar to
the existing ones for actions and buttons which synchronize their tool
tips with the shortcut.
Change-Id: I7e17654706b902dfa14f37b958fc2a60705d5cb5
Reviewed-by: hjk <hjk@qt.io>
Also add method that sets the ParameterAction for the context action.
That is an alternative to "binding" the context action, and is useful in this
case, since we do not have a QObject that we can use as a parent for the
constructor that creates the ParameterAction from scratch.
Change-Id: I6ba05208d33460cfa2df9ce8247f7ca30624c22f
Reviewed-by: hjk <hjk@qt.io>
Github and others turn `[^footnote]` into anchor links to the next
occurrence of `[^footnote]: Description`.
Task-number: QTCREATORBUG-30119
Change-Id: Ieebcad8ef58ccd8c7faa6aa83a165ce3f7ea1a01
Reviewed-by: David Schulz <david.schulz@qt.io>
This allows to have custom toolbar actions while preserving the regular
text editor actions.
Fixes: QTCREATORBUG-30166
Change-Id: I4a22f415d05d80355cfdbe4a2c61501af2292e85
Reviewed-by: David Schulz <david.schulz@qt.io>
It looks like GitHub creates heading IDs by
- converting spaces to '-'
- removing anything that is not '-', '_', a number, or a letter
- converting to lower case
Task-number: QTBUG-120518
Change-Id: If09a8e2e0d964e751869eaebd3326a6f983ac495
Reviewed-by: David Schulz <david.schulz@qt.io>
Handle links ourselves since QTextBrowser doesn't do what we want.
- anchors without file path just jump to anchor
- local files (potentially relative to the markdown file) open in
Qt Creator (anchors ignored)
- otherwise QDesktopServices is used
Fixes: QTCREATORBUG-30120
Change-Id: I9a68607a0b32255ec075c698a1265cc6d1387e0c
Reviewed-by: David Schulz <david.schulz@qt.io>
And make the LineColumnButton independent of IEditor for that (since the
IEditor for the Markdown editor is not a TextEditor.
Change-Id: I52d378ec46d86b1c7928d18f7d39f9726bb6ad23
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
- avoid manual line breaks
- fix plural
- add some translator comments
- explicitly name an output pane
- use imperative for placeholder text
- it is a Markdown editor nowadays, not a viewer
Change-Id: I8418cfe0294c028b7d873305db0af4c25bc1097f
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
When loading a file it is more likely that the editable view
of the document should be focused than the read only part.
Change-Id: I8b7ed40a233dedf94883072be7462ebeabb78b42
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This restores the state of the markdown editor, including text editor
state, preview scroll position and button states, when closing and re-
opening a file.
Change-Id: Ibf1cadd5e0e80149123c6c5f599157e931330343
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
Redirect the currentLine/Column and gotoLine functions to the text
editor and ensure that it is visible for gotoLine.
Change-Id: I546e2cb1761363e3a75f9adeebcba195e312f00b
Reviewed-by: David Schulz <david.schulz@qt.io>
Delay the update: The implementation in Qt is currently very slow, and
while we don't have a fix, editing with immediate update is very
sluggish.
Also do not update the preview, if it isn't visible.
Change-Id: I35e10af232064b02a36a8be3758ea0bbc5b66f40
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
When the markdown editor is opened or switched to, the focus is set on
the editor widget. We don't want the focus on the splitter, but on
either the text editor or the preview, depending on what had focus
before.
Change-Id: Ib54899c6251f2c5362f95d990e7150b6fee0f1e1
Reviewed-by: David Schulz <david.schulz@qt.io>
Make it possible to hide the preview, by having a toggle button for
"Show Preview" and "Show Editor", and ensure that at least one is always
on and they are in the order as the views themselves. Disable the "Swap
Views" button if only one is shown.
Change-Id: I0ec1e06c2a8ec94e34bf52eae45ba009fd8cd1b5
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>