Commit Graph

3566 Commits

Author SHA1 Message Date
Bhushan Shah
f43938f4c2 Use #if instead of #ifdef
Fixes previous attempt to unbreak the build on Windows
2017-06-25 10:39:53 +05:30
Bhushan Shah
e3ffa8d8fe Fix the build without wayland/kwayland
This fixes the build of plasma-framework on KDE CI. Without this it will
error out as,

dialog.cpp(309): error C2065: 'shellSurface': undeclared identifier
dialog.cpp(310): error C2065: 'shellSurface': undeclared identifier
dialog.cpp(310): error C2227: left of '->setPosition' must point to
class/struct/union/generic type

Signed-off-by: Bhushan Shah <bhush94@gmail.com>
2017-06-25 10:29:28 +05:30
Marco Martin
eab4aa9909 Make sure size is final after showEvent
Summary:
* make sure after a showevent the size is final and the
dialog can be safely repositioned.
* set mainItem visible in :setVisible() so that is executed before showEvent:
   resizing windows in their show event is definitely not enough, causes events to arrive to
   reset to the old geometry in race with the setgeometry done there, don't know yet
   if it's the qpa, qwindow, or the windowmanager
* make synctomaintem and updatelayoutparameters working even if
the dialog is not visible as we need to resize beforehand
* move the plasmasurface window also in the show event as if there was no moveevent
  after an hide/show, its position would be resetted to 0,0

Test Plan:
current dialog users behave the same (like pre-D6216 notifications applet), tests still pass
notifications applet reworked to use this works as expected

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: sebas, hein, davidedmundson, plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D6215
2017-06-21 13:29:26 +02:00
Kai Uwe Broulik
87d5449480 Fix vlc tray icon margins
I broke this in 5bfc730 when I fixed the stylesheet
2017-06-14 11:24:46 +02:00
Kai Uwe Broulik
5bfc730ce7 Fix vlc tray icon color scheme
Make sure to use style sheets and fill:currentColor or else it won't adapt
to the Plasma theme at runtime (e.g. white icon for dark themes etc)

CCMAIL: guoyunhebrave@gmail.com
2017-06-13 10:14:57 +02:00
David Edmundson
4a525f68bd Revert "Make every applet its own focus scope"
Even though this change is probably technically correct, it breaks
things in workspace which aren't really setting focus properly.

Better to revert now and merge again later when things work.

This reverts commit e65d7b98be.
2017-06-12 21:43:52 +01:00
David Edmundson
b0e8ea29fa Set Containments to have focus within the view
Summary:
Now that applets are their own focus scope (which makes sense) we've
also made containments their own focus scope.

We therefore need to also say the containment FocusScope has the focus
within the view.

BUG: 381124

Test Plan:
Renamed something in folderview
Used cursor nav

Reviewers: #plasma

Subscribers: plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D6192
2017-06-12 15:22:36 +01:00
l10n daemon script
2544d1c9c7 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2017-06-12 05:14:10 +02:00
l10n daemon script
2d4548e4d0 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2017-06-11 04:33:38 +02:00
Marco Martin
6ffe068b80 generate the old key before updating enabledborders
Summary:
sometimes a frame changed enabled borders causing a dangling
pointer in s_sharedFrames, since oldkey was generated
with the new enabled borders, it generated a key not present
in the hash, tryed to remove it and left the one associated
with the old key in the hash.
if the need to reuse a frame with that key ever arised again,
we had a crash
BUG:378508

Test Plan:
couldn't reproduce the crash neither with or without patch,
with the patch, if i put debug in every place a framedata is removed,
searching if the key is in the hash before removing it, now
it's always true, before sometimes it was false

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D6162
2017-06-09 16:16:16 +02:00
Marco Martin
1aea7bbd5e show show password button also if empty text
like happened in KPasswordWidget, show the show password
button also when there is no text, otherwise is impossible
to know what will be typed, a dot or the actual letter
BUG: 378277
2017-06-09 13:15:46 +02:00
David Edmundson
e65d7b98be Make every applet its own focus scope
Summary:
Like Loaders an applet should be a focus scope. It allows an applet to
set an item to have focus which will then have activeFocus when that
applet gets focus.

Also makes it easy to test if any item within the plasmoid has
activeFocus.

Test Plan:
Keyboard nav in kicker/klipper still work
Added opacity: Plasmoid.activeFocus ? 1 : 0 in an applet and it worked
as expected

Reviewers: #plasma

Subscribers: plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D6152
2017-06-08 11:27:52 +01:00
David Edmundson
8fdbfa6980 Emit usedPrefixChanged when prefix is empty
As found by Fabian Vogt
2017-06-07 19:46:19 +01:00
Marco Martin
bf1d1cc6b2 don't switch colors on new themes
new themes as breeze aren't supposed to just use the button graphics
on top, that also mean, don't switch palette on top if the new prefix
is there
2017-06-07 18:24:33 +02:00
Aleix Pol
563011436d Port a bunch of classes away from Plasma::Package
Summary: Ported away some classes, removes many unneeded casts that happen when starting.

Test Plan: Tests still pass, plasma starts properly

Reviewers: #frameworks, #plasma, mart

Reviewed By: #plasma, mart

Subscribers: davidedmundson, mart, plasma-devel

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D6041
2017-06-06 15:11:25 +02:00
Allen Winter
6c03c15c08 src/plasmaquick/dialog.cpp - fix build without kwayland 2017-06-05 10:02:44 -04:00
Friedrich W. H. Kossebau
0fb9732866 [FEATURE] Option to build & install QCH file with the public API dox
Using the new extra-cmake-modules module ECMAddQch (since 5.36.0)
this adds the option to automatically build and install a file
in QCH format with the docs about the public API, which then can be
used e.g. in Qt Assistant, Qt Creator or KDevelop.

Additionally the installed cmake config files will be extended
with a target KF5Plasma_QCH containing information about how to "link"
into the generated QCH file, which then can be used in the cmake build
system of other libraries building on this library, by
simply listing this target in "LINK_QCHS" of their ecm_add_qch() usage.
And a respective doxygen tag file with all the metadata about the
generated QCH file and used for the "linking" will be created and
installed.

Pass -DBUILD_QCH=ON to cmake to enable this.
2017-06-05 04:25:55 +02:00
Guo Yunhe
6ee8ffd79a Add VLC tray icon 2017-06-03 13:06:38 +03:00
Aleix Pol
3b303d7363 Small improvements in IconItem
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
2017-05-29 19:10:37 +02:00
Friedrich W. H. Kossebau
68ed01638c API dox: Use doxygen notation to have comments used 2017-05-26 19:55:25 +02:00
Friedrich W. H. Kossebau
fcee026657 API dox: note CamelCase includes by @class tag with more classes 2017-05-26 19:55:09 +02:00
Friedrich W. H. Kossebau
8749591922 API dox: fix doxygen notation with some post-position comments 2017-05-26 19:54:11 +02:00
Marco Martin
32e67a591e minimize dialog resizes/moves
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
2017-05-25 11:21:50 +02:00
l10n daemon script
6622a8c713 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2017-05-24 08:46:29 +02:00
Marco Martin
5ba1bed582 set transientparent for menus
Summary:
set transient parent for popup menus created by appletinterface/
containmentinterface, it makes them appear at the proper coordinates

Test Plan: containment menus appear where the mouse was pressed

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: davidedmundson, plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D5918
2017-05-22 10:51:16 +02:00
Marco Martin
680a8a9e28 [WIP] workarounds for menu positioning
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
2017-05-12 20:53:06 +02:00
Marco Martin
fd2e850156 recreate plasmashellsurf on exposed, destoy on hidden
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
2017-05-12 16:58:21 +02:00
Marco Martin
85699c8d2f reload icon when usesPlasmaTheme changes
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
2017-05-05 22:40:27 +02:00
Marco Martin
57c35df0bb hide scrollbar when useless
not only the root scrollbar should be hidden when
control.size == 1.0 but also background and
contentItem as they get reparented
2017-04-27 16:11:25 +02:00
David Edmundson
d3ed006a1f Install Plasma Components 3 so they can be used
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
2017-04-27 14:59:03 +01:00
Eike Hein
4f48901b05 Introduce units.iconSizeHints.* to provide user-configurable icon size hints
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
2017-04-26 20:41:06 +09:00
David Edmundson
884f89b9b0 [TextFieldStyle] Fix textField is not defined error
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
2017-04-25 15:10:49 +01:00
David Edmundson
29f1ee3858 Update the ungrabMouse hack for Qt 5.8
Summary:
There was an unidentified bug where when opening a context menu in
response to a mousePress event led to the next click events not being
registered. The mouse got grabbed by the item in the mousePressEvent,
but when we open a menu it didn't get released. The next click goes to
the currently grabbed item.

A workaround was added back in 2015 (and copied into various other parts
of Plasma) to ungrab the mouse after launching the context menu inside
our rightClickEvent. This doesn't work because qquickwindow code is
shuffled. It now sends the event and then grabs the mouse.

qquickwindow.cpp:653 on Qt5.8.0

Which means we're now trying to do the ungrab, before QWindow has set
our item as the grabber. That obviously doesn't work.

This real bug needs fixing in Qt, (I now know the root cause!)
but we have a workaround here already, we may as well make it work.

FWIW, the root cause of all of these bugs is:
The way it should work is:
    QQuickItem is pressed
    QtQuick internally says "this item has the mouse"
    you release the mouse, that gets reset
    you change window focus, that gets reset

In our case, we don't get either of the last two because:

We spawn a QMenu on mousePress; this takes focus and more importantly
does a mouse grab (a different type. At an X level, not in QtQuick) so
our QQuickWindow never gets a mouseReleaseEvent

Test Plan:
Had 1 reproducible case
Added this. No longer could reproduce

Reviewers: #plasma

Subscribers: plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D5515
2017-04-24 16:06:51 +01:00
l10n daemon script
95601054e5 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2017-04-14 03:57:03 +02:00
David Edmundson
1387b5efe3 Guard against Applet not loading AppletInterface
Summary:
This can happen if an applet has invalid metadata, it doesn't have a
script engine set (X-Plasma-API) so it won't load the DeclarativeAppletScripts
Having invalid metadata could come from the applet, or from the fallback applet
created in Containment::Private::createApplet.

We guard against it in appletAdded but not in appletRemoved, which is
inconsistent. We also apparently must have guards elsewhere otherwise
we'd see the crash more.

BUG: 377050

Test Plan: Had corrupt applet, used to crash, now doesn't

Reviewers: #plasma

Subscribers: plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D5423
2017-04-13 10:49:10 +01:00
David Rosca
a01e4fb69e Calendar: Use correct language for month and day names
Apply fix for bug 353715 also on QML side.

Differential Revision: https://phabricator.kde.org/D5345
2017-04-11 09:36:20 +02:00
Aleix Pol
328cd681a7 Update qmltypes 2017-04-10 16:02:23 +02:00
Aleix Pol
2df613f938 Generate plugins.qmltypes files for the plugins we install
Reviewers: #plasma, #frameworks, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: davidedmundson, hein, plasma-devel

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D5088
2017-04-10 15:09:57 +02:00
l10n daemon script
bef0612029 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2017-04-09 04:01:12 +02:00
Marco Martin
e1aa250e70 remove some debug
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.
2017-04-05 13:40:46 +02:00
Marco Martin
fb8ed07651 if the user did set an implicit size, keep it
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
2017-04-03 16:07:18 +02:00
l10n daemon script
f7e83b4bcf SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2017-04-01 04:05:09 +02:00
Kai Uwe Broulik
edb05ef989 [ModelContextMenu] Silence warnings
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
2017-03-30 15:03:39 +02:00
Kai Uwe Broulik
8d42e0072f [ModelContextMenu] Use Instantiator instead of Repeater-and-reparent-hack
Differential Revision: https://phabricator.kde.org/D5215
2017-03-29 12:11:02 +02:00
Kai Uwe Broulik
5ae0651045 [Calendar] Shrink and elide week names like is done with day delegate
This ensures week names never exceed their cell's boundaries.

BUG: 378020

Differential Revision: https://phabricator.kde.org/D5200
2017-03-28 13:46:22 +02:00
Kai Uwe Broulik
611a4b5920 [Icon Item] Make "smooth" property actually do something
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
2017-03-28 13:44:53 +02:00
Marco Martin
8a42b06042 sensible implicit size for svgs
if the icon is an svg, try to get the implicit size
baked into the file, in

reviewed-by:Eike Hein
2017-03-28 12:51:12 +02:00
Kai Uwe Broulik
7487e208b6 [Default Tooltip] Fix icon size
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
2017-03-28 11:05:06 +02:00
Weng Xuetian
c0f359fab0 fix stylesheet for fcitx.svgz 2017-03-27 19:12:13 -07:00
Marco Martin
874a7e39b9 fix typo, iterate all colors available
patch by andi.berger@yandex.com
BUG:377944
2017-03-24 13:46:12 +01:00
Eike Hein
bc33f0470d Set implicit size from source size for image/SVG URL sources.
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
2017-03-24 06:34:24 +09:00
Marco Martin
244baaf928 add a new property in containment, for an edit mode
Summary:
used for opening the handles when the toolbox is open
or potentially other places

Test Plan: handles open

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D5153
2017-03-23 15:23:06 +01:00
Marco Martin
088a79d131 correct maskRequestedPrefix when no prefix is used
requestedprefix requires to not have the "-", don't fail anymore in
q->hasElementPrefix(frame->requestedPrefix) in
FrameSvgPrivate::generateBackground

BUG:377893
2017-03-22 14:11:37 +01:00
Roman Gilg
28ad7879d3 [Menu] Harmonize openRelative placement
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
2017-03-22 11:16:33 +01:00
Kai Uwe Broulik
ff78b9e531 Add KAcceleratorManager
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
2017-03-16 11:47:59 +01:00
Marco Martin
76af5399dd Plasma controls based on QtQuickControls2
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
2017-03-14 10:21:33 +01:00
David Edmundson
547a34d346 Handle applyPrefixes with an empty string
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
2017-03-10 09:50:24 +00:00
Kai Uwe Broulik
fe3fd0cf17 Forward keyPressEvent to super class
Otherwise things like KRunner while typing on empty desktop breaks

Thanks Fabian Vogt for noticing
2017-03-07 16:56:58 +01:00
Marco Martin
bbcb217b48 actually delete old theme caches
Summary:
QStandardPaths doesn't do file search by wildcards,
that code was never actually functional

Test Plan: old kcache and rects cache files get correctly removed

Reviewers: #plasma, sitter

Reviewed By: sitter

Subscribers: davidedmundson, sitter, apol, plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D4925
2017-03-07 14:13:57 +01:00
Kai Uwe Broulik
94a6a168cf [Containment Interface] Trigger context menus on pressing "Menu" key
When pressing the "Menu" key, pretend a right-click happened and show the containment context menu.

Differential Revision: https://phabricator.kde.org/D4924
2017-03-06 15:14:15 +01:00
Kai Uwe Broulik
badf8acfe2 [Breeze Plasma Theme] Improve action-overlay icons
The current ones aren't really descriptive and vastly different from what Dolphin uses.

BUG: 376321

Differential Revision: https://phabricator.kde.org/D4917
2017-03-06 14:26:03 +01:00
Kai Uwe Broulik
dfbf2c1c30 Port away from setRoleNames where easily possible
It is deprecated. Instead re-implement roleNames().
Done in places where only static roles were used.

Differential Revision: https://phabricator.kde.org/D4891
2017-03-06 13:36:17 +01:00
David Edmundson
f8bedf84b7 Use initialiser list
Test Plan: Ran

Reviewers: #plasma, mart

Reviewed By: mart

Subscribers: plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D4857
2017-03-06 00:13:22 +00:00
David Edmundson
586ed85561 Ref/deref DataEngines even if the metadata is invalid
Summary:
Just because the metadata is invalid doesn't mean the DataEngine
actually failed to load, we're still returning a valid object, and as
seen with the MPris DataEngine bug. It's important that we still release
it properly.

It looks like this was designed to make sure you don't delete the null
data engine multiple times, but that shouldn't cause an issue here.

Test Plan: #plasma

Reviewers: #plasma, mart

Reviewed By: mart

Subscribers: plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D4556
2017-03-06 00:12:27 +00:00
David Edmundson
23b70f4d45 Implement FadingMaterial frag/vert shaders on core profile
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
2017-03-05 23:44:56 +00:00
David Edmundson
3b05f569ac Split frag and vert code of FadingNode into separate files
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
2017-03-05 23:44:50 +00:00
Aleix Pol
3a9fc22724 Small cleanups
Summary: Move implementation to cpp file, port away from deprecated API.

Reviewers: #frameworks, #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: plasma-devel

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D4931
2017-03-06 00:07:52 +01:00
Marco Martin
b99a87a320 set default hints when repr doesn't export Layout.*
when we go from full to compact repr, if the compact
doesn't export a Layout attached property, the hints shouldn't
remain those of the full repr, so reset to default values

BUG:377153
Reviewed-by:Eike Hein
2017-03-03 17:52:41 +01:00
Marco Martin
fba9e9e151 possible to set expanded=false for a containment
Summary:
it will still have no visible effect, but
is possible to read and write the property if
containments make use of it (the systray uses it for
opening/closing its popup)

Test Plan: setting expanded : false to containments doesn't break them

Reviewers: #plasma, broulik

Reviewed By: #plasma, broulik

Subscribers: plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D4866
2017-03-03 14:31:07 +01:00
Roman Gilg
daee27f096 [Menu] Improve available space correction for openRelative
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
2017-03-02 21:02:32 +01:00
Marco Martin
2b3e8dfe86 move setImagePath logic into updateFrameData()
Summary:
make sure the framedata creation/destruction is
completely in updateFrameData, makes easier to track
and possible to use the repaintsblocked logic.
now only one framedata instance should be created at startup.

CCBUG:376754

Test Plan:
* autotests pass, plasma runs ok, crash on 376754 not reproducible anymore
* possible to have a plasmashell session start without the creation of a single svg renderer (startups after the first when the cache is generated)
* on qml profiler, framesvgitem creation is ~12 msecs the first one created, ~2-300 musecs the subsequent ones, seems to be a bit better than before the whole refactor started
* tried against the latest patches that remove the binding loops, still correct rendering and no binding loop
* tried with both empty and existing cache in place

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: davidedmundson, plasma-devel, #frameworks

Tags: #frameworks, #plasma

Differential Revision: https://phabricator.kde.org/D4707
2017-02-28 13:35:09 +01:00
David Rosca
af2b27d1b8 IconItem: Add roundToIconSize property
Disabling this property makes it possible to show icon of arbitrary size.

Differential Revision: https://phabricator.kde.org/D4689
2017-02-28 11:18:17 +01:00
Marco Martin
c95f6ada5e same margins as the normal button 2017-02-28 11:07:06 +01:00
Kai Uwe Broulik
83755ee136 [Desktop Themes] Bump version number
We changed some graphics (new toolbutton design, slider handle hint), this ensures
that caches are properly nuked.
2017-02-28 10:53:01 +01:00
Kai Uwe Broulik
6b70fd983b [SliderStyle] Allow providing a "hint-handle-size" element
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
2017-02-28 10:22:36 +01:00
Marco Martin
916bcbf6c0 possibility to use a fallback chain as prefix
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
2017-02-27 18:55:02 +01:00
Martin Klapetek
2fea7077c8 Make the dataengine alignment timer more precise
It can and does happen that in case of two clocks, one with seconds and one without, the one without gets 1s behind. That's because the alignment is not corrected when the difference is 1s, however in case of the clock this 1s is cruicial.

REVIEW: 123300
2017-02-26 00:58:55 +01:00
David Edmundson
07d8df77a1 Connect all connections to action in QMenuItem::setAction
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
2017-02-24 14:16:51 +00:00
Kai Uwe Broulik
1934475e48 [ConfigView] Honor KIOSK Control Module restrictions
Differential Revision: https://phabricator.kde.org/D4679
2017-02-24 12:01:06 +01:00
David Edmundson
13054c0473 Fix disabling the spinner animation when Busy indicator has no opacity
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
2017-02-23 12:31:10 +00:00
David Edmundson
e301b63685 Fix binding loop regression in FrameSVGItem
Summary:
d8a1a9eb08 introduces an unintended code
change, resizeFrame() updates the margins and in turns calls
repaintNeeded. This isn't needed and is a binding loop if we ever have a
frameSVGItem whose size depends on it's own margins.

resizeFrame is different from setEnabledBorders / setElementPrefix /
theme changes because even though we need to create a new FrameData we
know any hints and margins won't change. FrameSvgItem::updateSizes
doesn't depend on the size in any way, so always gives the same result
as before. We still, however, need to call updateSizes to populate our
FrameData structure even if the results will be the same as the previous
FrameData.

This patch that introduces a flag to updateFrameData to determine if we
should emit that size hints may have changed or not.

Test Plan:
GDB showed where the loop was.

Read the old code, and looked for differences

Ran plasmashell, checked I had no binding loop, frames including button
which have
composeOverBorder which need the new FrameData all rendered correctly.

Reviewers: #plasma, #frameworks, mart

Subscribers: mart, broulik, plasma-devel

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D4713
2017-02-22 12:31:44 +00:00
Kai Uwe Broulik
408b311662 [FrameSvgItemMargins] Don't update on repaintNeeded
FrameSvgItem already updates the margins in response to that.

Differential Revision: https://phabricator.kde.org/D4688
2017-02-21 17:48:22 +01:00
Allen Winter
c4b01b0155 qml/plasmoid/containmentinterface.cpp - fix compile with Qt5.6 2017-02-20 11:36:55 -05:00
Marco Martin
f684e6b2e0 [WIP]: integrate drop menu and filecopy drop menu
Summary:
add an optional menu parameter to processMimeData to mnually pass
an existing qmenu. folderview can use that to pass its own
filecopyjob drop qmenu to be populated with extra entries

Test Plan:
dropping a file on folderview will show a menu with
entries from both.
works both with folderview and desktop containments

Reviewers: #plasma, hein

Reviewed By: #plasma, hein

Subscribers: plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D4576

Change-Id: Iae911d4e692f2e591358959758ca6ddd131379c0
2017-02-20 11:23:18 +01:00
Ivan Čukić
5ea39a32ad Applet icons for the Plasma Vault 2017-02-16 22:58:12 +01:00
Marco Martin
3bb3cf6932 fix stylesheet 2017-02-16 12:01:39 +01:00
Kai Uwe Broulik
263f119e17 Migrate AppearAnimation and DisappearAnimation to Animators
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
2017-02-12 00:22:17 +01:00
Eike Hein
701771833e Align bottom edge to top edge of visualParent in the TopPosedLeftAlignedPopup case.
Differential Revision: https://phabricator.kde.org/D4546
2017-02-11 00:35:37 +09:00
Kai Uwe Broulik
5becf5bc11 [ConfigModel] Emit dataChanged when a ConfigCategory changes
Differential Revision: https://phabricator.kde.org/D4543
2017-02-10 12:24:59 +01:00
Marco Martin
cee709d054 use anchors instead of fillHeight
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
2017-02-08 13:36:14 +01:00
Marco Martin
b2786508e1 hardcode padding of scrollview style to 0
due to the frame borders behavior in the plasma style,
we need style padding to be zero. this fixes
scrollbars appearing when they shouldn't
2017-02-07 15:45:37 +01:00
Roman Gilg
eb39b35141 [ScrollViewStyle] Evaluate frameVisible property
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
2017-02-07 14:13:21 +01:00
Marco Martin
d8a1a9eb08 don't regenerate frames when setting every property
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
2017-02-07 13:08:27 +01:00
Guo Yunhe
50699af19a Add kleopatra icon
See https://phabricator.kde.org/D4288
2017-02-07 11:47:41 +02:00
Kai Uwe Broulik
c21ff749e6 [Button Styles] Use Layout.fillHeight instead of parent.height in a Layout
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
2017-02-06 15:20:08 +01:00
Kai Uwe Broulik
1b02bfdff7 [ContainmentInterface] Also align containment context menu to panel
There's no point in only aligning applet context menus to the panel.

Differential Revision: https://phabricator.kde.org/D4453
2017-02-06 12:31:30 +01:00
l10n daemon script
bba40b9b9d SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2017-02-05 06:07:10 +01:00
Aleix Pol
6659517bce Specify NoDisplay type
Summary:
Otherwise toBool doesn't work.
I didn't see it called anywhere as property("NoDisplay") == "true", so it
shouldn't be a problem like similar cases before

Test Plan: See upcoming patches

Reviewers: #plasma, #frameworks, davidedmundson, mart

Reviewed By: mart

Subscribers: plasma-devel

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D4396
2017-02-02 17:26:18 +01:00
Kai Uwe Broulik
031bd773b7 [ContainmentInterface] Use setSize instead of setWidth/setHeight in createApplet
This avoids needless binding updates and expensive layouting.

Differential Revision: https://phabricator.kde.org/D4352
2017-01-30 16:16:40 +01:00
Kai Uwe Broulik
d38be811e8 [FrameData] Avoid iterating keys()
Instead use iterators. Could be changed to using keyBegin or something like that potentially.

The destructor is called 400 times on plasmashell startup for me.
Before: 250,000ns
After: 110,000ns

Differential Revision: https://phabricator.kde.org/D4350
2017-01-30 15:08:09 +01:00