This commit re-implements the critical notification to be inside the
notification popup, not the notification item. This yields several
benefits:
- It's the semantically correct place to implement it since critical
notifications don't appear in the history, so there's no reason to
implement it in a component that's re-used for the history view
- The line extends down to the bottom for critical notifications that
have buttons, job progress, text input fields, files, or screenshots
- Simpler code overall
This reverts commit be7efa5ec2.
This reverts commit 93355636de.
This was not the best way to implement the feature, as it failed to take
into account the fact that critical notifications can have more content
than just text. A better place to implement it would be in the popup
itself.
We still get user complaints that this UI is confusing because of the
terminology used and the visual proximity between the checkbox and the
inhibitions list. This commit attempts to improve that by:
- Make the checkbox text shorter, have less jargon, and say the word
"manual" in it instead of "automatic", which was confusing
- Adding the word "currently" to app-initiated inhibitions, to textually
distinguish transient app-initiated inhibitions from user-initiated
manual inhibition
- Separating the checkbox from the inhibitions list with a subtle line
separator
We can leverage the `priority` property of QActions, which is Normal (128)
by default, and hide it from systray header if the priority is set to
LowPriority (0).
BUG: 446396
GridLayout no longer crashes was described in an old comment and
nowadays is pretty safe to use. Repeater, however, still doesn't
support instantiating multiple top-level items at once, which is
unfortunate but can be worked around; see upstream Qt bug below.
In this case, however, simple is better than smart-ish; the entire
at-most-two-rows table-like grid can be recreated entirely without
Repeaters and clever models. Just do it.
See also: QTBUG-38098
Prevent `TextArea` in SelectableLabel from accepting wheel
events when the notification item is in FullRepresentation,
and pass wheel events to `ListView` in FullRepresentation when the
cursor is over the `TextArea`.
BUG: 443840
FIXED-IN: 5.24
1. placeholderMessage and fallbackIconItem are put in the same Loader and
loaded on demand, and they share the same icon property.
2. When getting "Desktop Icon Name", check if `mpris2Source.currentData` is
available first.
3. Hide the details column when no track is available.
BUG: 444322
BUG: 446095
FIXED-IN: 5.24
When no media player is opened and there is a media player applet on the
desktop, `mpris2Source.currentData` is undefined and plasmashell will
report some TypeErrors.
BUG: 446096
FIXED-IN: 5.24
Qt's foreach is deprecated and should be replaced with modern C++
range-for loops. Const qualifiers are added to variable declarations
and wrapper in std::as_const as required to prevent unnecessary
clones/detach.
Qt's foreach is deprecated and should be replaced with modern C++
range-for loops. Const qualifiers are added to variable declarations
and wrapper in std::as_const as required to prevent unnecessary
clones/detach.
And factored out some duplicated code on the way.
However weird that title might sound, a lowercase `component A : B`
syntax allows us internalize any property, and even make it required
for an instantiator to provide. This no longer relies on implicit
scoping of QML.
GIT_SILENT
This is still borken as hell, because x/y were not supposed to work
inside Row/Column anyway.
PlasmaCore.Units.largeSpacing is inconsistent with Kirigami, and
actually equals to gridUnit, and 4 times as big as smallSpacing. So,
the proper replacement for a `largeSpacing / 2` (which also properly
takes care of rounding to an integer) is `smallSpacing * 2`. And the
largeSpacing itself shall be replaced with gridUnit to avoid confusion.
GIT_SILENT
Optimize previous patch that introduced extra margins for the battery's
progress bar in order to make its labels visually match the distance of
brightness sliders on top of it.
This patch moves `referenceSlider` property to the root component of
BatteryItem.qml, so that an existing item can be passed from the
outside. It keeps the default value there just in case, but it won't be
instantiated by QML engine when the property is overriden at component
declaration. (Note: this won't be true if the slider had an id set.)
Since we are defining some properties on the top-level component, we
might as well move the `extraMargin` here, so that the actual
ProgressBar component now won't have any properties on its own, and
thus QML engine won't create an extra runtime QML type just for it.
Add vertical margins to the battery progress bar, so that the distance
between colored bar and labels on top of it is the same as for the
sliders. This patch bases on assumption that sliders are always thicker
than progress bars, but guards against surprises by clamping from 0.
This also means that custom spacing of the parent ColumnLayout is no
longer needed, as it has only two children, and the equivalent Column
in BrightnessItem also has spacing set to zero.
This is done because QtQuick.Layout types are more convenient to work
with, and to avoid `with: parent.width` kind of boilerplate.
Nested RowLayout does not need Layout.fillWidth property, as that is the
default behavior for nested layout types.
GIT_SILENT
Due to async nature of QDBusPendingReply, services could be already
registered by QDBusServiceWatcher when the pending reply takes a long
time to finish, so it's possible that QDBusServiceWatcher::serviceRegistered
signal is emitted before the pending reply emits QDBusPendingCallWatcher::finished,
which will make the same service added twice and crash plasmashell.
We need to check if a service is already added in m_sniServices before
processing registered items in QDBusReply.
BUG: 443961