Commit graph

271 commits

Author SHA1 Message Date
shenleban tongying 2ba2ee5d87 Reduce sidebar title size
This slightly increases the amount of vertical space available for content.

BUG: 462321
FIXED-IN: 23.04
2023-01-05 23:45:52 +00:00
Eugene Popov 2fbab13e1f Port sidebar to QDockWidget
With this MR, the sidebar can now be (if not locked):
* docked to the left or right side
* undocked and floated as an independent window
* closed with the close button in the header

BUG: 455013
2022-12-22 22:50:55 +00:00
Albert Astals Cid fc8059575e Two more version checks that are not needed now 2022-11-19 11:10:16 +01:00
Albert Astals Cid 91afa74342 Set minimum requirement to Ubuntu 22.04 2022-11-19 09:48:15 +00:00
Nikola Nikolic e6002e798d Fix: Involuntary scrolling when annotations encounter the edge of the page
There are three reasons why scrolling happens (first two cases of scrolling are actually due to
viewport transition that is triggered by annotation being traslated/created):

1. VisiblePageRect are NormalizedRect and should be represented by four values in [0, 1] interval.
   Due to rounding errors caused by using QRect, they only reach the [0, 0.999] interval.
   That means that right and bottom edge of the page are never visible so if annotation
   is translated along the right/bottom edge viewport transition occurs (fixed in
   PageView::slotRequestVisiblePixmaps)

2. For freehand line there are some constants (dX, dY) that make a line to be drawn outside
   the page borders causing viewport transition. Removing these constants solves the problem (fixed
   in SmoothPathEngine::event)

3. Browse mode is activated as soon as the cursor is moved outside the viewport.
   Instead, we should forward the move event to the annotation which than can ignore the event (fixed
   in PageView::mouseMoveEvent)

BUG: 436742
2022-11-15 13:30:55 +00:00
Eugene Popov 40aa5fadb6 Increase scrolling speed with the touchpad
Currently, scrolling through a document using the touchpad is quite slow compared to scrolling through the standard Qt controls. This MR increases the speed of scrolling with the touchpad by removing the "magic" divider.

CCBUG: 455014
2022-11-13 18:12:25 +00:00
Eduardo Cruz ea04c61faf Add a configuration option to disable drag-scrolling beyond screen edges
The mouse cursor wrap feature while drag-scrolling can be undesirable in some
cases; for example it can be annoying to have the cursor jump accidentally to
the distant edge of a big screen. Now users can disable this feature if they
prefer.

BUG: 421040
FIXED-IN: 22.12
2022-09-28 00:10:56 +00:00
Albert Astals Cid d0359e6342 Merge remote-tracking branch 'origin/release/22.08' 2022-09-04 22:41:24 +02:00
Albert Astals Cid 8e93995e3c Fix saving files on Windows
turn a move into a copy and remove

Seems to work better with windows way of working with open files being
overwritten and stuff

BUGS: 458574
2022-09-04 22:26:23 +02:00
Albert Astals Cid b2c56a0a71 Merge remote-tracking branch 'origin/release/22.08' 2022-08-31 22:09:06 +02:00
Albert Astals Cid 3304038d1d ToggleActions: Obey "don't show text" for a particular action toolbar setting
BUGS: 457322
2022-08-31 19:59:22 +00:00
Albert Astals Cid 01871fdfff Even more tweaks to opening "text" files
BUGS: 430538
BUGS: 456434
2022-08-31 16:55:30 +00:00
Nikola Nikolic 46f8034335 Prevent annotations from being moved over the page border
BUG: 397222
2022-08-09 22:51:42 +00:00
Nikola Nikolic 55e074c8a1 Prevent popup note from being dragged outside the viewport
BUG: 423363
2022-08-05 23:06:38 +00:00
Friedrich W. H. Kossebau b96902b40c Port away from deprecated KMessageBox::sorry 2022-07-23 15:01:11 +02:00
Friedrich W. H. Kossebau 3efcce3344 Save warning confirm dialogs: avoid Yes/No buttons
Yes/No buttons in dialogs are discouraged (not only) by KDE HIG in favour
of actions terms.
2022-07-13 11:10:54 +00:00
Friedrich W. H. Kossebau dd44014b7a Too-Small-Digital-Signature dialog buttons: title capitalization, ui marker 2022-07-13 10:36:29 +00:00
Friedrich W. H. Kossebau dd8682ae8e Unsupported archive extension dialog: avoid Yes/No buttons
Yes/No buttons in dialogs are discouraged (not only) by KDE HIG in favour
of actions terms.
2022-07-13 12:07:21 +02:00
Albert Astals Cid 12ac32d414 Merge remote-tracking branch 'origin/release/22.04' 2022-07-04 19:44:28 +02:00
Albert Astals Cid e7db8c92ae Don't leave temp files around when saving
BUGS: 453421
2022-07-04 01:05:31 +02:00
George Florea Bănuș 327d547024 Add app-wide color scheme chooser
BUG: 432088
FIXED-IN: 22.08
2022-05-24 20:37:11 +00:00
Albert Astals Cid d9986c2b1e Merge remote-tracking branch 'origin/release/22.04' 2022-05-22 23:58:12 +02:00
Albert Astals Cid 1a980008be Fix crash while undoing with the menu on an empty annotation
BUGS: 453987
2022-05-18 23:12:18 +02:00
Luis Kao 1aa490bc2e Improve assertion message
The original message could be misleading.
2022-04-29 08:01:33 +00:00
Luis Kao 5001962112 Fix color mode actions in ViewerWidgetMode
Move "options_configure_color_modes" from Okular::Part::setupActions to
Okular::Part::setupViewerActions.

The color mode actions were not properly set in ViewerWidgetMode. Kile would
encounter "ASSERT failure" caused by the Q_ASSERT_X in ColorModeMenu class in
Debug mode.
2022-04-29 08:01:33 +00:00
Albert Astals Cid 0d40301d50 Add a few definitions that will come with ECM 5.85
Better enforce them now, so that the work to port doesn't increase over
time

Not a super fan of this for regular applications, but oh well the ship
has sailed
2022-04-07 23:02:12 +00:00
Albert Astals Cid 252236d413 Port a few more QLinkedList to QList
We don't need the special properties of QLinkedList in any of those and
QLinkedList is deprecated, so move away from it
2022-03-31 17:08:01 +02:00
Albert Astals Cid 0741ef1838 Port away from more QLinkedLists
QLinkedList is gone from Qt6

The almost 1:1 port is std::list but we don't need iterator stability on
removal/insertion so just port to QList
2022-03-22 12:58:59 +01:00
Albert Astals Cid 8941e43488 Port away from more QLinkedLists
QLinkedList is gone from Qt6

The 1:1 port is std::list but we don't need iterator stability on
removal/insertion so just port to QList (one case to std::vector since
QList needs a copy constructor)
2022-03-22 00:11:55 +01:00
Albert Astals Cid 6767b8739e Port a few QLinkedList to QList
QLinkedList is deprecated in later Qt5 and gone in Qt6

The 1:1 port is std::list but in this cases all we ever do
is create the lists, push back to them, and pass then around
to be read, for that a QList is more than enough
2022-03-19 11:22:55 +00:00
Albert Astals Cid 2d007f27d3 foreach -> for
A future ECM update is going to force that on us, so do it now anyway
2022-03-19 10:58:47 +00:00
Albert Astals Cid 6747e7fe8b signals-> Q_SIGNALS
A future ECM update is going to force that on us, so do it now anyway
2022-03-19 10:58:47 +00:00
Albert Astals Cid a2e1043149 slots -> Q_SLOTS
A future ECM update is going to force that on us, so do it now anyway
2022-03-19 10:58:47 +00:00
Albert Astals Cid ba35bbd9e6 emit -> Q_EMIT
A future ECM is going to force that on us, so do it early
2022-03-19 10:58:47 +00:00
snooxx 💤 2ad9e6f0b3
Simplify QPainter::drawRoundedRect usage
After fixing the porting mistake done in 78d983ee, `drawRoundedRect` can
be further simplified to not use any relative sizes anymore.

We can also assume that the code in `dviRenderer::epsf_special` was
supposed to use a constant corner radius and therefore was wrong
initially. By dropping `Qt::RelativeSize` the code might become closer
to its originally intended behavior.

Test Plan:
  - No change in behavior for rounded corners of "Welcome" popup message
    and "No Annotations" message in sidebar.
  - Could not test DVI code path.
2022-03-09 22:38:55 +00:00
snooxx 💤 1d30b03e39
Bring corner radius of popup messages in line with widget style
In 0070baaf `PageViewMessage` to display on-canvas notifications was
introduced, featuring rounded corners. Over the years, overall
preferences in the industry regarding the corner radius have changed
multiple times, with recent efforts trying to ensure a more consistent
usage in the entire UI of KDE's products.

Let's use a corner radius better matching the radius commonly used in
the current widget style, i.e. a bit less rounded, to make the message
fit in better with surrounding buttons and frames. Note that this is not
specific to Breeze, since most widget styles nowadays use a similar
corner radius. The radius is compatible with `KTextEditor::Message` too,
which is used in a similar context.

Test Plan:
  - Start Okular: The "Welcome" message and the "Document Loaded"
    message have a more professional look to them.
  - Open the annotations sidebar: The "No Annotations" message better
    fits in with the sidebar's frame.
2022-03-08 16:38:19 +00:00
snooxx 💤 667e73325a
Restore properly rounded corners of popup messages
78d983ee led to some rounded corners in the UI not being perfectly
circular anymore: Popup messages would stretch the rounding depending on
message length, and the rounded corner of the message in the annotation
bar would get distorted while changing the sidebar's width.

That commit tried to fix the following `warning: ‘void
QPainter::drawRoundRect(int, int, int, int, int, int)’ is deprecated:
Use drawRoundedRect(..., Qt::RelativeSize)` by changing to
`drawRoundedRect`, but missed to also add `Qt::RelativeSize`.

Adding the missing flag fixes both issues. The change is also
implemented in `dviRenderer::epsf_special` (introduced in be544056,
changed in 55dc43bf) for correctness.

Test Plan:
  - Start Okular. The "Welcome" message and the "Document Loaded"
    message have perfectly rounded corners again, not depending
    on message length.
  - Change width of the annotations sidebar: The "No Annotations"
    message does not change its rounded corners anymore.
  - Running in HiDPI mode retains the correct behavior.
  - Note: There does not seem to be a trivial/convenient way to trigger
    the DVI code path.
2022-03-07 14:01:53 +00:00
Albert Astals Cid ec1ed42dca Make clang-format happier 2022-03-12 10:59:53 +01:00
Thiago Simão af91d33070 Create empty inline note and then open dialog to get user's input. 2022-03-12 00:57:36 +01:00
Jonathan Marten 1489c9aacb Fix clang-format brace layout introduced in adc7a758 2022-03-11 10:06:13 +00:00
Jonathan Marten adc7a75803 Fix a missing brace if HAVE_SPEECH is not defined
Possibly introduced by commit 50d0703a.

part/pageview.cpp: In member function 'virtual void PageView::mouseReleaseEvent(QMouseEvent*)':
part/pageview.cpp:3077: error: expected '}' before 'else'
part/pageview.cpp:3069: note: to match this '{'
2022-03-11 09:49:26 +00:00
Volker Krause 50d0703ae0 Enable readability-braces-around-statements 2022-03-09 23:29:56 +01:00
Nicolas Fella d1ecad897c Implement keystroke commit events
When a form field loses focus a special keystroke event with
willCommit=true is sent.

This is based on work by Joao Netto <joaonetto901@gmail.com>
2022-03-07 22:14:26 +00:00
Albert Astals Cid 1aa175cf3f Support SaveAs action
If a new enough (unreleases as of now) poppler is available

BUGS: 451010
2022-03-06 19:16:27 +00:00
Nicolas Fella 1d64fea660 Port away from KToolInvokation 2022-03-03 21:54:28 +01:00
Albert Astals Cid 27c8919a42 Merge remote-tracking branch 'origin/release/21.12' 2022-02-27 12:09:58 +01:00
Nicolas Fella 03d83eb22d Don't create keystroke event when cursor moves
Currently we send a keystroke when the cursor moves but the text doesn't change.

Acrobat doesn't do it so let's do the same
2022-02-24 22:12:13 +01:00
Nicolas Fella 6c8cafbb1c Simplify keystroke event handling
Make it more similar to how we handle the format event.

We pass the new value to processKeystrokeAction, that calls the script
and sets the new value for the form object according to the result. If
needed the widget is refreshed to reflect the new text
2022-02-24 16:10:22 +01:00
Nicolas Fella ae8251a145 Don't clear focus when setting formwidget visible
Otherwise setVisibility(true) removes the focus
2022-02-24 15:36:43 +01:00
Huu-Tinh Pham 57829d1d81 added fallback icon for thumbnail sync context menu
The sync icon was missing when using the Breeze Icon pack.
Now a sync icon and a refresh icon is used for this thumbnail sync action.
2022-02-23 15:31:12 +00:00