Qt6 insists on that. We can do this either by including the moc files,
or by including the corresponding headers in the header defining the
properties, the former seems cleaner.
That's in a plugin we don't link against here, we only see its header.
This happens to work with Qt5, but Qt6 wants fully defined types for
properties. Use a QAbstractItemModel pointer instead, we only access that
API anyway, and for QML the difference doesn't matter.
Discover current minimum height of applet labels in hidden
view and apply it for all of them when they are shown
inside hidden applets view. This implementation provides
always only the maximum needed label height based on label
contents.
BUG: 438347
FIXED-IN: 5.24.3
The prefered is to show context menu on mouse pressed event, not click,
but this causes few issues for SNI.
Some legacy applications still relies on XEmbed to show tray icon.
We use xembedsniproxy to relay the mouse press signals to the XEmbed client
but some applications (including GTK) validate the mouse state.
Mouse released state is expected, but as it is still pressed context
menu does not show.
BUG: 409768
FIXED-IN: 5.24.3
Unlike when the clock is in a panel, there is plenty of space when it is
on the desktop. This means that we can safely let the date string word
wrap rather than shrink.
BUG: 450632
FIXED-IN: 5.24.3
1. Don't change the current item when not saving it.
2. Use Qt.callLater as the item will be moved to the top after saving
it, and we would like to hightlight the real first item.
With the keyboard navigation patch there is the issue that sometimes,
due to sorting by SortFilterModel, the stack order of the items doesn't
correspond to the visual order of the items.
This is a problem wrt the recently introduced keyboard navigation, as
the tab order of items in qml is completely tied to the stack order,
resulting in an erratic tab navigation order (usually happens with
device notifier or bluetooth applets for instance)
Get rid of the delayed optimal size calculation caused by Qt.callLater
and calculate optimal size immediately when an applet's size changes.
This removes the unnecessary jumping of applets that are centered between 2
spacers.
BUG: 431668
FIXED-IN: 5.24.2
Kernel developers have said that charge limits are approximate, not
exact[1]. As a result, if for example you have a charge limit of 80%,
your battery might actually stop charging anywhere between 78-82%. But
if we only list the charge limit itself, it looks to users like a KDE
bug when the battery stops charging at any number other than that limit.
To alleviate that, this commit adjusts the text to indicate that the
charge limit is appropximate.
[1] https://bugzilla.kernel.org/show_bug.cgi?id=215531#c3
When we are using a charge threshold, the kernel may stop charging
within a percentage point of the actual threshold and this is
considered correct behavior, so we have to handle that. See
https://bugzilla.kernel.org/show_bug.cgi?id=215531.
Also, Upower may give us a status of "Not charging" rather than
"Fully charged", so we need to account for that as well. See
https://gitlab.freedesktop.org/upower/upower/-/issues/142.
BUG: 435931
StatusNotifierItem.qml does not explicitly handle the case of
right-clicking, which causes right-clicks to be ignored unless you also
happen to have the libappindicator package installed, which injects a
handler for this itself. But this should work even if you don't have
that package installed; this commit fixes it.
BUG: 449870
FIXED-IN: 5.24.1
Sad that we still need to do this because the patch to fix that bug
never got merged because it failed to adjust a failing test, and has
bitrotted in the two years since then.
BUG: 448387
FIXED-IN: 5.24.1
If we have multiple sources for the application, we end up with multiple entries.
This is not useful in any scenario, because the generated appstream URL
is exactly the same.
Consequently we should return from the function when we created the first action.
BUG: 448564
All the sizing and positioning code in this SvgItem relies on assumption
that plasmoid's location would we strictly either one of four edge
types. So this patch ensures that this thin separator line is only
visible when this assumption is true. Otherwise its both width and
height get reset (by binding `undefined`), and SVG starts filling up
the whole available area, which leads to a visual glitch that looks
like a as grayed out or faded applet.
See also: https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/576
BUG: 449535
The MouseArea in AbstractItem needs to be above applets
when it's in the grid hidden area so that it can receive
hover events while the mouse is over an applet
But when the applet is shown as an icon on the regular
systray it needs to be below so the PlasmoidItem `onClick`
takes precedence and systray collapsing works.
BUG: 449533
FIXED-IN: 5.24
Allow the Panel to get active keyboard focus via a kwyboard shortcut which will cycle between all panels.
When a panel has focus, the active focus can be navigated around either with tab/backtab or arrow keys.
Simple popup applets which only display an icon will work automatically,
Complex applets like the System tray or the taskbar will have focus that can navigate on all their sub-elements, to activate a particular systray applet or activate a particular window
Co-authored with Benjamin Port<benjamin.port@enioka.com>
CCBUG: 352476
Applets in PlasmoidItem were blocking events from reaching the
ToolTipArea, so I moved the on hover logic to the AbstractItem's
MouseArea and put the MouseArea over the iconContainer. The
iconContainer is the parent of applets. Presses tend to hit the center,
which is where the applet is, preventing ToolTipArea::containsMouse from
being true and preventing the highlight from moving to the pressed item.
Hopefully this doesn't cause duplicate actions when events reach the
applet. I tested the patch on the nightcolor applet and all the other
default applets and didn't see anything wrong. I think this may be
because the signals are sending QML MouseEvents to the applets, causing
them to be accepted if the applet can accept them. Then when the signal
handlers are done, since the events are already accepted, they should
not move beyond the MouseArea and cause another round of event handling.
This empty mousearea serves for the sole purpose of refusing touch events
which otherwise are eaten by Control stealing the event from any of its parents
this fixes applet dragging in editmode for all systemmonitor plasmoids
Over the years we've changed icon spacing many times. And every time we
do, we get bug reports about it from people who were happier with the
previous value. Typically we close these bug reports as RESOLVED
INTENTIONAL, but it always leaves a sour taste in the mouth. People's
preferences for spacings and paddings are legitimate.
In addition, a larger spacing can be quite useful in Tablet Mode, to
increase the size of the touch targets to be closer to the size of the
user's finger.
This commit adds a simple UI to switch the spacings of the visible items
between three values, with the middle one that matches the current
spacing being the default. While Tablet Mode is activated, the spacing is
automatically set to its highest value and made non-user-adjustable,
just like we already do this for the icon size setting.
Applets were apparently blindly converted to use JSON metadata without
checking the usage. At least KPackage now has a direct getter for the
package metadata, so use that to get the plugin ID instead of manually
loading the package metadata.
BUG: 448529