Summary:
Don't construct a QUrl for every source strings. Check it's a file url
first (which is the only kind of url we support at the moment)
When extracting the path, use toLocalFile, so it works on platforms where
path!=toLocalPath (e.g. windows)
Don't split a string and get a chunk, but just extract the chunk we need
with section. Reduces allocations that are automatically discarded.
Narrow iconPath scope
Test Plan: Tests still pass, plasmashell still works
Reviewers: #frameworks, #plasma, mart
Reviewed By: #plasma, mart
Subscribers: plasma-devel
Tags: #plasma, #frameworks
Differential Revision: https://phabricator.kde.org/D6014
Summary:
take into account size hints also when adjusting with synctomainitemsize
which sometimes has to be executed right before adjusting from the layout
hints, giving one wrong resize
introduce geometryUpdatesBlocked, which stops the dialog
from syncing which is useful when both visual parent and item
contents gets updated in one go (the tooltip) it is not
yet exported to qml and it shouldn't as is dangerous, but
kicker may make use of it between changing the submenu model and
the visualparent
alternative implementations may be:
* a method that takes both main item and visual parent
* delaying with a timer setGeometry (ouch)
this part can also be left behind for now and see if the rest is good enough
Test Plan:
no visual glitches visible anymore in wayland when moving the tooltip
in the taskbar, x11 ok too
Reviewers: #plasma, hein, davidedmundson
Reviewed By: #plasma, hein, davidedmundson
Subscribers: broulik, davidedmundson, plasma-devel, #frameworks
Tags: #plasma, #frameworks
Differential Revision: https://phabricator.kde.org/D5912
Summary:
this ensure two things:
* submenus have the main menu as transientParent
* the visualParent window() is used as transientParent, if exists
this partly fixes popup positioning in wayland, tough
the main taskbar menu is still mis positioned
Test Plan: submenus ok, taskbar contextmenus only partially fixed
Reviewers: #plasma, #plasma_on_wayland, davidedmundson
Reviewed By: #plasma, davidedmundson
Subscribers: davidedmundson, plasma-devel, #frameworks
Tags: #frameworks, #plasma_on_wayland
Differential Revision: https://phabricator.kde.org/D5773
Summary:
every time the window gets shown the wayland surfaces
get created, when hidden, they get destroyed
showevent is too early for it as they aren't there yet,
use :Exposed instead, but only the first time when the surface
isn't there yet
Test Plan:
popup applets always have correct blur in a wayland
session
Reviewers: #plasma, #plasma_on_wayland, davidedmundson
Reviewed By: #plasma, davidedmundson
Subscribers: davidedmundson, plasma-devel, #frameworks
Tags: #frameworks, #plasma_on_wayland
Differential Revision: https://phabricator.kde.org/D5745
Summary:
when usesPlasmaTheme gets changed, make sure to
invalidate the svg icon if there, to reload the
icon from the proper source, being either from
the plasma theme or the system icon theme.
Test Plan:
cuttlefish now reloads dynamically the proper icons
when the monochrome checkbox is ticked
Reviewers: #plasma, sebas
Reviewed By: #plasma, sebas
Subscribers: plasma-devel, #frameworks
Tags: #plasma, #frameworks
Differential Revision: https://phabricator.kde.org/D5721
Summary:
We were missing installing the qmldir file which is quite important
Test Plan: Actually used them in a Plasmoid
Reviewers: #plasma, mart
Reviewed By: mart
Subscribers: mart, plasma-devel, #frameworks
Tags: #plasma, #frameworks
Differential Revision: https://phabricator.kde.org/D5603
Summary:
In effect this is meant to resurrect the "Panel" icon size setting from
the Icons -> Advanced KCM in System Settings, for use as a ceiling on
panel icons to avoid them taking up too much space, especially in wide
vertical panels.
Previously, the actually-unused "Desktop" size hint was added to the
iconSizes map. I believe this was in error, as the size hints are
semantically different from the size classes. This patch marks the
"desktop" iconSizes map entry as deprecated and makes it available
under iconSizeHints instead.
The soon-to-be-updated D5592 will demonstrate this API in use.
CCBUG:378443
Reviewers: #plasma, mart
Subscribers: plasma-devel, #frameworks
Tags: #plasma, #frameworks
Differential Revision: https://phabricator.kde.org/D5593
Summary:
The reference textField is undefined in this context
It works if the style happens to be used from PlasmaComponents
Use control instead to access the TextField.
Reviewers: #plasma, broulik
Reviewed By: #plasma, broulik
Subscribers: ltoscano, plasma-devel, #frameworks
Tags: #plasma, #frameworks
Differential Revision: https://phabricator.kde.org/D5297
now with fallback is common to have prefixes that are not present and fail.
this generates a lot of debug that is not really useful, as is an OK
thing.
Summary:
if the user code did something like
IconItem {
implicitWidth: 32
implicitHeight: 32
}
then never automatically update implicitWidth or height.
this favors compatibility and fixes the desktop
toolbox appearance
Test Plan:
textbox works, other icon items in plasmashell seems properly sized.
applet alternatives fix is still needed
Reviewers: #plasma, hein
Reviewed By: #plasma, hein
Subscribers: hein, davidedmundson, plasma-devel, #frameworks
Tags: #plasma, #frameworks
Differential Revision: https://phabricator.kde.org/D5243
When using a regular JavaScript Array as model and omitting certain roles (e.g. not
having a "text" for a separator) it would throw a warning.
Differential Revision: https://phabricator.kde.org/D5247
We had m_smooth but never actually used it in the texture node.
With Plasma SVG icons this shouldn't be used but when passing custom pixmaps
or raster graphics (e.g. custom icon in Kicker, thumbnails in Folder View)
Differential Revision: https://phabricator.kde.org/D5214
We overwrite implicit size based on the icon loaded nowadays which breaks this.
Also, while at it, added an explicit "valid" check for the icon.
Differential Revision: https://phabricator.kde.org/D5202
Summary:
This allows users of IconItem to know the aspect ratio of the
source document, which can be used to size the item or set
applet size hints to accomodate non-square images better.
This will be used in a patch to Kicker/Dashboard that ports
a use of Image in its CompactRepresentation to IconItem to
get the hover highlight effect even for a custom button image.
Reviewers: #plasma, mart, davidedmundson
Subscribers: plasma-devel, #frameworks
Tags: #plasma, #frameworks
Differential Revision: https://phabricator.kde.org/D5160
Use the enums in a consistent way to place the menu around the parent item.
Test Plan:
Tested with plasma-pa and task manager context menu.
Reviewers: #plasma, hein
Reviewed By: #plasma, hein
Subscribers: plasma-devel, #frameworks
Tags: #plasma, #frameworks
Differential Revision: https://phabricator.kde.org/D4921
This way containment context menus and PlasmaComponents Menu get accelerators assigned to by default.
CHANGELOG: Most (context) menus have accelerators (Alt+letter shortcuts) now
BUG: 361915
Differential Revision: https://phabricator.kde.org/D5057
Summary:
This is a basic styling of a QtQuickControls2 series based on Plasma theme.
it has the main controls available in Qt 5.7
it installs them as a separate import (org.kde.plasma.controls 3.0) for
use restricted to plasmoids, is probably needed to be still installed as
a style as well
Test Plan:
tried with minimal QML files, a more comprehensive gallery may be needed.
pending considerations:
* some of the classes, like Drawer, the dialogs and ApplicationWindow *don't* make sense in plasmoids
* it will probably still need to be installed also as a qqc2 style, as this should be used in Plasma mobile
* probably only some of the controls should be installed as a separate import, the whole set as a style strictly for Plasma Mobile use. the same qml files would be used, so no maintainance overhead
Reviewers: #plasma, davidedmundson
Reviewed By: #plasma, davidedmundson
Subscribers: davidedmundson, broulik, plasma-devel, #frameworks
Tags: #plasma, #frameworks
Differential Revision: https://phabricator.kde.org/D4508
Summary:
When setting an empty QStringList as prefix, it can lead to unexpected results, such as the prefix not changing.
BUG: 377441
Reviewers: #plasma
Subscribers: plasma-devel, #frameworks
Tags: #plasma, #frameworks
Differential Revision: https://phabricator.kde.org/D5000
It is deprecated. Instead re-implement roleNames().
Done in places where only static roles were used.
Differential Revision: https://phabricator.kde.org/D4891
Test Plan: Ran
Reviewers: #plasma, mart
Reviewed By: mart
Subscribers: plasma-devel, #frameworks
Tags: #plasma, #frameworks
Differential Revision: https://phabricator.kde.org/D4857
Summary:
Like all the inbuilt shaders this now has a separate GLS source file which
works with a newer version without requiring compatibility.
Was https://git.reviewboard.kde.org/r/128426/
Test Plan:
Ran plasmashell with ForceGlCoreProfile set in the config
Hovered an icon in the task manager and it animated to the correct one
correctly.
Ran glslangValidator on both files. No warnings.
Reviewers: #plasma, mart
Reviewed By: mart
Subscribers: mart, plasma-devel, #frameworks
Tags: #plasma, #frameworks
Differential Revision: https://phabricator.kde.org/D4851
Summary:
This matches what Qt does internally, it's easier to read and gives us
syntax highlighting on the shader files, but more importantly in future
we will get Qt's automatic loading of core profile shaders.
Test Plan:
Opened QML with IconItem, made the icon switch.
Still looks the same
Reviewers: #plasma, mart
Reviewed By: mart
Subscribers: mart, broulik, plasma-devel, #frameworks
Tags: #plasma, #frameworks
Differential Revision: https://phabricator.kde.org/D4848
There was already some kind of detection and adjustment if there is not enough
space for the popup available. Do some more work by placing the popup according
to its PopupPlacement enum. Do this also if the popup breaks the top or left
boundary of the screen.
Also fixes some minor problems:
* TopPosedRightAlignedPopup was the same as RightPosedTopAlignedPopup, but in
the first case the menu should be on top of parentItem
* LeftPosedTopAlignedPopup was above parentItem and not left of it
* Small documentation error
Reviewers: #plasma, hein
Subscribers: plasma-devel, #frameworks
Tags: #frameworks, #plasma
Differential Revision: https://phabricator.kde.org/D4867
This hints the actual size of the handle, excluding any padding and shadows
and allows for the handle to touch the outermost border of the rail underneath.
Differential Revision: https://phabricator.kde.org/D4762
Summary:
if a framesvgitem has an array as prefix, like
FrameSvg {
prefix: ["toolbutton-hover", "hover"]
}
it will use the first available prefix, so on themes that
have toolbutton-hover, that one will be used, old themes will
continue to use "hover" as prefix
Test Plan:
tested the calendar with breeze theme has breeze-widget style
toolbuttons, with olt themes as air, the old behavior is still
there, switching on the fly works
Reviewers: davidedmundson, #plasma
Subscribers: davidedmundson, broulik, plasma-devel, #frameworks
Tags: #plasma, #frameworks
Differential Revision: https://phabricator.kde.org/D4827
Summary:
Otherwise if anyone used setAction it would be missing a very important
connect.
Test Plan: Compiled
Reviewers: #plasma
Subscribers: plasma-devel, #frameworks
Tags: #plasma, #frameworks
Differential Revision: https://phabricator.kde.org/D4758
Summary:
Unlike the visible property, the opacity does not inherit parent values
and refers to the relative opacity of that item.
The current style code is checking that an item we can't control
externally has an opacity > 0, this doesn't really acheive anything.
This was a breakage from when we ported *to* QtQuickControls 1.
Test Plan:
I was running a plasmoid I had written years ago (my RSS tutorial)
and had abnormally high CPU usage in an animation that I didn't have then.
Code was:
BusyIndicator {
opacity: 0
running: true
}
Reviewers: #plasma, mart
Reviewed By: mart
Subscribers: plasma-devel, #frameworks
Tags: #plasma, #frameworks
Differential Revision: https://phabricator.kde.org/D4729
Also clean them up a bit and drop the "smooth" dance as it doesn't make a difference with QtQuick 2.
Differential Revision: https://phabricator.kde.org/D4572
since the vertical size hints of the button depend from the
labe size hints, it cannot have Layout.fillHeight as it
breaks its Layout.*Height and implicitHeight
use a vertical anchor instead as buttons always have a single line
reviewed-by:d_ed
ScrollArea has a property for en/disabling the frame provided by its style.
Until now the property wasn't evaluated, which besides making it impossible
to deactivate the frame leads to visual artifacts (observed in Simple Menu:
Flashing frame at the bottom of the page list).
In order to not change the current implementations we additionally set the
value in ScrollArea to true.
Reviewed By: mart
Subscribers: broulik, hein, plasma-devel, #frameworks
Tags: #plasma, #frameworks
Differential Revision: https://phabricator.kde.org/D4473
Summary:
give frameSvg the concept of repaintBlocked(), that enables and
disables the regeneration of the frame data when a property is set.
the use case is when often, a lot of properties are set one after
the other (such as prefix, enabled borders, size)
collapse the formely similar, but a bit different logic of frame
regeneration is a single function for better maintanability.
QML FrameSvgItem sets repaintblocked when it starts and releases it just on oncomponentCompleted
Test Plan:
plasmashell still starts, autotests still work, all frames are rendered correctly
the destruction of old frames is cutted by 50%. in the qml profiler
the creation time of a framesvgitem slightly improved, on this machine from around 26 msecs to around 21, can still be improved, but at least the code is a bit simpler
Reviewers: #plasma
Subscribers: davidedmundson, plasma-devel, #frameworks
Tags: #plasma, #frameworks
Differential Revision: https://phabricator.kde.org/D4414
This fixes the label not being vertically centered if the button is smaller than its implicit height.
This can happen with the global menu applet in a narrow panel.
BUG: 375911
Differential Revision: https://phabricator.kde.org/D4436
Summary:
Icon's are generally small, they may as well go in the existing shared
texture atlas, save some memory and it means more items can be batched
whilst rendering.
The textures used during animation are unchanged for now as it also
requires changing FadingNode's shader.
Test Plan:
Ran plasma.
We use atlas's in frame/SVGItem already so it should be fine.
Reviewers: #plasma, mart
Reviewed By: mart
Subscribers: mart, plasma-devel, #frameworks
Tags: #plasma, #frameworks
Differential Revision: https://phabricator.kde.org/D4342
This allows to limit the maximum width of a menu. It can be useful for instance
in task manager where long file names for recent documents will result in gigantic menus.
The property has a RESET method (which is called if you assign "undefined") which will
set it back to QWIDGETSIZE_MAX to remove the size restriction.
Differential Revision: https://phabricator.kde.org/D4257
Summary:
I just realized there was a weird workaround in plasma-nm where it gets
checked so it's shown.
Properly use the declarative API instead of listening to a ton of signals.
Test Plan: Tested with plasma-nm and org.kde.plasma.notifications plasmoids
Reviewers: #plasma, mart
Reviewed By: mart
Subscribers: mart, davidedmundson, plasma-devel, #frameworks
Tags: #plasma, #frameworks
Differential Revision: https://phabricator.kde.org/D4214
the layout engine has a bug
https://bugreports.qt.io/browse/QTBUG-58307
that if some items have an odd height, some an even height,
the smallest items are resized by half pixel to try to
really center it, breaking rendering
BUG:375318
Reviewed-by:David Edmundson
Summary:
Means long main texts don't get truncated. One of the main uses
for tooltips is to show full text for things that are truncated
in the usual UI, so this is a bad default.
BUG:375141
Reviewers: #plasma, mart
Subscribers: plasma-devel, #frameworks
Tags: #plasma, #frameworks
Differential Revision: https://phabricator.kde.org/D4189