keep internally a pointer (important that is *not* a smart pointer)
to the item the context has been created for.
on context deletion, remove the copy from the static bookeeping hash
this solves two related crashes: an infinite recursion
and a connection to a deleted object
Since some time PlasmaCore had the very useful ColorScope class,
which can semi-automatically make children take colors of the
View, Button or Complementary color groups.
Unfortunately it didn't support dynamic reparenting, giving
wrong colors in some cases (see black on black battery on the phone)
even tough is a bit complicated, now by cascading signals down the
children tree, support on the fly apply of the new context upon
reparenting.
also add a manual test case showing text, rectangles and icons
dynamically changing color as they get moved from one scope
to the other
REVIEW:126654
Change-Id: I3d746b73eac55a359c4706fb719b4d5018677fb5
Given with Qt high-dpi support manually adjusting the icon sizes to fit is mostly
obsolete because applications will do that nowadays - we should do the same.
REVIEW: 126641
Even when flat we should indicate that a ToolButton has focus.
This makes keyboard navigation substantially less awkward.
CHANGLOG: Improved visibility of keyboard focus on buttons
REVIEW: 126567
https://git.reviewboard.kde.org/r/126459/ introduced new
flag that allows to skip the grouping of notifications.
This should fix all bugs caused by checking for appName
being "plasma_workspace" which are all default notifications
from any plasmoid.
CCBUG: 356653
REVIEW: 126461
(this also needs to raise the KF5 dep to 5.18 which is
normally done at release time, but in order to use this
now, it needs to be bumped now, otherwise build failures
will ensue)
We receive the URL with all symlinks resolved, but internally the
pkgRoot kept unresolved symlinks preventing matches if there was a
symlink somewhere to get to the package.
REVIEW: 126562
It has a timer that wakes up every 2 seconds and drains my battery just
simply because I have debug builds. This make it on demand.
Don't track containments twice.
Containments inherit from Applets which also have the same line
Change-Id: Ia9a9b58a0b1197083d692c58e4ce75838c311db4
REVIEW: 126472
Self-hiding plasmoid is useful https://forum.kde.org/viewtopic.php?f=83&t=39501
for example, bluetooth plasmoid can be totally hided when there is NO bluetooth
adpater available.
PassiveStatus is NOT enough, because plasma-workspace's systemtray applet ONLY
hide the passive status plasmoid into ExpandedRepresentation. when click the
expanding triangle, the 'hidden' plasmoid is still visible.
So I added HiddenStatus and implemented it in the plasma-workspace systemtray
applet.
REVIEW: 126297
The timer was used to skip ahead of parsing and to compress prop
updates to handle width/height changes atomically. This achieves
both by moving pixmap load into the polish phase after those are
guaranteed to be done.
This fixes a bunch of flicker all over the place since 150ms is
obviously far beyond the frame time budget on 60 hz, but we can
usually easily fit into one frame on hot caches.
For some applets the status is bound to a complex expression that can be
re-evaluated a lot. This ends up causing a lot of unnecassary updates.
REVIEW: 126471
ContainmentPrivate::createApplet may return null pointer
(eg. when desktop is immutable), so check the pointer before
emitting appletCreated.
REVIEW: 126449
BUG: 356428
Plasma framework's FrameSVG class uses cached regions for efficiency. However
Coverity caught a mis-use of QCache in FrameSvg::mask(), which could lead to a
use-after-free situation. (CID 1291560)
Basically, any pointer passed into QCache::insert must be assumed to be deleted
after insert() has been called -- we can't then return that pointer to the
caller.
Moreover we were simply returning a pointer to calling code that had been (and
still would be) owned by QCache, which is unsafe as it can be deleted at any
time. The fix in both cases is to make a local copy of the QRegion from out of
the cache and return that.
REVIEW:126411
FIXED-IN:5.18
Should help in the future if there are similar problems like the recent
one when Plasma wouldn't load because it failed to load the ScriptEngine
and nobody knew why it fails to load.
plasma-scriptengine.desktop defines the property "X-Plasma-
ComponentTypes" as Type=QStringList. When reading it using
KPluginMetaData::value(..) it expects a QString back. This
used to work but regressed in kcoreaddons in commit
cfd18cf09b559a050fd6a2680ad4e71eeb950383.Making it read the
property as a stringlist works and is correct and also fixes
Plasma startup.
REVIEW: 126320
We were checking for Composite at compile-time but not at runtime causing a crash
when Composite has explicitly been disable in which case Damage might still be availab.e
REVIEW: 126296
the CompactApplet file from the shell package
defines the behavior of the poopup applets in
the panel (it implements an internal dialog
and all that jazz)
implementing a simplified systray(both the one
for the phone and a separate one for the desktop),
i noticed that a containment may have different
ideas on how to expand an applet: the systray would
have for instance a single popup dialog and put all
of its applet full representtions in the same Dialog,
this lets containment representation to override
that file (*if* won't get abused, that's the only
thing makes me a bit on the fence about this)
It would make possible also fairly different designs
that have been proposed in the past, such as the bug
sidebar similar to the "charm bar"
Have to keep an eye opened if having the file list
changing with the path may be an issue, but
shouldn't as ChangeableMainScript already does
something similar.
Change-Id: I1c7fda55d6829d3a67f511c91822b131dea85ac1
REVIEW:126244
It makes no sense and did nothing. This removes this option.
CHANGELOG: Dropping image files onto a panel will no longer offer to set them as wallpaper for the panel
REVIEW: 126159
since seems there are so many event filters installed
on the QApplication installed that may give performanc
issues, try to use separate, singleton watchers for them
to decrease the amount of eventfilters called
REVIEW:126113
Simple QDate::longMonthName(..) won't do the job as it
will return the month name using LC_DATE locale which is used
for date formatting etc. So for example, in en_US locale
and cs_CZ LC_DATE, it would return Czech month names while
it should return English ones. So here we force the first ui
language locale and take the month name from that.
BUG: 353715
REVIEW: 125705
The QML sectioning code does not actually sort the model, this needs to
be done beforehand. This should now sort the events by their type and
their start datetime
Marco is not happy with the plugin being here and having a Plasma
namespace, so after some discussion it was decided to move it to
KDeclarative and change to CalendarEvents namespace.
This allows to add custom config categories from JS
dynamically. This is needed for the calendar event
plugins, which are known only at runtime and this enables
to load their QML config files (which are supplied
as absolute paths) and show them in the applet config
dialog.
REVIEW: 125966
This is also made a QML singleton that will be used for the applet
config view where it will add the plugin configs once we add that
possibility.
The same instance is then set to the DaysModel from QML.
REVIEW: 125951
This adds a simple plugin interface that can be subclassed
and provide events integration with Plasma Calendar applet.
It's asynchronous and I've kept it deliberately simple.
For now the Calendar tells the plugins which date range
is being displayed, the plugins load the data and then
emit the dataReady() signal containing the events.
The events are stored in a multihash for quick access
by the Calendar's agenda part but also for overall
easy-to-use (eg. in teh model data()).
The event data is stored in EventData class, which has
a pretty self-explanatory members, except perhaps the
"isMinor" property. The intention with this is to support
namedays, where in some countries the calendars have
different name every day. This is just a minor holiday
and as such should not mark the calendar grid, otherwise
the whole grid would be in a different color.
Putting the interface here might raise the question of
depending on plasma-framework, but plugins provided by
KDE can go to plasma-workspace and other 3rd party ones
would just have to live with it. I don't think it will
be a problem but if it turns out it is, we can rethink
the placement.
REVIEW: 125817
CCBUG: 349676
CHANGELOG: Allow plugins to supply event data to Calendar applet
since this is a blind connect to a slot that may exist
or not exist, the new syntax can't be used, but check
for the slot existence before attempting a connection
BUG:354751
Basically, if the "determining mimetype" QMenu is shown, and then afterwards we
re-use this menu to show the possible actions, we clear it and then it just destroys
itself on exec() returning a null QAction, rather than waiting for the user to make
a selection. It doesn't matter when, as soon as the menu becomes empty, be it because
we call clear() or we remove the action before populating it. Hence, we just populate
the menu and then remove the first action which will be the "determining mimetype" placeholder.
CHANGELOG: Fix dropping files onto the desktop/panel not offering a selection of actions to take
REVIEW: 125939
-use splitRef when converting parts of qstring to ints to avoid redundant memory allocations
-warnings--: remove redundant ';'
CCMAIL: notmart@gmail.com
BypassWindowManagerHint is a flag which is X11 specific. Because of
that for example QtWayland doesn't create a real window for QWindows
with this flag.
Using such a window will eventually result in a freeze of the whole
application. If one renders with QtQuick to such a window, mesa will
request a frame callback from the compositor. Just the compositor
will never deliver the frame rendered callback as it doesn't know the
window exists in the first place and by that doesn't render it and
will never ever deliver the frame rendered callback.
If now one tries to render another frame, mesa notices that it hasn't
got the frame callback and will block the thread till that happens.
With the setup described: that's until eternity.
See Qt Bug: https://bugreports.qt.io/browse/QTBUG-49272
REVIEW: 125961
This makes IconItem try to load global icons from the theme
with Plasma::Svg as well, making it assign the colors from
the stylesheet if the breeze monochrome icons are treated,
that should be scriptable, from some attempts i did the
script seems to convert them correctly, without any
change in rendering.
This will automatically color monochrome breeze icons only
in plasmashell, and more specifically only those that use
IconItem, not QIconItem (iconitem should probably have an
animation-less mode to be able to be used in taskmanager
and stuff)
perhaps in the future we'll be able somehow to hook all
this stuff in QIconEngine to be able to use it in QWidget
applications, but since QIcon does have any idea where it is,
is not usable yet for things like the fullscreen fixed-dark
gwenview view.
Change-Id: I28e5fedabafbe8ed82a9df7614f8e2af18c6a24d
REVIEW:125657
Plasma's Button has an extra property "minimumWidth" which is an extra
hint not in QQC to say "what is the size to exactly fit the contents".
(it's a bit confusing, as we can perfectly handle a button below it's
"minmimum" size)
This should be based on the size the contents want to be (the
implicitWidth), not how small the contents can go (which with is pretty
meaningless when our button can elide)
It got broken at some point recently.
BUG: 353584
Change-Id: I637898c3abf98183bbae30d8f15c4d72801a3650
REVIEW: 125698
QtQuickControls already does this inside Button code. This hint is meant
to be "what's the default size for a panel to be".
Change-Id: I12fd084a3d3c35b172fbff9c7d3ab5c5565a82dc
appletCreated is different from appletAdded because it gets
emitted only when the user explicitly creates one, so not in
case of an applet migrating and not during restore
needed by https://git.reviewboard.kde.org/r/125562/
REVIEW:125569
Change-Id: I1db9286beb160391c13f1aca0ac48ed490495ea2
applying the flag on exposeEvent correctly hides the dialog
from the taskbar, while is still present if only applied
in ShowEvent
Change-Id: I289c36aff251e5cc6e41a493cbc0b2b5b1432a8d
This reverts commit 4e9b32d80d.
doesn't fix the problem and just introduces a memleak
(the crash is actually about a deleted containment,
so the problem is somewhere else)
CCMAIL:xiangzhai83@gmail.com
restore a feature from Plasma4, the ability for plasmoids to provide
an icon insude their package.
intended for GHNS plasmoids,
already used in the widget explorer, this makes it the default
plasmoid icon as runtime as well.
Change-Id: I196897eeedbe0c385c2795ab73c278f7c837221d
REVIEW:125336
QQC button heights are max(backgroundHeight, label + margins).
QQC lineedits are only from the background
We need to take the margins into consideration when deciding how high
the textbox should be otherwise we're effectively just ignoring what the
SVG says.
This means button and textbox on the login screen are now the same
height.
REVIEW: 125240
PlasmaCore.IconItem has a fade animation when changing source.
Clearing the source when tooltip is not visible eliminates the
animation.
REVIEW: 125178
When using ModelContextMenu with a JS array the "model" param of the clicked
signal is null because QtObject property can only hold QObject but no JS objects.
CHANGELOG: The onClicked signal of PlasmaComponents.ModelContextMenu now works properly
if model is a JS Array of JS objects
REVIEW: 124910
Nowadays the size of the icon is defined by the size of the button itself,
and vice-versa.
This patch uses the unit sizes to decide which sizes to offer.
REVIEW: 124628
on denser screens we need more higher speed and
deceleration expressed in pixels
Change-Id: Ida366190ec99720f05b8c52f08514fc087a67948
reviewed-by: "Kai Uwe Broulik" <kde@privat.broulik.de>
This adds a "Year overview" showing all 12 months in a grid, and a "Decade overview"
showing the current decade.
CHANGELOG: Calendar navigation has been significantly improved, providing a year and decade overview
REVIEW: 122488
Otherwise it's centered on the button instead to the icon and it looks
wrong. Also it's good that we use the rectangular background as it involves
all the button, arrow included.
Reviewed by Marco Martin
We can not generate proper PluginInfo most likely because metadata was
not valid, printing metadata itself will not be useful and will result
in printing message like,
Could not load plugin info for plugin : "" skipping plugin
Which is 0% useful.
The LookAndFeel entry does not exist in kdeglobals (it's called LookAndFeelPackage),
so when the configured LnF package is removed or renamed, the code will go to
endless loop because it never clears the configuration ine kdeglobals correctly.
REVIEW: 124371
With the move to a shared QML engine infrastructure, the check for whether the
focus item is a View no longer held and thus Plasma dialogs stayed opened when
clicking the Desktop to dismiss them.
CHANGELOG: Dialogs like Kickoff now properly close when clicking the Desktop
BUG: 349172
REVIEW: 124260
FIXED-IN: 5.13
solves some highdpi issues
saves and reads natural sizes separed by scalefactor
so they don't get mixed up when the scaefactor changes
resulting in wrongly sized items
reviewed-by:David Edmundson <david@davidedmundson.co.uk>
The containment interface deletion order isn't clear. It can happen that
it is deleted before the application quits, and then this lambda is
called, and its accesses internals of the class even though it has been
deleted.
Reviewd-By: Marco Martin
When loading an applet which does not exist, we create a dummy applet
which just contains the error message. This dummy does not have a valid
KPluginInfo, and using an invalid KPluginInfo causes as assert to be
hit.
Reviewed-By: Marco and Sebas
Makes the code a bit simpler & lighter and fixes the sometimes missing
bottom line in calendar.
The grid is now equally padded from both sides (including the month
name), so basically it's now always aligned to the center and this also
fixes the cases where there was a bigger padding on one side than on the
other.
The grid is now also anchored to the bottom so that the bottom margin
can stay moreless consistent with the side margins in different sizes.
Change-Id: I2f2173d11e473d6e93db2bdca002269e4239f516
REVIEW: 124072
CHANGELOG: Improve hidpi support in the Calendar grid component
Sometimes the first day in the grid can be Sunday, but the week number
must always be counted from Monday in that week
BUG: 349044
Change-Id: I903650fcaadb4fd78764ad6a8bb1e219261c791b
FIXED-IN: 5.11
Only the background contrast effect provides real contrast for contents, the blur effect
doesn't improve readability that much; so we now use the translucent theme only when we
have the background contrast effect. This significantly improves readability.
CHANGELOG: An opaque theme is now used when only the blur effect is available
REVIEW: 124039
BUG: 342934
BUG: 348154
There can be a situation when changing resolution/scaling or some other screen
property that driver/XRandR decides to turn the screen off temporarily, during
which there are no screens and QGuiApplication::primaryScreen returns a null
pointer.
Approved-by: David Edmundson
an attempt at transition without having to litter all
the metadata files: whitelist for now the applets in which
use the separate engine: when they have a version number
greater than 3 (arbitrary) switch over to shared engine
Change-Id: I354638527923734722bfcb0810703e20e32372d1
Since the password echo is a circle woithout vertical or horizontal lines, it won't be
more blurred with different rendring types.
Using Qt rendering, the dots will look more aligned and equally spaced.
Change-Id: I8052f176930d1e2dc144f0b65daf539764cf08b1
REVIEW:123799
I've been trying to figure out why there's so many qml scripts which errors always specify "<Unknown Files>".
This patch is not ideal, but improves the situation slightly.
REVIEW: 123575
QMimeType::aliases() does not return the main mimetype in the returned
list and so when there are no aliases for a mimetype, there would be no
associated application found as it would be querying for empty mimetype.
This now always prepends the current mimetype to the list for which the
apps are queried.
REVIEW: 123779
BUG: 340326
FIXED-IN: 5.11
CHANGELOG: Fix AssociatedApplicationManager lookup when a mimetype has
no aliases
Change-Id: I322b03f2ac17fa4c0eb70fc3354c65a0f7a5e34c
With the same mechanism as plasma 1, add the possibility to load kcms directly
in the plasmoids config windows. this works only for qml based ones.
the apply enable and trigger is correctly wired between the config dialog
and kcm apis.
Change-Id: I66b5ab2253dcbb5f223b5dcf5616efc9d5aab274
REVIEW:123673
it has a couple of big problems
Plasmoid attached property (should be easily fixable)
url interceptor (more tricky)
Change-Id: Ie75dfa97e097f43e8e5778f9b47fdff29224e5fc
this ports most of libplasma away from sycoca, using instead
a combination of KPluginLoader and KPackage::PackageLoader instead
(so eventually using their own little caches instead of the
global sycoca cache)
a kservicetypetrader call is left in the loading of
containmentactions since is the only way to make an older
workspace still work, but is only a fallback, so containmentactions
in plasma-workspace can be ported eventually as well
Change-Id: Ie9579c3e01284f6d97043e22d01bbe63d3c3f45a
REVIEW:123626
Now it will show first character only if the ListView has FirstCharacter
set
Change-Id: I6d2451d95e36a9a07eed4168402ac5748e87dcb3
Reviewed-by: Marco Martin
To improve accessibility and consistency with widget applications scroll bars no longer
automatically hide after a timeout, which was the case when a touch screen was present,
which is nice for tablets but bad for desktops.
CHANGELOG: Scroll bars no longer automatically hide when a touch screen is present
REVIEW: 123645
BUG: 347254
KPluginLoader has all the needed machinery to identify a plugin by its
pluginId. No need to use the query parser here, replace it with a
lambda.
Look for C++ dataengines first. These are much more common, especially
in essential cases. By looking up the plugins through KPluginLoader
first, we can save querying ksycoca.
REVIEW:123297
CHANGELOG:Use KPluginLoader instead of ksycoca for loading C++ dataengines
if there are transforms in the scene, to correctly compute the position the
transform is needed to be accounter for.
QQuickITem::mapRectToScene does consider tranforms.
this adresses bug 345787 where the toolbox may be rotated.
BUG:345787
Change-Id: I13a5509d95a7498382155abf3c3d195708de56a6
Given a geometry, it adjusts it moving it completely inside of the boundaries
of availableScreenRegion, returning the topLeft point of the adjusted
rectangle
reviewed-by: David Edmundson <david@davidedmundson.co.uk>
Change-Id: Ib58cbf521d5def1cd5bb34fe90366d4b628f8a89
CCBUG:345401
CCBUG:345002
When the tooltip is empty (no text, no subtext, and no mainItem) it will not be shown.
However, when it becomes empty while it is already shown, it stays there as a small
rectangle. This hides the tooltip immediately (so KWin's fadeout animation still has
the proper content rather than the empty tooltip) when the TooltipArea that opened
the tooltip has been destroyed or its content becomes empty.
CHANGELOG: Fixed stray tooltips when temporary owner of tooltip disappeared or became empty
REVIEW: 122939
When Component.onCompleted is emitted, all the static children have been created,
thus we can call the layout function right away.
CHANGELOG: Fix TabBar not properly laid out initially, which could be observed in eg. Kickoff
REVIEW: 123106
Not a real issue as initialize() is always called before they're used
but it's cleaner and fixes a coverity warning.
Change-Id: Ib1168be7f9d72c7d5765850a7f35d524ea279a75
This improves animation smoothness, eg. when switching between heavy system tray plasmoids.
CHANGELOG: PageStack transitions now use Animators for smoother animations
REVIEW: 123102
This reduces stuttering when switching between lazyloaded pages
CHANGELOG: TabGroup transitions now use Animators for smoother animations
REVIEW: 123103
This is needed as otherwise we can have a situation where d->mainItem is
null, yet we still have connections to an object that exists causing a
crash if the old mainItem resizes.
BUG: 343963
Change-Id: Ie398a591915fa02d4d97ce7ad5289e3b24038087
Since attached properties cannot ever change during the lifetime of the object,
a colorscope needs to be created for each obect that asks for the
attached property. now each instance if (internal) has m_inherit
(only those created as an attached property), will search for the property
of the proper ancestor. Not super efficient, but the proeprties should be
actually asked for rarely enough.
doesn't look much nice, but seems to work pretty reliably and the only way to.
Change-Id: I735da5551dbb8c2641be88d245f998d00ed977ac
REVIEW:122988
if the immutability doesn't actuall change at startup,
don't emit immutabilityChanged even tough each applet needs
one ImmutableConstraint at start to correctly initialize
stuff
Change-Id: Id1fd40ffd62c09a2b092d13d7fb4c556cfb34994
rectSaveTimer is used to event compress the save and sync of the
configuration file that is used as a cache of the rectangles of
svg items (in order to avoid svg renderers creation when possible)
there is exactly one situation where it seems to not work: during
creation of svgitems/framesvgitems, insertintorectcache ends up
being called by another thread than the Theme's qobject thread,
and that is not allowed.
with invokeMethod the timer will be started by the correct thread
REVIEW:122915
Change-Id: I3ff4a4ebd1dfdba4b9b830fe6c08feece19b903e
when QT_DEVICE_PIXELRATIO is something different from 1,
the pixmaps generated by Svg will be scaled up to give a proper texture.
This is complementary but not replacing our current approach:
the pixelratio that can be accessed by units is now in relation to the qt pixel ratio,
spacings are also adjusted accordingly (therefore, spaces and sizes won't
need an integer value like pixelratio)
svg introduces also a scaleFactor property (that is pretty much like its old pixelRatio)
basically, scalefactor, will scale both the textures and all the reported sizes,
(old method) pixelratio just scales textures without altering measures
(like qt pixelratio likes)
Change-Id: I304aa0d80abf76abafac239be185dd3b2ab741b7
REVIEW:122673
The active property is usualy set in response to a hover event.
Loading the new pixmap right away, starting the fade animation immediately, provides
a more responsive user experience.
REVIEW: 122857
Currently units is based on font metrics except icon size and some SVG
parts which use DPI directly.
Instead of taking the physical DPI we take the logical DPI which is used
for working out font point -> pixel sizes.
We can rely on this being correct as otherwise every other app would
appear broken.
REVIEW: 122799
BUG: 338308
Change-Id: I22f668ccea7d6d15ff475e1368c82964bdde1e60