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>
Now that "GtkExpander" support has been implemented,
declare support for the "Safe Mode" dialog that can
be triggered via "Help" -> "Restart in Safe Mode"
and confirming with "Restart".
This means that native Qt widgets are used for that dialog
now when using the qt5 or qt6 VCL plugin and starting LO with
environment variable SAL_VCL_QT_USE_WELDED_WIDGETS=1 set.
Change-Id: I67ef04356a5147c24442cd3ec84e4bbc644b3a71
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177196
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Switch the order in which the children of the grid in the
.ui file are defined so that the order matches the visual appearance,
which makes sure that tab focus order with the Qt-based VCL plugins is
correct as well in that dialog when using native Qt widgets after
support for that dialog was added in
Change-Id: If30736e70172c6b25feee0072c952274754aa81e
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Sun Nov 24 00:22:26 2024 +0100
tdf#130857 qt weld: Support "Document in Use" dialog
See
commit 02692566ad
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Thu Oct 24 17:43:35 2024 +0200
tdf#130857 optnewdictionarydialog.ui: Define focusable widgets in order
for more background.
Change-Id: Ie18c7b91911fea612167510e9bb098d63e1e9227
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177195
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
Declare support for the dialog shown when trying to
open a file that's already opened by another user
(or more exactly, for which a lock file suggesting
that it's opened by another user or LO instance
exists).
This means that native Qt widgets are used for that dialog
now when using the qt5 or qt6 VCL plugin and starting LO with
environment variable SAL_VCL_QT_USE_WELDED_WIDGETS=1 set.
This is the first supported dialog making use of "GtkNotebook"/
QtInstanceNotebook, i.e. of what was implemented in previous commit
Sample steps to see that dialog:
* start Writer, save document as /tmp/test.odt
* kill LibreOffice
* open the lock file ( /tmp/.~lock.test.odt# ) in a text
editor and change the user name to a dummy one, save.
* start LO with qt6 VCL plugin and try to open the document
Change-Id: If30736e70172c6b25feee0072c952274754aa81e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177194
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>
mimetype must not be zipped, just stored.
mimetype was correctly stored with the first zip command,
but mimetype was also present in the files list on the second zip command.
This patch remove mimetype from the files list of the second zip command.
Change-Id: Ie66f06103bbad2700eee4986df878b9ebd4c0a09
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175930
Tested-by: Jenkins
Reviewed-by: Laurent Balland <laurent.balland@mailo.fr>
So the setting fetched at ctor time for UserInstallation (and
BRAND_BASE_DIR) may no longer be true, so expanding variables based
on those earlier seen values results in unwanted paths.
add XInitialization to SubstitutePathVariables (like done for
PathSettings) to allow reiniting these explicitly once.
Change-Id: Ia930ea71cb09adc91d6d47ee047c44b24222e8a2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175961
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 410f6b50eb44276b1d2095c844244ef4d0ddefaa)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177109
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
On macOS, flushing with Skia/Metal is noticeably slower than
with Skia/Raster. So lower the flush timer priority to
TaskPriority::POST_PAINT so that the flush timer runs less
frequently but each pass copies a more up-to-date offscreen
surface.
Unfortunately, lowering the priority causes tdf#163734 to reoccur.
When a dockable window is dragged by its titlebar, a rectangle
may be drawn in its parent window. However, the Skia flush
timer doesn't run until after the mouse button has been
released (probably due to lowering of the Skia flush timer's
priority to fix tdf#163734). So run the parent frame's Skia
flush timer immediately to display the rectangle.
Change-Id: I289eab85a087cb76a751dc6b777342b8dee49e1c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177190
Reviewed-by: Patrick Luby <guibomacdev@gmail.com>
Tested-by: Jenkins
... which is also used in queryAlternativeSpelling
Change-Id: I7f0bbbc6e598d56156efe1446f422f9674ed6f25
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177187
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This reverts commit 16a5ae7c90.
It seems to break public API.
Change-Id: I0ef2c6e975b4cf20b9894ddf33f36444e2230ca4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177168
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
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
This allows the layer objects overlay to not be done when the value set
for DisableLayerHighlighting is less than the number of objects in the
layer of the tab which the mouse is hovered over in the layer bar.
Change-Id: Ie49ecb11bfb029ada57824c0acbbd133e1fe83b2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176809
Reviewed-by: Jim Raykowski <raykowj@gmail.com>
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
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
If QtInstanceNotebook::get_page gets called with
and ID that none of the existing pages actually have,
return nullptr early and don't try to QtInstanceContainer
instance for the null widget, which would trigger an
assert when nullptr is passed to the QtInstanceWidget
base class ctor.
Calling QtInstanceNotebook::get_page with an ID for
which no page exists yet is what
SfxTabDialogController::AddTabPage does explicitly
before asserting a page to assert that there isn't
such a page yet.
SalInstanceNotebook::get_page and GtkInstanceNotebook
also have specific handling for that case.
Change-Id: Ib2044fd4c9f986f2252afed5754a6383f940e5e6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177055
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins