Given the FrameData and the total size, we get to know where is the
contents going to be and gives us the information to extrapolate where to
put all the borders and corners.
Reviewed by David Edmundson
Move variable declarations closer to its uses
Prefer using QSize than width and height separately, so we can pass it
around directly and use isEmpty
Remove duplicated code in the central piece drawing
Reduce type casts from QSizeF to QSize, we're always using it as a QSize,
so just make the cast once.
Remove redundant constructions like checking whether it's null and returning
null or unneeded arithmetics
Create a paintBorder function that can generically paint framesvg borders.
This helps us reduce duplicated code as well as improving the readability
of the code.
Reviewed by David Edmundson
Make sure AppletPrivate::uiReady is set in applet_p.cpp when we report that
the ui is ready.
Make sure that if we loop through all the containments and they're all
ready, we emit that it's done.
So far, Corona::startupCompleted was never emitted.
REVIEW: 119220
Currently the grid itself is composed of 88 rectangles that draw all the
lines in a way that two big rect draws the whole two topmost horizontal
and leftmost vertical border lines and then each day rectangle is
drawing small bottom and right rect.
This patch reduces it to 13 rects only where one rect draws the whole
frame around the grid and then 1px wide/high rects draw the inner lines.
Results in much cleaner & simple code.
Plus there's a small refactor on the id names so it makes more sense.
This does not require any additional changes in the applets.
REVIEW: 119232
While profiling plasmashell memory usage with Vishesh we realized that most
of the usage came from loading the Background image repeatedly.
We traced it back to this change, where we were connecting to
wallpaperChanged before initializing it, so it would initialize it again,
loading the wallpaper twice. It's not that we were leaking the object,
AFAIK, but loading an image using QQuickImage already raises the memory
quite a bit.
This change alone reduces by 15% the memory usage of my plasmashell (with 2
screens, that makes it a bit worse, because there's 2 DesktopViews then).
REVIEW: 119216
TimeTracker is a small class that keeps track of an object the changes in
the properties of an object and relates them to a point in time. This way
we can see how things change and react to each other. Then, this information
is exported into a json file to analyze.
REVIEW: 119199
Qt Quick accessibility already picks up the text automatically. Instead
set the name (which is a descriptive element) to the placeholder text
which is more descriptive of the element. Otherwise Orca will read the
text twice.
restore the disconnect: sometimes appletRemovedForward gets executed after
aboutToQuit is emitted, but before closingDown returns true
this prevents configuration to be forgotten
the problem is that sometimes when QCoreApplication::aboutToQuit the containment is already deleted (the order is not really deterministic), therefore appletScript::applet() will hit an assert.
using a qpointer should solve it, its data being already 0ed in the cases the containment is already deleted at :aboutToquit time.
the disabled/invisible actions already have it as properties.
this fixes the add widgets action sometimes not being available
in the toolbox
Reviewed by: Bhushan Shah <bhush94@gmail.com>