Commit graph

362 commits

Author SHA1 Message Date
Ivailo Monev
11af5c085c plasma: optimize devicenotifier applet
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-17 19:00:26 +03:00
Ivailo Monev
1f6b7fe4dc plasma: optimize notifications applet
raw member access, baby!

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-17 18:34:28 +03:00
Ivailo Monev
b6e3890d01 plasma: keep the notifications popup shown for as long as there is data comming from the data engine
plus the 3 seconds timeout after which the popup will hide automatically

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-17 15:31:02 +03:00
Ivailo Monev
864f0bdbd9 plasma: show jobs progress conditionally and implement open action for notifications
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-17 14:51:41 +03:00
Ivailo Monev
a75171a377 plasma: setup the notifications applet as passive popup
because it automatically shows up on new notification signal

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-17 13:56:35 +03:00
Ivailo Monev
23410fd729 plasma: tweak the fonts and use single label in the jobs notifications widget
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-17 13:45:48 +03:00
Ivailo Monev
de6a55234b plasma: hack to limit the notifications applet size to 2-times less than that of the desktop for panels
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-17 13:02:05 +03:00
Ivailo Monev
4328f6c726 plasma: automatically show the notifications applet popup and switch the tab on new notification
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-17 11:57:36 +03:00
Ivailo Monev
da94852b8f plasma: enable the notifications remove button for jobs based on job state
because not all jobs emit percentage

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-17 10:43:06 +03:00
Ivailo Monev
87c78653e2 plasma: implement jobs notification for notifications applet
no job control (suspend and kill), only info (source, destination and
progress)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-17 10:28:33 +03:00
Ivailo Monev
abcd9042b0 plasma: complete the notifications applet application notifications widget
complete as in fully functional

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-17 09:13:47 +03:00
Ivailo Monev
f4d40c28e9 plasma: semi-working notifications applet reimplementation
the application notifications works and is nearly complete, the jobs
notification is yet to be done. so far it looks like this:
https://ibb.co/GTGMKtQ

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-17 07:50:27 +03:00
Ivailo Monev
5ce20a5331 plasma: center the lockout applet dialog
much like the ksmserver shutdown dialog

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-16 14:22:37 +03:00
Ivailo Monev
df437902d7 plasma: rename the devicenotifier m_title member and expand the widget
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-16 07:38:11 +03:00
Ivailo Monev
24f740c7c4 plasma: use proper casing for the DeviceNotifierWidget message
might aswell correct it after the reimplementation

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-16 07:20:42 +03:00
Ivailo Monev
524c6b376b plasma: cache the QSizeF object in LockoutDialog destructor
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-16 07:06:48 +03:00
Ivailo Monev
8f66e007cc plasma: use the vertical spacing for the maximum row height in lockout applet
it is the same as the horizontal spacing tho

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-16 07:05:35 +03:00
Ivailo Monev
7fe699fb54 plasma: rename constant in devicenotifier source file
no longer used for preferred and minimum size

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-16 06:57:03 +03:00
Ivailo Monev
44acb0cbf9 plasma: do not even set preferred size for batterymonitor and devicenotifier applets
once set the hint has to be updated on form factor switch (e.g. when the
applet is moved from the desktop to panel or vice-versa)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-16 06:49:42 +03:00
Ivailo Monev
f710a828f3 plasma: ensure the lockout dialog icon is always the same size
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-15 18:52:51 +03:00
Ivailo Monev
e76fb4ff91 plasma: ensure the scroll area of devicenotifier applet does not shrink bellow the preferred size
because when to show the popup icon instead of the widget and when not is
decided by the minimum of the widget and Plasma::ScrollWidget is adjustable
(shrinks if minimum size is not set)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-15 17:03:15 +03:00
Ivailo Monev
32438a2240 plasma: remove declaration of non-existing LockoutApplet::updateWidgets() method
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-15 15:54:26 +03:00
Ivailo Monev
d186170e48 plasma: disable selective batterymonitor applet layout update when device is added
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-15 15:16:19 +03:00
Ivailo Monev
e695a67ae9 plasma: simplify batterymonitor and devicenotifier size hints management
by getting the preferred size hint from the actual applet widget and
returning the result of Plasma::PopupApplet::sizeHint() otherwise (both
Plasma::PopupApplet::sizeHint() and Plasma::applet::sizeHint() do hints
trickery based on form factor and such) a lot of assumptions other bits
make are fullfilled

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-15 13:22:15 +03:00
Ivailo Monev
fb077bf0d5 plasma: lock when checking the free space in devicenotifier applet
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-15 11:36:58 +03:00
Ivailo Monev
2dc2d685d3 plasma: set minimum and preferred devicenotifier applet sizes based on form factor
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-15 06:50:46 +03:00
Ivailo Monev
1dc79c3ddf plasma: lock while updating devicenotifier applet layout
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-15 04:16:02 +03:00
Ivailo Monev
66c9071a02 plasma: update batterymonitor applet layout only on when battery device is added or removed
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-15 04:00:56 +03:00
Ivailo Monev
47ef483381 plasma: remove unused and private Label member
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-14 18:34:07 +03:00
Ivailo Monev
8bcbea0391 plasma: remove duplicate qgraphicssceneevent header inclusion
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-14 18:32:48 +03:00
Ivailo Monev
27bf4c46cc plasma: merge plasmaextracomponents declarative imports into plasmacomponents
the FallbackComponent type is unused

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-14 16:01:02 +03:00
Ivailo Monev
8e96ce1aa8 plasma: tweak lockout applet dialog sizes
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-14 10:53:25 +03:00
Ivailo Monev
43894f8f20 plasma: use bigger font for panels in keyboard applet
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-14 10:36:27 +03:00
Ivailo Monev
cb33b2cf11 plasma: delete the lockout applet dialog event loop via event
because it is executed and stopped from an event while it is running

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-14 07:48:57 +03:00
Ivailo Monev
f2319df5ee plasma: delay the lockout action by 500ms
with the dialog animation in place (which was not a thing in the old
implementation) the action may be triggered before the dialog has finished
the animation (because it is async, e.g. D-Bus call on interface which
involves event loop) and (for example) locking the screen when the dialog
has not dissapeared yet making the animate complete once the screen is
unlocked. to make the transition smooth delaying it by a little is a must

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-14 07:25:02 +03:00
Ivailo Monev
3147f9515e plasma: animate the lockout applet dialog
ksmserver uses entirely different effect tho (which is triggered by a
button essentially calling ksmserver method) - the entire screen is
darkened when the ksmserver dialog appears (kwin effect)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-14 06:54:26 +03:00
Ivailo Monev
79accd51c6 plasma: disable mouse events for the icon of the lockout applet dialog
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-14 06:38:33 +03:00
Ivailo Monev
0305b44785 plasma: perfect size for lockout applet
small for desktop applet but suitable for any theme and any form factor
(desktop-like, panel, etc.)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-13 18:23:37 +03:00
Ivailo Monev
d09ad5f07e plasma: set the preferred lockout dialog icon size to small one
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-13 16:19:29 +03:00
Ivailo Monev
71c809af91 plasma: pass correct type to Plasma::IconWidget::setPreferredIconSize() in batterymonitor applet
implicit conversion..

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-13 15:40:46 +03:00
Ivailo Monev
33c98fb7df plasma: setup keyboard shortcuts for the lockout applet dialog buttons
same as the shortcuts of KStandardGuiItem

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-13 12:28:30 +03:00
Ivailo Monev
5eee1b4852 plasma: remove unused LockoutDialog member
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-13 06:41:30 +03:00
Ivailo Monev
048b675ae1 plasma: force update of the lockout dialog icon
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-13 05:10:13 +03:00
Ivailo Monev
3da6a08beb plasma: trigger the lockout dialog button actions on button release
kinda like the logout dialog

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-13 05:06:02 +03:00
Ivailo Monev
53203e2b62 plasma: set the focus to the yes button each time the lockout dialog is executed
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-13 05:02:52 +03:00
Ivailo Monev
6eda258de3 plasma: disallow disabling all lockout applet buttons
another feature the old implementation did not had

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-13 04:51:47 +03:00
Ivailo Monev
4351cd3c7c plasma: simplify lockout size expanding, update sizes conditionally
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-13 04:06:44 +03:00
Ivailo Monev
62111cfb4f plasma: rename lockout applet constant to match its meaning
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-13 03:32:13 +03:00
Ivailo Monev
664f9f2bad plasma: update lockout applet sizes when updating the buttons state
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-13 03:25:41 +03:00
Ivailo Monev
30f02b9357 plasma: interrupt the event loop on LockoutDialog hide
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-13 03:05:15 +03:00