Previously it was basing its height on an icon size, which does not
scale with the font. As a result, sometimes the actions list could
get clipped when using certian fonts and font sizes. Let's change this
to multiples of GridUnit, which adjusts with the font.
This allows DaysCalendar to take advantage of the work in the previous commits
removing hover animations on PC3 components, and is generally good for modernisation
anyways.
For some reason, we weren't putting plasmoid loading errors into the console, which interfered with debuggability of errors. Dumping them is useful for debugging.
It imported Kirigami to check whether we are on mobile.
Kirigami::Settings::isMobile checks whether QT_QUICK_CONTROLS_MOBILE is set.
QtQuickControlsSettings always returns true on various mobile platforms (Q_OS_IOS,
Q_OS_ANDROID, Q_OS_BLACKBERRY, Q_OS_QNX and Q_OS_WINRT) or checks
QT_QUICK_CONTROLS_MOBILE.
`MenuItem` does not delete other people's `QAction` but it does not take kindly
to the `QAction` being deleted under it. As a workaround recreate a dummy action
when ours gets destroyed.
This crash can easily be triggered by opening the Media Controller applet and
quickly right-clicking its icon to open the context menu. Media Controller recreates
its actions in `contextualActionsAboutToShow`, which removes and deletes them.
Then the `Instantiator` in System Tray's `ExpandedRepresentation` updates its `model`,
deleting the delegate items (`MenuItem` instances) it created. This prompts the `Menu`
to run `removeMenuItem` on the now removed `MenuItem`, accessing its backing `action()`
to remove it from the menu, resulting in a crash as it was deleted earlier.
create the pixmap texture of icons just as big as icon's actualsize
for that given size, not having unneeded padding around.
It also makes plaintedWidth/paintedHeight return actually sensible
values
Qt 5.14 introduced new syntax for defining Connections. Fix warnings like this one:
QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
Currently in buttons and tabs the mnemonics were shown, but never
actually attached to do anything.
This copies code from QQC2-desktop-style and creates an explicit
shortcut.
Plasma::Svg is used in from the render thread in updatePaintNode of
various Plasma::*Item classes.
At this point the GUI thread is blocked, so it's probably safe, but it's
still spamming the log file like crazy.
TabGroup had a feature where if the item inserted in the stack was a
PlasmaComponents.Page it would update a property.
The check that this property exists was previously bogus leading to
errors if TabGroup was used with non-Page items that happened to have
the same property, such as Loader
In commit c709076d9c the SVG got somehow
broken leading to black rectangles in all cases where it was used.
This commit reverts to the last working version, then reapplies the
"thick margin" from the change.
A test is supplied to show all our frameSVGs to hopefully make this
easier to spot if it happens again.
BUG: 430390
As it turns out, QString::number() is quite expensive, especially when
using it in a code path that is called a lot of times. So instead, use a
struct with a custom hash method as cache ID. This is significantly
faster since we do not need to do memory allocations or string
conversions.
Applets are destroyed every time we close plasma as well as user
actions.
We only want to remove the shortcut from the registry from when an
applet is actually removed.
The end-user impact was limited as when we restart plasma we re-register
and plasma keeps it's own cache of what the shortcut should be so it
doesn't matter that kglobalaccel lost it's version.
The problem is that it means we send bogus calls to kglobalaccel after
kglobalaccel is potentially closed.
Testing done:
- set a shortcut on an applet
- confirmed it still worked after plasma restart
- removed an applet (and closed notificaiton so it wasn't in the
transient state)
- confirmed the entry was gone from system settings and the global
shortcut no-opped.
The concept of a disabled contextual item is nonsensical;
the set of context-sensitive actions is always supposed to be responsive
to the context. Accordingly, if the calling code has marked any actions
as disabled, let's hide them entirely.
We can't remove them from the model because they might become re-enabled
at a time when the calling app sees fit (perhaps the context has
changed). So instead we have to set visible to false and height to 0, to
ensure that the listview has the correct height. This is a hack, but I
don't see a better way to do it.
The memory penalty to having invisible but created items should be
negligible since there are only ever a maximum of about 3 items in here.
make possible to write containmentDisplayHintsChanged from
ContainmentInterface QML
when containmentDisplayHintsChanged, the containment forwards to
all its applets
Add a Page-derived component intended as a root
for full representations.
It may go over the plasmoid edges (both on desktop and popups)
with the properties applyHorizontalPadding and applyVerticalPadding.
When the contentItem is a ScrollView or a Scrollarea,
the plasmoid margins will be automatically removed.