Commit Graph

1230 Commits

Author SHA1 Message Date
Marco Martin
79fb4ebfa7 other preload microoptimizations
Summary:
make svgitem schedule a polish right when it's done loading

ScrollView now forces to layout items as soon is created, to preload items
before the window is shown

remove useless include

Test Plan:
possible to preload (almost) the whole systray with less hacks
on that part (see D10692)

Reviewers: #plasma, davidedmundson, broulik

Reviewed By: #plasma, broulik

Subscribers: davidedmundson, broulik, plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D10722
2018-02-22 18:42:14 +01:00
David Edmundson
bf4facd8c1 Set IconItem default to smooth=true
Summary:
This changes between linear and nearest neighbour filtering.

Docs for QtQuick say:
In Qt Quick 2, this property has minimal impact on performance.

Generally we round to icon size anyway and resize the underlying images
anyway, so this will have no impact.

Reviewers: #plasma, apol

Reviewed By: apol

Subscribers: plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D10653
2018-02-21 13:39:42 +00:00
Michail Vourlakos
1ff405cca5 fix RTL appearance for ComboBox
Summary:
-- when the combobox isnt inside the main Item
but rather a sub-Item it doesnt inherit the
LayoutMirroring properties. This is a workaround
to handle that behavior.
QTBUG: https://bugreports.qt.io/browse/QTBUG-66446

Test Plan:
checkout that LayoutMirroring works properly in
such case

Reviewers: #plasma, mart, safaalfulaij

Reviewed By: safaalfulaij

Subscribers: safaalfulaij, plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D10592
2018-02-19 20:44:37 +02:00
Kai Uwe Broulik
c05b1bdec7 [Icon Item] Set filtering on FadingNode texture
Ensures the fading node's texture has the same filtering as the regular node,
otherwise during transition the icon could show scaling artefacts.

Differential Revision: https://phabricator.kde.org/D10533
2018-02-15 13:32:57 +01:00
Aleix Pol
581dc48ff8 Initialize m_actualGroup to NormalColorGroup
Reviewers: #frameworks, dfaure

Reviewed By: dfaure

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D10464
2018-02-13 15:32:03 +01:00
Aleix Pol
3e4b26452a Make sure the FrameSvg and Svg instances have the right devicePixelRatio
Summary:
On wayland (at least) it's initialized when the window is assigned, so
we need to listen to the itemChanged to adopt it.

Test Plan: manual testing

Reviewers: #plasma, hein

Reviewed By: #plasma, hein

Subscribers: hein, plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D10420
2018-02-12 14:37:23 +01:00
Aleix Pol
a02e91a271 Define property in Units.qml for the Plasma styles
Summary: Much like it is specified by kirigami itself

Test Plan: Now I don't get a warning

Reviewers: #plasma, mart

Reviewed By: #plasma, mart

Subscribers: plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D10225
2018-02-01 19:57:45 +01:00
Friedrich W. H. Kossebau
551e92b10f Include cstdlib for std::free
clang/freebsd can has satisfaction that way (hopefully)
2018-01-31 23:55:45 +01:00
Fredrik Höglund
46121d5848 windowthumbnail: Fix the GLXFBConfig selection code
Check that the sizes of the color channels in the fbconfig match those
in the window visual.

This fixes a 2-10-10-10 fbconfig being choosen for the ARGB32 visual.

Differential Revision: https://phabricator.kde.org/D10173
Signed-off-by: Fredrik Höglund <fredrik@kde.org>
Acked-by: David Edmundson <kde@davidedmundson.co.uk>
2018-01-31 14:56:54 +01:00
Kai Uwe Broulik
f31e7860d9 [Default Tooltip] Fix sizing
Unset the Label's default height which completely confuses the renderer either shifting the item vertically (e.g. when toggling
system tray popup), or letting it get too wide (e.g. when moving from a two-line tooltip to a one-line tooltip).
Also let the Layouts figure out sizing rather than trying to overrule it with flaky values.

BUG: 386260
BUG: 389371

Differential Revision: https://phabricator.kde.org/D10077
2018-01-26 15:49:06 +01:00
Marco Martin
f906178713 parametrize qqc2 version
Summary:
for styles in order to work at all they need to import
the latest available qqc2 version installed in the system
or any app using new qqc2 feature will fail to load.
do like in qqc2-desktop-style and set the import version
at build time

Test Plan: all generated files have 2.3 here as version and apps using qqc2 still oload

Reviewers: #plasma, bshah

Reviewed By: #plasma, bshah

Subscribers: plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D10074
2018-01-24 13:32:35 +01:00
Marco Martin
af00946f81 don't multiply svg sizes by devicepixelratio
Summary:
when the native high dpi scaling is enabled, some things gets scaled two times,
as sizes taken from svgs should *not* be manually scaled by devicePixelRatio

Test Plan:
works correctly on wayland, svg.elementSize will have to be tweaked in x11 to
return a value scaled by scalefactor, to homogenize the behavior compared to
native qt high dpi scaling.
to return a value scaled by scalefactor for this qml code to work there too.
I advise everybody with high dpi laptops to test this on both wayland and x11

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: hein, broulik, plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D9286
2018-01-23 15:58:55 +01:00
Alexander Akulich
55efe5ae63 [Calendar] Adjust the calendar toolbar anchors
Summary:
Horizontally align the toolbar row to the days/month/etc grid canvas.

(The bar was used to be a few pixels wider)

Test Plan:
Before: {F5514329}

After: {F5514330}

Reviewers: #plasma, broulik

Reviewed By: #plasma, broulik

Subscribers: aacid, davidedmundson, broulik, plasma-devel, #plasma, #frameworks

Tags: #frameworks, #plasma

Maniphest Tasks: T7499

Differential Revision: https://phabricator.kde.org/D9019
2018-01-16 13:57:22 +03:00
Kai Uwe Broulik
639e8684e3 [Icon Item] Treat sources starting with a slash as local file
We have a special case for sources starting with "file://" but a "/" also represents an absolute path and shouldn't
conflict with icon theme names.
Kicker sets a custom image as local path and then we would end up trying to load it as a QIcon::fromTheme eventually.
This will cause the implicit size of the icon item to stay at its default as we only check a custom implicit size
for a source QImage or an SVG. Moreover, this potentially introduces scaling artefacts.

Differential Revision: https://phabricator.kde.org/D9812
2018-01-15 10:22:18 +01:00
Michail Vourlakos
547dade2f8 fix RTL appearance for ComboBox
Summary:
--PlasmaComponents3.ComboBox now appears correctly
its list items in RTL environments by aligning them
to the right

BUG: 387558

Test Plan:
check the combobox list both in RTL and LTR environments
in order to confirm that the list items are aligned correctly

Reviewers: #plasma, mart

Reviewed By: #plasma, mart

Subscribers: mart, plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D9275
2018-01-13 03:24:14 +02:00
Laurent Montel
d1949d9149 Const'ify, use nullptr 2017-12-25 18:41:50 +01:00
Marco Martin
e3fba25754 move kirigami plasma styles here
solves a nasty dependency loop
(and kirigami is supposed to be tier1)
2017-12-14 12:56:06 +01:00
Montel Laurent
d14d50a668 Add more explicit 2017-12-13 07:52:10 +01:00
Montel Laurent
7f0c023d3f Use nullptr + add explicit 2017-12-13 07:36:22 +01:00
Marco Martin
b2f61f8e3c disappearing scrollbars on mobile
Summary:
like other platforms, on mobile devices make scrollbars visible only when
dragging/flicking, behavior on desktop unchanged
it introduces a runtime dependency on kirigami, but was already kinda there
but broken as the Settings singleton was already used.
if this can't be done, i'll add something in plasmacore which reads as well the
QT_QUICK_CONTROLS_MOBILE environment variable

Test Plan: scrollbar disappearing with the variable set, normal behavior otherwise

Reviewers: #plasma, bshah, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: davidedmundson, plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D9287
2017-12-12 15:42:47 +01:00
Michail Vourlakos
71f8f16fea [RTL] - align properly the selected text for RTL
Summary:
--align selected text correctly for
PlasmaComponents2.ComboBox taking into account
RTL.

BUG: 387415

Test Plan:
use ComboBoxes in RTL and LTR in order
to check a proper behavior

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: broulik, plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D9126
2017-12-05 19:13:40 +02:00
Eike Hein
a570254e1a Don't update when the underlying FrameSvg is repaint-blocked
Summary:
When the component completes `FrameSvg::setRepaintBlocked(false)`
is called, which calls `updateFrameData`, which emits
`repaintNeeded`, which is connected to `doUpdate` anyway.

This saves one `doUpdate` per instanciation. The reason for that
is as follows:
* The concept or repaint blocking is implemented in `FrameSvg`,
  which inherits from `Svg`.
* The `repaintNeeded` signal connected to `doUpdate` is the one
  in `Svg`.
* `Svg` code emits `repaintNeeded` liberally even when repaints
  are blocked, since it doesn't know anything about this.

Hence we check if repaints are blocked in doUpdate and abort,
implementing the QQmlParserStatus interface in the right class.

Reviewers: #plasma, davidedmundson, mart

Subscribers: plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D9138
2017-12-04 00:12:11 +09:00
Kai Uwe Broulik
ab8915bc12 [FrameSvgItem] Don't create unneccessary nodes
If a border isn't enabled there's no point in creating a node for itIf a border isn't enabled there's no point in creating a node for it.

Differential Revision: https://phabricator.kde.org/D9121
2017-12-03 12:40:31 +01:00
Ben Cooksley
df09180d31 The #warning directive is not universal and in particular is NOT supported by MSVC
Remove the directive to restore compilation on Windows.
Ref D9108

CCMAIL: aleixpol@kde.org
2017-12-03 07:03:09 +13:00
Kai Uwe Broulik
f8e3a16040 [IconItem] Use ItemSceneHasChanged rather than connect on windowChanged
Saves a connection and also only schedule if we actually have a window.

Differential Revision: https://phabricator.kde.org/D9111
2017-12-02 18:13:19 +01:00
Kai Uwe Broulik
da2b6e270f [Icon Item] Explicitly emit overlaysChanged in the setter rather than connecting to it
There's literally just one place where this thing changes so just emit the signal
there and call it a day.

Differential Revision: https://phabricator.kde.org/D9112
2017-12-02 18:13:19 +01:00
Aleix Pol
1f9b5ed657 Performance
Summary:
Remove splitting + joining of a string just to remove the beginning of a
string.
Remove double look-up.
Solves Clazy warnings

Reviewers: #frameworks, #plasma, hein

Reviewed By: #plasma, hein

Subscribers: hein, plasma-devel

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D9109
2017-12-02 16:22:03 +01:00
Aleix Pol
b8b8a69fd1 Remove implicit string casting
Summary: Follow the KF5 guidelines

Test Plan: Plasma shell starts

Reviewers: #plasma, #frameworks, sebas

Reviewed By: #plasma, sebas

Subscribers: plasma-devel

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D9108
2017-12-02 15:44:14 +01:00
Aleix Pol
f8047e86b2 Reduce the amount of spurious property changes on ColorScope
Summary:
At the moment whenever something changed we were emitting colorGroupChanged
and then every color would recompute. This would end up being emitted
over 10 times at plasma startup so far.
This patch makes sure that the property will only be emitted if the color
group actually changes.

Test Plan:
Ran plasma, didn't notice issues.
I don't see all of the changes on the property anymore

Reviewers: #plasma, mart, davidedmundson

Reviewed By: #plasma, mart

Subscribers: davidedmundson, plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D8917
2017-12-02 12:45:57 +01:00
Kai Uwe Broulik
9066c232b4 [Icon Item] Emit validChanged only if it actually changed
Differential Revision: https://phabricator.kde.org/D9102
2017-12-02 11:40:02 +01:00
Eike Hein
4779f9564a Suppress unnecessary scroll indicators if the flickable is a ListView with known orientation
Summary:
ListView.atYEnd is notoriously buggy and sometimes will cause indicators
to blink in and out of existence where not needed.

Reviewers: #plasma, mart

Subscribers: plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D9089
2017-12-01 23:35:19 +09:00
Montel Laurent
5d9aa6816f We depend against 5.7 2017-11-29 21:10:48 +01:00
Kai Uwe Broulik
facaaf93d0 [PlasmaComponents Menu] Set WA_TranslucentBackground on the underlying QMenu
This ensures the menu can have nice round corners with Breeze and Oxygen. The same had already been done in ContainmentInterface's menu.

CHANGELOG: Fixed an issue where PlasmaComponents Menu would appear with broken corners

CCBUG: 381799

Differential Revision: https://phabricator.kde.org/D8965
2017-11-24 10:40:48 +01:00
Aleix Pol
28d9c7146e Remove double lookup 2017-11-20 16:13:46 +01:00
Aleix Pol
3e17a2d0a2 Remove duplicate boilerplate code
Summary: Don't replicate logic present in ::colorGroup for every color() call

Reviewers: #plasma, #frameworks, mart

Reviewed By: #plasma, mart

Subscribers: plasma-devel

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D8914
2017-11-20 16:12:41 +01:00
Aleix Pol
aa4aa72d63 Synchronize the component with the one in Kirigami
Summary: Using the height property together with paintedHeight had binding loops.

Reviewers: #plasma, mart

Reviewed By: #plasma, mart

Subscribers: broulik, plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D8870
2017-11-20 13:07:15 +01:00
Aleix Pol
11c9206bf6 Reduce spurious signal emissions
Summary:
We were reporting that the margins were changing whenever anything changed
in a FrameSvg, this patch makes sure we are only reporting the changes
when it actually changes.
This also fixes a binding loop in Desktop.qml from plasma-desktop.

BUG: 382233

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: broulik, davidedmundson, plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D8809
2017-11-16 16:18:04 +01:00
Marco Martin
9ea4774050 install Switch stuff 2017-11-13 15:31:03 +01:00
Kai Uwe Broulik
3ebdd64e6b Optimize SortFilterModel role names
* Reserve m_roleIds
* Avoid double lookup contains+value but use default value argument
* Constify

Differential Revision: https://phabricator.kde.org/D8639
2017-11-06 15:17:42 +01:00
Kai Uwe Broulik
d51456bdfc Remove DataModel::roleNameToId
It is unused and returned -1 whereas SortFilterModel would return Qt::DisplayRole

Differential Revision: https://phabricator.kde.org/D8638
2017-11-06 15:17:15 +01:00
Marco Martin
fc653a70a9 manually draw the circle arc
don't use the qqc2 private implementastion as change and will
break with Qt 5.10
2017-10-31 13:45:39 +01:00
Kai Uwe Broulik
c52a6c5748 [PlasmaComponents Menu] Add ungrabMouseHack
Ensures the PlasmaComponents.Menu doesn't confuse MouseArea states.

Differential Revision: https://phabricator.kde.org/D8445
2017-10-25 15:09:49 +02:00
Fabian Vogt
4f43c236e3 Fix org.kde.plasma.calendar with Qt 5.10
Summary:
Module internal types are not implicitly available anymore simply by placing
them inside the module's main directory. It is now necessary to mention them
as internal types in the qmldir file.

See qtdeclarative commits 22a2cc43387ec3b9f74a6c01f8665378a4541147 (introduced
the change) and 930aea8b9ca59a24838cf7f279653e3b2ee40cee (explanation)

Test Plan:
Built whole stack with Qt 5.10. The digital clock plasmoid does not
load due to the DaysCalendar type not being available. With these changes to
qmldir and a reload of the plasmoid it works.

Reviewers: #plasma, broulik

Reviewed By: #plasma, broulik

Subscribers: broulik, #frameworks, plasma-devel

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D8077
2017-10-01 23:06:24 +02:00
Kai Uwe Broulik
c1e432065f sceneGraphBackend() is new in Qt 5.9 2017-09-29 10:48:37 +02:00
Kai Uwe Broulik
bb6b170516 [FrameSvgItem] Iterate child nodes properly
Documentation says "Children are stored internally as a linked list, so iterating over the children via the index is suboptimal."

Differential Revision: https://phabricator.kde.org/D8046
2017-09-28 23:05:36 +02:00
Marco Martin
9e7d02cde2 pick up the proper positive/neutral/negative colors 2017-09-28 16:14:33 +02:00
David Edmundson
6df656252b Add new component for the greyed out labels in Item Delegates.
Summary:
Plasma code is full of Label {opacity: 0.6}. We shouldn't be hardcoding
style into a UI, especially with magic numbers.

This adds a new component that does the same thing but will allow
plasmoids to write more semantic code.

Reviewers: #plasma, hein

Reviewed By: #plasma, hein

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

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D4831
2017-09-27 15:50:57 +01:00
David Edmundson
daef5c8b6b Fix FrameSVGItem with the software renderer
Summary:
Software rendering (at time of writing Qt5.10) doesn't seem to like our
tiling/stretching in the 9-tiles.
Also when using QPainter it's arguably faster to create and cache
pixmaps of the whole frame, which is what the slow path of FrameSVGItem
does.

Test Plan: Ran FrameSVG test then plasma shell with scene device set

Reviewers: #plasma, broulik

Reviewed By: #plasma, broulik

Subscribers: plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D8013
2017-09-27 15:50:49 +01:00
David Edmundson
94235482f9 Don't animate IconItem in software mode
Summary:
IconItem uses a gorgeous shader to fade between two states. This doesn't
work with software rendering.

Given software rendering is a second class citizen, just skip the
animation.

Test Plan:
Hovered over kickoff.
Went from one to the other, without temporarily disappearing

Reviewers: #plasma, broulik

Reviewed By: #plasma, broulik

Subscribers: plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D8014
2017-09-27 15:50:44 +01:00
Marco Martin
b62118c90c possibility to set an attached colorscope to not inherit
this makes an easy bridging between the plasma and kirigami theming
reviewed-by:Eike Hein
2017-09-19 16:42:08 +02:00