Age | Commit message (Collapse) | Author |
|
This adds PDFEncryptorR6 and adds R6 hash implementation and makes
sure it is correct with a test.
Change-Id: I11ca746a6b676bb294723b4ef76069f1d4f3a182
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177384
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Jenkins
|
|
Change-Id: I1b41a57ccdda4cdbd8a3a8ab3dbde495a51df80e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177508
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
|
|
Change-Id: I2708f103cb9e63294cd2ee056dc490c734285a31
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177487
Tested-by: Jenkins
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
|
|
Change-Id: I93571abf7f056f51039672d03a7bcfc1d6bb6dea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177465
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
|
|
While QtInstanceEntry generally takes care of handling signals
for the spinbox's QLineEdit, this doesn't work when the value
is changed as a result of setting a new spinbox value (e.g.
by using the spinbox buttons), as the QLineEdit signals are blocked
then, see QAbstractSpinBoxPrivate::updateEdit in qtbase [1].
Therefore, connect the QDoubleSpinBox::textChanged signal
to the slot that calls signal_changed() instead to ensure
it gets called nonetheless, and disconnect from the other signal.
While at it, also add a SolarMutexGuard when calling the
signal.
This fixes the issue noticed with the "Go to Page"
dialog mentioned in previous commit
Change-Id: I1f24cf3925e945ae78a9f1646535e08736cd8786
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Wed Nov 27 23:53:58 2024 +0100
tdf#130857 qt weld: Support "Go to Page" dialog
as:
> One issue seen with the dialog is that by using the
> up arrow of the spinbox to increase the value, it
> is currently possible to increase the value
> beyond the maximum value (last page number),
> while this is not the case when typing a number
> into the box manually.
>
> This is because the GotoPageDlg::PageModifiedHdl
> handler currently only gets called for the
> latter case, not the former one, despite
>
> Change-Id: Ie19bc852f4ceed0fa79565302975376db7126ea4
> Author: Michael Weghorn <m.weghorn@posteo.de>
> Date: Wed Nov 27 22:53:55 2024 +0100
>
> tdf#130857 qt weld: Also notify about programmatic text changes
>
> and will be addressed in a separate commit.
[1] https://code.qt.io/cgit/qt/qtbase.git/tree/src/widgets/widgets/qabstractspinbox.cpp?id=ced47a590aeb85953a16eaf362887f14c2815c45#n1790
Change-Id: Ifba9a0877442f9e84f0103d8aab202ae3583c5cf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177451
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
|
|
As weld::SpinButton derives from weld::Entry,
also let QtInstanceSpinButton derive from
QtInstanceEntry, instead of duplicating code
by reimplementing all of the weld::Entry methods
anew.
As the QtDoubleSpinBox derived from QDoubleSpinBox
itself is not a subclass of QLineEdit, it cannot
itself be passed down as the widget to the
QtInstanceEntry ctor.
Pass the spin box's QLineEdit instead. Make it
available by adding a new QtDoubleSpinBox::lineEdit
method which overrides the base class method of the same
name that is protected.
With this in place, QtInstanceSpinButton is now
the only QtInstanceWidget subclass where the
widget passed down to QtInstanceWidget is not
the same as passed by QtInstanceBuilder in
the QtInstanceSpinButton ctor, i.e.
QtInstanceWidget::getQWidget does not return
the QtDoubleSpinBox, but it's line edit.
Therefore, make QtInstanceWidget::getQWidget
virtual and override it in QtInstanceSpinButton
to return the spin box.
Drop the QtInstanceSpinButton methods of all
methods already implemented in QtInstanceEntry.
Change-Id: Ide2e1fe91216a5ec7f90a4f72ae34e3f63f624d3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177449
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
|
|
Change-Id: I435ed112469b58cec191badaf98e7f019381707b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177446
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
|
|
Implement QtInstanceSpinButton methods related to
the text cursor and selection.
The QDoubleSpinBox base class QAbstractSpinBox
has a method QAbstractSpinBox::lineEdit [1]
that provides access to the spin box's QLineEdit.
However, that method is protected, and can therefore
not be accessed from QtInstanceBuilder.
Therefore, add corresponding methods to
QtDoubleSpinBox and forward calls to the line edit
from there.
The methods implemented in this commit are
very similar to the corresponding ones in
QtInstanceEntry (which however has has direct access to
the QLineEdit).
[1] https://doc.qt.io/qt-6/qabstractspinbox.html#lineEdit
Change-Id: Ib5d2b55478f88618ed58adc2353824c59015a039
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177436
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
|
|
Introduce a new QtDoubleSpinBox subclass for the
stock QDoubleSpinBox and use it for the native Qt
weld::SpinButton implementation.
Initially, the new subclass doesn't add any
additional functionality, but that will be
added in future commits to provide functionality
needed to implement more of the QtInstanceSpinButton
methods.
Change-Id: Icebbf6485172b065d6a6d2c1c8ef87be9d3d244e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177435
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
|
|
Rename weld::Dialog::widget_for_response to
weld::Dialog_button_for_response as it specifically
returns a weld::Button, not a generic weld::Widget (other than GTK's
`gtk_dialog_get_widget_for_response` [1] which
returns a GtkWidget).
[1] https://docs.gtk.org/gtk3/method.Dialog.get_widget_for_response.html
Change-Id: I3b1dc34c0af752853551d2ebb706109f2214720d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177376
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
|
|
... to make more obvious from the API that the
caller owns the returned weld::Button* (but not
the underlying toolkit widget).
Change-Id: I64f57f80e4eea4c2c984fa7b615b5a2350ed892a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177375
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
|
|
While debugging tdf#163945, Xcode's Instruments application uncovered
the following performance bottlenecks when using Skia/Metal:
1. Very slow rendering an NSBox:
Many system colors have the NSColorTypeCatalog color type. For
some unkown reason, setting the NSBox's fill color to a color set
to NSColorTypeCatalog causes drawing to take at least twice as
long as when the fill color is set to NSColorTypeComponentBased.
So, only draw with a fill color set to NSColorTypeComponentBased.
2. Excessively large offscreen buffers when drawing native controls:
The temporary bitmap was set to the control region expanded by
50 * mScaling (e.g. both width and height were increased by 200
pixels when running on a Retina display). This caused temporary
bitmaps to be up to several times larger than needed. Also,
drawing NSBox objects to a CGBitmapContext is noticeably slow
so filling all that unneeded temporary bitmap area can slow down
performance when a large number of NSBox objects like the status
bar are redrawn in quick succession.
Using getNativeControlRegion() isn't perfect, but it does try to
account for the focus ring as well as the minimum width and/or
height of the native control so union the two regions set by
getNativeControlRegion() and add double the focus ring width on
each side just to be safe. In most cases, this should ensure
that the temporary bitmap is large enough to draw the entire
native control and a focus ring.
3. Unncessary copying of bitmap buffer when drawing native controls:
Let Skia own the CGBitmapContext's buffer so that an SkImage
can be created without Skia making a copy of the buffer.
Change-Id: Ibd3abb4b9d7045c47268319772fe97a5c4dba3c6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177225
Tested-by: Jenkins
Reviewed-by: Patrick Luby <guibomacdev@gmail.com>
|
|
The idea of IPDFEncryptor is to be the interface to encrypt the
stream/string in the same way, irregardless which PDF encryption
version/revision we are using.
Change-Id: Ie7835384f1be5a44c53985b01c8187323400aa0e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176890
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
|
|
Call weld::Expander::signal_expanded when the
QtExpander expanded state changes, e.g. when
its button gets clicked.
In order to do that, introduce a signal in
QtExpander and connect to that in
QtInstanceExpander.
With this in place, a breakpoint in
weld::Expander::signal_expanded now gets
hit as expected when (un)expanding the
expander in the "Set Password" dialog triggered in Writer
using "File" -> "Save As", check "Save with password"
checkbox and press "Save" when using the qt6 VCL
plugin with SAL_VCL_QT_USE_WELDED_WIDGETS=1 set.
This implements what was mentioned as still
missing in earlier commit
Change-Id: I7e3a332c0417b1897ae57d7d4c29609245fb5e19
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Sun Nov 24 01:20:31 2024 +0100
tdf#130857 qt weld: Add QtInstanceExpander
as
> Signal handling still needs to be implemented
> (calling `weld::Expander::signal_expanded` when
> the expanded state is toggled).
Change-Id: I9cd1b2cc99018f84ba930d55399953266119bed0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177199
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
|
|
Add a new QtInstanceExpander class that is the
weld::Expander implementation using a native
Qt widget. It uses the custom QtExpander widget
added in
Change-Id: Id2366834cb542eba613ea087e70f3a812d20fa89
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Sun Nov 24 00:07:44 2024 +0100
tdf#130857 qt weld: Implement "GtkExpander" equivalent
Extend QtExpander to provide what's needed
to implement the QtInstanceExpander methods.
Let QtInstanceBuilder::weld_expander return an
instance of the new class.
Signal handling still needs to be implemented
(calling `weld::Expander::signal_expanded` when
the expanded state is toggled).
QtInstanceExpander is e.g. needed by the "Set Password"
dialog. ("File" -> "Save As", check "Save with password"
checkbox and press "Save" to trigger the dialog.)
Change-Id: I7e3a332c0417b1897ae57d7d4c29609245fb5e19
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177197
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
|
|
Implement support for "GtkExpander" objects in .ui
files. As Qt doesn't seem to have any equivalent, add
a new QtExpander class that subclasses QWidget and
has a button that can be used to toggle visibility
of the widget that is the GtkExpander's [1] content child.
For a visual appearance similar to GtkExpander,
set an icon for the button ("go-down" and "go-next"
from the icon theme, which are arrows like the ones
shown on a GtkExpander, at least with the Breeze
icon theme).
In QtBuilder, implement handling for "GtkExpander"
objects:
* Create an instance of the new QtExpander
class.
* Identify the content child, which can be distinguished
from the label child by the fact that the latter
has a "label" child type set, see also previous
commit
Change-Id: I3e308a6642d72b55d0ccc597dac716b236c22d61
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Sat Nov 23 20:54:47 2024 +0100
tdf#130857 Pass child type to WidgetBuilder::insertObject
* Erase the "visible" property for the content child,
as otherwise the content widget would be initially
visible even if the expander is set to not be
expanded. (QtExpander takes care of this, so
ignore the property set in the .ui file.)
* For the label child in GtkExpander, simply take
over its text to QtExpander's button, then mark
the label for deletion, as it's not needed
otherwise.
Support for the "Document in Use" dialog that
has a GtkExpander and thuse makes use of this
will be declared in a separate commit.
[1] https://docs.gtk.org/gtk3/class.Expander.html
Change-Id: Id2366834cb542eba613ea087e70f3a812d20fa89
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177193
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
|
|
weld::Window::set_centered_on_parent only ever gets
called for weld::Dialog instances, so move it to the
weld::Dialog subclass.
For the Qt implementation, no longer trigger an assert because
of the method being unimplemented (doing nothing), as QDialog
opens centered on its parent toplevel by default.
Quoting from the QDialog doc [1]:
> Note that QDialog (and any other widget that has type Qt::Dialog) uses
> the parent widget slightly differently from other classes in Qt. A
> dialog is always a top-level widget, but if it has a parent, its default
> location is centered on top of the parent's top-level widget (if it is
> not top-level itself).
(API for moving a QWidget to a different position like
QWidget::move [2] exists, but would only work on X11/XWayland,
not Wayland.)
[1] https://doc.qt.io/qt-6/qdialog.html#details
[2] https://doc.qt.io/qt-6/qwidget.html#pos-prop
Change-Id: I14d41f91e5297c6e58cb4edb2ee98f19814d45cb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177192
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
|
|
In WidgetBuilder::handleChild, pass the child type
not only to WidgetBuilder::tweakInsertedChild, but
also to WidgetBuilder::handleObject (add a new param
for that) and from there down into the virtual
WidgetBuilder::insertObject, so it can be evaluated
by subclasses when creating new widgets.
While it is not used yet, an upcoming commit will
make use of it in QtBuilder, in order to distinguish
between the two "GtkExpander" children: the label and
the actual content child.
As described in the "GtkExpander as GtkBuildable" doc [1]:
> The GtkExpander implementation of the GtkBuildable interface supports
> placing a child in the label position by specifying “label” as the
> “type” attribute of a <child> element. A normal content child can be
> specified without specifying a <child> type attribute.
[1] https://docs.gtk.org/gtk3/class.Expander.html
Change-Id: I3e308a6642d72b55d0ccc597dac716b236c22d61
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177191
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
|
|
And drop EPosition, which duplicates EPaM, except for its default
ctor (used in a single place).
Change-Id: I48bb6dafcba84465d61579df0ec71b815945532a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177075
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
|
|
Add a helper method QtBuilder::deleteObject
that takes care of marking no longer needed
objects for deletion and use it in the 3 places
so far calling QObject::deleteLater themselves.
If the object marked for deletion is a widget,
hide it as well, as it could otherwise still
be "in the way".
This was seen wit the edit (QLineEdit) of the editable
combobox in the "File" -> "Properties" dialog,
"General" tab (in a WIP branch for adding support
for that dialog), where the unnecessary edit was
shown on top of the combobox, hiding the combobox
content + dropdown button.
Change-Id: Ie299b80824c94d40cfac9f7962c9bd4ba95b446d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177057
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
|
|
Change-Id: I0943a2d8e35acea8e1af97bdd151bba65b0af24a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177056
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
|
|
When this method gets called the first time, insert
a widget with a QVBoxLayout at the beginning
of the dialog's layout, remember and return that.
On subsequent call, return the same one.
Initially, handle the case where the dialog's
layout is a QBoxLayout (subclass), which is
the case for the "File" -> "Printer Settings"
-> "Options" dialog in Writer.
This should be easy to extend for other layouts
as well when needed. For now, assert when another
layout is used, so it will become clear when
working on adding support for another dialog
that needs this.
Change-Id: Ia41a87f8cf62666efc91c05f25dae5fccb3da41d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177054
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
|
|
Change-Id: I24666a7746f8920ddf84731f204f3e1a5b9b0c85
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177024
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: Ie710e51faa7d65686d72a03d1ef4ca40dff8c27e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176889
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
|
|
To make the code contained, so it is easier to add the new
encryption method later.
Change-Id: Ie3e3194c2148f6c3cb8ac58709fcd5f74e84a93a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176886
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
|
|
The actual number of hidden children is not of interest here,
only whether there is at least one, so stop iterating once
the first hidden child is encountered.
Change-Id: Ice1a7461d2bfd9d576109771cf93deb6a17ef975
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176930
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
|
|
The method is only used in the PriorityMergedHBox
subclass, which overrides the method anyway,
so drop the base class implementation.
Change-Id: If2c11377b1ca0ac0f3c6cd4fec9890cdcbbce0ed
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176929
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
|
|
so only the one that implements it needs to override it
Change-Id: I19e79c5746dbbebbf5914922587016fd03a902d4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176848
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: Ie92591770a2828a5f828d76d8c1bf7e5a253c3de
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176814
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
|
|
so only the one that implements it needs to override it
Change-Id: I1acffb4796d95d75edc4507f533d9b1f8987972b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176790
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
|
|
it is only used for one thing, so rename it, and
use a default implementation to avoid having empty
implementations everywhere
Change-Id: Ib650bb520ccbfcc27537b754db4d3de4ad10e638
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176733
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
I think I managed to disable this when I converted it to
use the shared plugin infrastructure.
So fix that, and then make it much smarter to avoid various
false positives.
Change-Id: I0a4657cff3b40a00434924bf764d024dbfd7d5b3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176646
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
it is always called in the destructor, so lets just centralise the logic
here
Change-Id: I8c9b204d147315b6693fa7a08f759b53b9a6a17c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176731
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
it is only called to do one thing, in X11SalGraphics, so make
it private to that class, and rename it to better fit its
purpose.
Change-Id: I16ea2f86f8b596351354faa80bb2bab4d2ac6e7c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176729
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Following
commit 4f08a15f3be9b39d0f1e83e6cffa47b62c183b69
Author: lovatico21 <lorenzo04lovato@gmail.com>
Date: Wed Nov 13 18:12:58 2024 +0100
updated vim footers in vcl/qt6/*.cxx
, update vim header/trailers to those in current
`TEMPLATE.SOURCECODE.HEADER` for other qt5/qt6
headers and sources as well (i.e. for directories
`vcl/inc/qt5`, `vcl/inc/qt6` and `vcl/qt5/`).
Change-Id: If9fea8f4ce955396f064dbd9fd706e76d947bce1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176705
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
|
|
This change includes GUI element changes to support viewing and editing
first-line indent values with font-relative units in the paragraph style
dialog.
Change-Id: I72ada2565f51d70475eb17096a1317be9316b770
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176595
Reviewed-by: Jonathan Clark <jonathan@libreoffice.org>
Tested-by: Jenkins
|
|
This change implements layout for font-relative paragraph first-line
indentation in Writer.
Change-Id: Ie8f386bcc13a43ab92d5c15654c24bfdfc62bd69
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176216
Tested-by: Jenkins
Reviewed-by: Jonathan Clark <jonathan@libreoffice.org>
|
|
This is effectively the weld::Dialog equivalent of
Change-Id: Ia839fac90ea93b9ac6be5819aa4bb3261a775f33
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Sun Nov 10 23:01:07 2024 +0100
vcl: Return unique_ptr in weld::MessageDialog::weld_message_area
Change-Id: I3eee2d3617c3576b442a5578090cd5de53e17f33
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176365
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
|
|
The returned weld::Container* (but not the associated toolkit
widget) is owned by the caller.
Make that more obvious by returning a unique_ptr<weld::Container>
instead of a raw pointer.
This is also consistent with what other methods returning
instances for which the caller takes over ownership
(like weld::Widget::weld_parent) do, whereas
e.g. weld::Notebook::get_page returns a weld::Container*
that is owned by the weld::Notebook instance, not the caller.
Change-Id: Ia839fac90ea93b9ac6be5819aa4bb3261a775f33
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176363
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
|
|
Move VclBuilder::handleMenuObject to the WidgetBuilder template
base class, and add a new purely virtual WidgetBuilder::insertMenuObject
that the existing VclBuilder equivalent now overrides.
This moves the remaining XML parsing logic from VclBuilder
to one of the base classes (WidgetBuilder, BuilderBase),
following the approach outlined in
commit f61ecf25636d401f862c4de226c04237e1fb2f69
Author: OmkarAcharekar <omkaracharekar12@gmail.com>
Date: Fri Sep 20 13:33:01 2024 +0200
tdf#130857 refactor VclBuilder: Extract template base class
Update the source code comments accordingly.
For QtBuilder, initially add a dummy implementation
that simply triggers an assert, but can be adjusted
in the future to create native Qt menus.
Change-Id: I3147cac28c7273cd4c4ea7344a083cd66af8337f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176362
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
|
|
Add a new purely virtual WidgetBuilder::createMenu
and use that in VclBuilder::handleMenu instead
of directly calling VclPtr<PopupMenu>::Create there.
This is in preparation of moving
VclBuilder::handleMenu to WidgetBuilder as well,
to make it reusable for other child classes, in
particular QtBuilder.
Change-Id: Icf3f937ea8e876c8393185e41a95e0f66458ce11
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176360
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
|
|
Move the MenuAndId struct and the `m_aMenus` member from
VclBuilder to the WidgetBuilder base class and add two template
parameters `MenuClass` and `MenuPtr`, which VclBuilder
specializes with `PopupMenu` and `VclPtr<PopupMenu>`,
effectively leaving the logic unchanged.
Move VclBuilder::get_menu accordingly.
For QtBuilder, use `QMenu` and `QMenu*` for
the new template class parameters.
This can be used to implement support for
native Qt menus in the future.
Change-Id: Ib015b1b1e6968338ed7419b1822665a521ca748d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176359
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
|
|
Call the corresponding handlers to notify about
the previous and current tab page when switching
the tab page in QtInstanceNotebook, by remembering
the identifier of the current page and using that
in a slot connected to the QTabWidget::currentChanged
signal.
Change-Id: I387c75b3af138cf9b89f169f0a3c223c262c2a92
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176356
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
|
|
Implement all of the QtInstanceNotebook methods,
see also GtkInstanceNotebook and SalInstanceNotebook
for the gtk3 and VCL implementations for comparison.
Unlike weld::Notebook, QTabWidget doesn't have the
concept of IDs for tabs in addition to indices.
Introduce a PROPERTY_TAB_PAGE_ID property that
gets set on the widget of the corresponding tabs
and holds the tab identifier in order to support
that.
Implement QtBuilder::applyTabChildProperties
to set the tab label and ID property by using
the newly introduced QtInstanceNotebook::setTabIdAndLabel,
so only QtInstanceNotebook needs to handle that
property.
The weld::Container* returned by QtInstanceNotebook::get_page
is owned by QtInstanceNotebook, so keep create one
on demand and keep a mapping between tab pages and
the corresponding weld::Container.
In QtInstanceNotebook::insert_page, create a new
widget and set a QVBoxLayout for now. That could
be changed to use a different QLayout class in the
future if that turns out to be more useful.
In QtBuilder::makeObject, as the tab pages are children
of the "GtkNotebook" in the .ui file, they are initially
created as child widgets of the QTabWidget.
However, they need to be set via QTabWidget::setTab instead,
so add special handling for that case towards the end and
unset the parent relationship and call that method.
Change-Id: I52e11ecf053a48940b88b7e6d1e6f9ba8778d9bb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176353
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
|
|
During native dictation, waiting for the next native event is
blocked while dictation runs in a loop within a native callback.
Because of this, LibreOffice's painting timers won't fire until
dictation is cancelled or the user pauses speaking. So, force
any pending timers to fire after the marked text changes.
Also, remove the fix for OpenOffice bug 106901 as causes any
key down events to cancel dictation and removing the fix does
not appear to cause the original crashing bug to reoccur.
Note: inserting a character from the system Character Viewer
window causes dictation to stop responding and the only way
I have found to restart dictation is by toggling dictation off
and then back on again. This same behavior occurs in Apple's
TextEdit application so this appears to be a macOS bug.
Change-Id: Iad2b54870ff1a315f2f71d72bef24af3cea808e6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176100
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
Reviewed-by: Patrick Luby <guibomacdev@gmail.com>
|
|
Add a new QtInstanceNotebook class that is the
weld::Notebook implementation using a native
Qt widget. It uses a QTabWidget.
Initially, all methods trigger an assert;
the actual logic still needs to be implemented
in future commits.
Let QtBuilder handle "GtkNotebook" objects by
creating a QTabWidget and let
QtInstanceBuilder::weld_notebook return
an instance of the new class.
Change-Id: I5a0671a1ba98bea3e0659e4f280706179bfb4d47
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176322
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
|
|
Split the existing VclBuilder::handleTabChild into two
methods and make the logic not specific to vcl::Window
available to other subclasses as well, to make it
available for reuse by QtBuilder in the future.
In order to do that, move the existing XML parsing logic
from the beginning of VclBuilder::handleTabChild to the base
class into WidgetBuilder::handleTabChild.
Add a new purely virtual method `applyTabChildProperties`
to WidgetBuilder and move the corresponding logic for
vcl::Window to the new VclBuilder override of this method.
Call that method at the end of WidgetBuilder::handleTabChild.
For QtBuilder, just add a dummy implementation that
triggers an assert initially, which matches what
would have happened right at the beginning
of the previous WidgetBuilder::handleTabChild
implementation without this commit in place.
Change-Id: Ie5664bd341182fa51035b547accf9393d65a0702
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176320
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
|
|
In VclBuilder::handleTabChild, move casting the vcl::Window to
TabControl further down to avoid vcl::Window specific code in
the XML parsing logic.
Introduce a new purely virtual helper method
WidgetBuilder::isHorizontalTabControl,
implement for VclBuilder and QtBuilder and
use that in the XML parsing logic instead
of directly checking whether the parent is
a TabControl widget.
This gets rid of one detail specific to the VCL
implementation in the XML parsing part and is in
preparation of further refactoring of
VclBuilder::handleTabChild for reuse with QtBuilder.
Change-Id: I05c637f81bce4a5cdd443960a1ad096c347df560
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176319
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
|
|
Add a new QtInstanceTreeView class that is the
weld::TreeView implementation using a native
Qt widget. It uses a QTreeView.
Initially, all methods trigger an assert;
the actual logic still needs to be implemented
in future commits.
Let QtBuilder handle "GtkTreeView" objects by
creating a QTreeView.
Let QtInstanceBuilder::weld_treeview return
an instance of the new class.
Change-Id: Ia3e694dbef9033fe45a6d2bdbe09fc021cd47c58
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176307
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
|
|
Set QtInstanceWindow as an event filter for it's
QWidget, and call `signal_container_focus_changed`
when receiving a QEvent::WindowActivate or QEvent::WindowDeactivate
event.
This code path got triggered as expected in a
quick test switching between e.g. the "Help" -> "About"
dialog and other windows in KDE Plasma using the Alt+Tab
shortcut.
The VCL implementation does something similar by
handling VclEventId::WindowActivate and
VclEventId::WindowDeactivate events, see
SalInstanceContainer::HandleEventListener.
For non-top-level containers, a different solution
will probably be needed.
For now, adjust the assert in
QtInstanceContainer::connect_container_focus_changed
to only trigger for non-QtInstanceWindow containers.
And call the base class implementation, so that the
handler is actually set for the QtInstanceWindow
case.
A potential solution for QtInstanceContainer
might be to connect to the QApplication::focusChanged
signal in QtInstanceContainer::connect_container_focus_changed
and in the slot check whether exactly one of the old and
new focus widgets has the container's widget in
hierarchy.
Change-Id: I945c8bf0999d93ae91cf25dcffd3fd3ce164d214
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176302
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
|