Now that previous commits have implemented what's
needed to display the dialog and for button clicks
to result in the expected action, add the .ui file
for the "Help" -> "License Information" dialog to the
list of supported .ui files for QtInstanceBuilder, so
native Qt widgets will be used for that one with
the Qt-based VCL plugins unless starting LO with
the SAL_VCL_QT_NO_WELDED_WIDGETS environment variable set.
Change-Id: I8a2dff1c751739567a3c9c0728e3357859069a9b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174080
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
For QDialogs (created for "GtkDialog" objects in .ui files)
that have a button box, let clicking any of the buttons
that have a response code set close the dialog with
that response code by connecting to the
QAbstractButton::clicked signal.
This addresses the remaining aspect for the
"Help" -> "License Information" dialog
mentioned in earlier commit
Change-Id: Ic9393755ec474f77ff22a1115e3cccba9d7b26cb
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Sat Sep 28 00:07:28 2024 +0200
tdf#130857 qt weld: Add initial support for dialog and label
> However, currently (...) clicking the buttons doesn't yet have any
> effect.
Actually using Qt(InstanceBuilder) for that dialog
will be enabled in an upcoming commit.
Change-Id: Ie3c26963318fd5832688e3ed73f6952e09da4bb7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174079
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
It will be used for QDialog as well, not just QMessageBox
Change-Id: I887b3fe45beea40cc92f2b0b77f316ad73d7f922
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174078
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
For QDialog, make sure that if a button box is included in
the dialog's layout, that this is the last item in the layout,
by removing from the layout and adding it at the end again.
I don't see any explicit child index explicitly being set in
the .ui file for the "Help" -> "License Information" dialog
("sfx/ui/licensedialog.ui").
Potentially GTK implicitly visually makes the dialog's
button box the last item in the dialog.
Corresponding child is this one:
<child internal-child="action_area">
<object class="GtkButtonBox" id="dialog-action_area1">
Potentially the `<child internal-child="action_area">`
identifies this as the dialog's button box that should
be last, at least dialog newly created in glade
also has that set.
For QMessageBox, which is a QDialog subclass, this
special handling is not needed, as its default
button box is used, which is already at the right
place.
This addresses the first aspect mentioned in
previous commit:
Change-Id: Ic9393755ec474f77ff22a1115e3cccba9d7b26cb
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Sat Sep 28 00:07:28 2024 +0200
tdf#130857 qt weld: Add initial support for dialog and label
> However, currently buttons and the label with the text
> are in the wrong order (i.e. buttons are above the text)
Still missing:
> and clicking the buttons doesn't yet have any effect.
Change-Id: Id991551548c1e54fdf2e169886a6c67fc307931f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174077
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
Add initial support for the "GtkDialog" and "GtkLabel" objects
in .ui files by creating corresponding Qt widgets
(QDialog for "GtkDialog" and QLabel for "GtkLabel").
This makes the elements of the "Help" -> "License Information"
show up once the .ui file of that that dialog
("sfx/ui/licensedialog.ui") is added to the set of supported
.ui files.
However, currently buttons and the label with the text
are in the wrong order (i.e. buttons are above the text)
and clicking the buttons doesn't yet have any effect.
Those aspects will be addressed in separate commits
before actually claiming support for the dialog
in QtInstanceBuilder::IsUIFileSupported.
Change-Id: Ic9393755ec474f77ff22a1115e3cccba9d7b26cb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174076
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
Don't restrict to QMessageBox, but allow using the
method with any QDialog, and don't assert that
the dialog has a layout set in this case.
The method will be reused in an upcoming commit.
Change-Id: I1992f2eb4f34b25e487bbd349631b6ecd4365c95
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174075
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
When creating a QLayout, pass the parent widget
to the ctor as well, which makes the layout be
set for the widget. Quoting from the QVBoxLayout ctor doc [1]
> Constructs a new top-level vertical box with parent parent.
>
> The layout is set directly as the top-level layout for parent.
> There can be only one top-level layout for a widget. It is returned
> by QWidget::layout().
Also add widgets to their parent layout if the parent
is a QLayout, and not a QWidget.
This makes the items of the "Help" -> "License" dialog
actually be part of the dialog in a WIP branch
that has "QtInstanceBuilder::IsUIFileSupported" in
the set of supported files in QtInstanceBuilder::IsUIFileSupported.
[1] https://doc.qt.io/qt-6/qvboxlayout.html#QVBoxLayout-1
Change-Id: Ib823896a28520b6f7e1e89244239d3204d1d10e4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174072
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
In QtBuilder, ignore placeholders as encountered e.g. in
"sc/uiconfig/scalc/ui/checkwarningdialog.ui" (that's not
yet in the list of supported .ui files for QtInstanceBuilder
yet).
VclBuilder mostly ignores them as well, see
VclBuilder::makeObject.
Change-Id: I68481e31365561719af5e72ee20adb428b642941
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174071
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
With previous commit
Change-Id: Icaf712c956297dbc7a774bbd995d42eb8a63a1bb
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Fri Sep 27 11:06:55 2024 +0200
qt: Query screen on demand in QtFrame
in place, all relevant members are explicitly set
for the returned SalFrameGeometry in
QtFrame::GetUnmirroredGeometry, so there's no more
reason to start with a copy of `maGeometry` instead of
a default-constructed SalFrameGeometry.
Margins for decorations are never set for the Qt-based
VCL plugins (using methods like SalFrameGeometry::setLeftDecoration),
so the default of 0 is fine for all of these.
Change-Id: Ibed98c665e61a4ba06bf9087a159048417598798
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174035
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
Similar to how
Change-Id: Ifa0eff271c7d3fa2b6db9bdc1669e62333bd3094
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Thu Sep 26 18:22:12 2024 +0200
tdf#160837 qt: Rely on toolkit for frame positions, drop menubar hack
implements it for the frame/widget position and size,
also retrieve the current screen number by querying
the QWidget for it's current screen instead of doing
own bookkeeping of the current screen in SalFrame::maGeometry
by getting/setting it using `SalFrameGeometry::{getS,s}creen.
Only set it in the returend SalGeometry when
the current SalGeometry explicitly gets requested
by calling QtFrame::GetUnmirroredGeometry.
Change-Id: Icaf712c956297dbc7a774bbd995d42eb8a63a1bb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174034
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
Instead of setting the screen to the primary screen,
just ignore the request when QtFrame::SetScreenNumber
gets called with an invalid screen number.
The previous handling was introduced in
commit f806a2832a
Date: Mon Oct 22 16:35:21 2018 +0200
tdf#120451: Use primary screen if requested screen doesn't exist
to fix a crash, but just ignoring the request
avoids crashing, too.
(`git show --ignore-space-change` helps to see
the "actual" change more easily.)
Change-Id: I272ec64f89ef835161fa68c7fdc8cd0e407b7495
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174033
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
Don't explicitly pass a QScreen, but use the
current one. Both callers set the screen
just before calling the method.
Change-Id: I57b3ffc4341cabc0370dda3c26d85f2f63ec9292
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174032
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
The return value was dereferenced in all callers
anyway.
Change-Id: Ib91eddd23222d086f9a4edac980a05cd96c75ad7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174026
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Make `SalFrame::GetUnmirroredGeometry` overridable
(and let it return a copy of the SalFrameGeometry
instead of a const reference) and document that
subclasses can either make sure to keep the
`SalFrame::maGeometry` member (which is returned by
the default implementation of
`SalFrame::GetUnmirroredGeometry`) up to date or override
the latter in order to always return the current
geometry.
Override the method in `QtFrame` and fully rely on Qt
to report and set the position of the frame, via
the corresponding QWidget: Set the position, width
and height in the returned `SalFrameGeometry`
to the ones of the widget (factoring in the
scale factor).
Stop updating `maGeometry` size/position whenever
the widget position or size changes, as that is no
longer used anymore now that `GetUnmirroredGeometry`
is overriden.
This also allows to drop earlier hacks where
position calculation in some places had to be adjusted
by the height of the native menu bar, as that one
doesn't have a corresponding vcl::Window, but results
in everything else being shifted down a bit.
Using Qt directly to set other members of the
returned `SalFrameGeometry` (like the screen number)
would probably be possible, but is not included
in this change. (It can still be done separately
later.)
This makes Accerciser highlight the correct area
when using the qt6 VCL plugin and using Writer
with the standard interface (where the y position
reported via AT-SPI2 would previously always be
too small, missing the menu bar height) and thus
e.g. also allows to make use of it's "select object
under mouse" feature (s. tdf#160837).
The position via AT-SPI is however currently only
correct on X11/XWayland where global/screen coordinates
are reported via AT-SPI2.
Wayland, where window-relative coordinates are used,
still suffers from another issue that will be addressed
in a separate commit.
The highlighting in Accerciser is also still wrong
when a screen scaling factor other than 100% is set,
but that's broken for other applications (e.g. gtk3-demo)
just the same, so might be an issue in Accerciser instead.
I successfully tested that these behave as expected
when using the qt6 VCL plugin with this change in place:
* Combobox popup positions, with either 100% screen scaling
or a scaling factor of 150% or 200% on both, X11 and
Wayland.
* When enabling RTL mode via env var `SAL_RTL_ENABLED=1`,
RTL layout is used and things look OK at a quick glance.
* The following bugs (somewhat related to positioning and/or
the now dropped menu bar hacks) are still fixed, i.e. don't
reappear:
* tdf#149805 "kf5: Gap when expanding comboboxes in toolbar"
* tdf#151677 "tip on "formula bar" for "formula making" is
displaying over the formula itself."
* tdf#152217 "Black box in Basic IDE where the status bar
should be (kf5 only)"
* tdf#153458 "Connecting to database: wrong cursor position
for dropping data to Calc sheet"
* tdf#153800 "Calc sheet tab drag-and-drop target area has
shifted vertically (kf5-only)"
* tdf#154043 "Change object layer via drag and drop has target
shifted down (KF5-only)"
* tdf#154447 "Clicking a dropdown tool button shouldn't
place the context menu on top of the button (kf5)"
Unrelated to this commit, popup positioning and rendering in
in a multi-screen setup on Wayland with different scaling
factors set for the single screens is still broken (see
tdf#141578).
Change-Id: Ifa0eff271c7d3fa2b6db9bdc1669e62333bd3094
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173996
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
Call `GetUnmirroredGeometry()` instead of directly
using the `maGeometry` member in order to get the
current SalFrameGeometry.
This is in preparation of allowing to override
`SalFrame::GetUnmirroredGeometry` in subclasses in
an upcoming commit.
No change in behavior intended (yet).
Change-Id: I72b44052ba5e8ed61a1c54130ea088f1bb0b3941
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173995
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Replace some direct uses of SalFrame::maGeometry
in QtFrame with corresponding getters:
* SalFrame::GetUnmirroredGeometry() to get the
SalFrameGeometry
* the more specific SalFrame::GetWidth() and
SalFrame::GetHeight() where only the width/
height is of interest
No change in behavior intended yet.
Change-Id: I1b4e13c5efef7b78f082f6444e1e8d0ee591db41
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173994
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
as suggested by Android Studio.
Change-Id: Idbd71e7766d44374b4972362fb917f385b4fc5a5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174042
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
This patch draws a guide line while the user is dragging the comment sidebar edge, to provide a better feedback of the size that will be applied.
Thanks to Jim Raykowski for his comments and contributions. It should be noted that he authored much of this patch.
Change-Id: I08d4761a25c021c3ddda563a70fc0324000e4e62
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173017
Tested-by: Jenkins
Reviewed-by: Jim Raykowski <raykowj@gmail.com>
Reviewed-by: Rafael Lima <rafael.palma.lima@gmail.com>
The other problem here is that if hidden text isn't displayed,
SwLineLayout::CalcLine() doesn't ignore the hidden text portion when
calculating the line height.
This is apparently the case all the way back to OOo 3.3, but it doesn't
make much sense, so change the default to ignore hidden text here,
except if a pre-existing ODF document is imported.
Change-Id: Ief3f62bbdb6ac0ac79b54d6885a711128ad8d81f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174041
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>