Commit Graph

128 Commits

Author SHA1 Message Date
Christophe Giboudeaux 1587ead53e Fix typos found by codespell
GIT_SILENT
2021-07-14 11:01:00 +02:00
Alexander Lohnau e54f5b793e Remove defunct test dataengine
The K_EXPORT_PLASMA_DATAENGINE_WITH_JSON expects a JSON file. But
considering that nobody complained about this and it has been broken for
years we can get rid of it.
2021-06-11 09:39:23 +00:00
Nicolas Fella 6215355f28 Remove unneeded KIO linkage 2021-04-27 22:07:15 +02:00
Aleix Pol 2d5a492df6 Remove unused import from test 2021-04-26 17:00:48 +02:00
Nicolas Fella 28811f2e7f Remove unused includes 2021-04-02 23:44:13 +02:00
Ahmad Samir c0274df69a Run clang-format on all cpp/h files
NO_CHANGELOG
2021-03-13 17:35:34 +00:00
Nate Graham 5447cef2d8 Port to singleton Units
The context property version is slower to access and won't be supported
in Qt6. Let's port away from it and use the singleton version instead.

Here was my full process for making this change:

1. Made the change with `find . -name '*.qml' | xargs perl -pi -e 's/units\./PlasmaCore\.Units\./g'`
2. Verified no more occurrences with `grep -r " units."`
3. Made sure this didn't change any comments in a silly way by inspecting the output of `git diff | grep "+   " | grep "//"`
4. Manually inspected the full git diff to make sure there were no other unintentional or silly changes (there were none)
5. verified that all changed files have the PlasmaCore import with the correct name with `for FILE in `git status | grep modified | cut -d ":" -f 3`; do grep -q "as PlasmaCore" $FILE || echo "$FILE needs the PlasmaCore import"; done` (one needed the import)
2021-03-07 13:34:47 +00:00
Laurent Montel bc9eb362c8 Remove not implemented method 2021-03-05 20:50:16 +01:00
Kai Uwe Broulik 85f136ff41 [PC3 ProgressBar] Set binding for width
Otherwise the progress bar will never update its size when it was indeterminate
at one point..

BUG: 430544
2020-12-29 17:35:05 +00:00
David Edmundson b1364fa601 Fix broken background
In commit c709076d9c the SVG got somehow
broken leading to black rectangles in all cases where it was used.

This commit reverts to the last working version, then reapplies the
"thick margin" from the change.

A test is supplied to show all our frameSVGs to hopefully make this
easier to spot if it happens again.

BUG: 430390
2020-12-17 12:41:38 +00:00
Noah Davis 37a95de3f3 Add missing license headers 2020-09-01 12:53:40 +00:00
Noah Davis 54069ee94c Remove minimum size test from PC3 Button test
Also add disabled buttons to the PC3 Button test

The minimum size test didn't make any sense. You don't normally set the implicitWidth of a button to Layout.minimumWidth in a Layout.
2020-08-31 10:18:22 +00:00
Noah Davis 3509283d63 Make PC3 BusyIndicator visuals keep a 1:1 aspect ratio
Updated the tests so that you can see if the aspect ratio is correct.

Made an animated transition for when `control.running` is false.

Removed the code that updates the RotationAnimator when control.running changes since it didn't work.

Set padding to 0 (see comment).

BUG: 425504
2020-08-23 15:08:32 -04:00
Noah Davis 8fe3f656e8 Add PC3 RoundButton test and add flat buttons to PC3 Button test 2020-08-20 21:06:34 -04:00
Noah Davis 13882a60e1 Fix visual glitches and improve the layouts of component tests 2020-08-19 14:00:44 -04:00
Andreas Cord-Landwehr d10afb5d2a plasma-framework: Convert copyright statements to SPDX expressions 2020-08-13 19:08:54 +00:00
Nate Graham 711789908b Drop implicit minimum sizing from PC2 and PC3 Buttons
For the following reasons:
- It can break and look bad on Plasma Mobile which uses the Plasma style
- It makes buttons with icons and short text look visually unbalanced
- QStyle and QML desktop style buttons do not do this so it's a source
  of inconsistency

Tests are adjusted to all pass. Stuff looks better to my eye.
2020-08-10 18:47:49 +00:00
Nate Graham b7ee696250 [PlasmaComponents3] Honor icon.[name|source] property
Since a checkbox is a subclass of AbstractButton, it can be given an
icon. QWidgets checkboxes will faithfully display this icon, but
PlasmaComponents3 ones will not. They should. :)

I will submit a similar change for the QQC2 checkbox style
to make them consistent.
2020-07-23 14:38:14 +00:00
Laurent Montel e45a66139a Use camelcase include. (scripted) 2020-07-08 07:44:43 +02:00
Laurent Montel 48f60533b9 [plasma-framework] make it compiles without foreach
Summary: compile without foreach

Test Plan: autotest ok

Reviewers: dfaure, apol

Reviewed By: dfaure, apol

Subscribers: ahmadsamir, nicolasfella, broulik, apol, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D19913
2020-04-17 06:47:04 +02:00
Harald Sitter 6e39c1de5b do not install testengine
Summary:
by default users have to opt out of BUILD_TESTING meaning everyone would
by default build and get testengine installed even though it serves no
purpose in production. this also includes distros as I've noticed :O

do not install the engine, same as testplugin isn't getting installed.

(I am actually thinking throwing it away as a whole may make sense; it
 serves no real purpose over any other engine)

Reviewers: mart, apol

Reviewed By: apol

Subscribers: broulik, apol, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D28463
2020-04-06 12:40:42 +02:00
Marco Martin 0b89e7f3f0 Buttons: allow to scale up icons
Summary:
always scale icons unless a size is specified in the api.
this makes icon sizing more in line with plasma components 2

Test Plan:
{F8129062}

{F8129064}

{F8129065}

Reviewers: #plasma, broulik

Reviewed By: #plasma, broulik

Subscribers: broulik, ngraham, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D27628
2020-03-02 14:42:15 +01:00
Marco Martin ba0b637de9 fix layout size hints for button labels
Summary:
icon sizes and label placements tested correct in  several scenarios

* control.icon.width/height is used as maximum size of the icon
* if the button is smaller icons always scale down
* icons stay ccentered regardless of button size when there is no text

Test Plan:
fixes icon sizes without workarounds like D27260
{F8108705}

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: davidedmundson, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D27460
2020-02-19 12:12:41 +01:00
George Vogiatzis dccf6c4dd6 [Tests]Make radiobutton3.qml use PC3
Summary: Correct test radiobutton3.qml to use Plasma Components 3 instead of 2.

Test Plan:
Run `qmlscene radiobutton3.qml`
Before:
Misaligned button and big height. (bug in PC2 radiobutton)
After:
Correct height and alignment between button and button's text.

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: ngraham, davidedmundson, ndavis, kde-frameworks-devel

Tags: #frameworks, #plasma

Differential Revision: https://phabricator.kde.org/D27082
2020-02-04 11:14:14 -07:00
Marco Martin e9468a8442 add a manual test on the highlight look 2020-01-09 17:35:57 +01:00
Aleix Pol 66122410a1 Enable wheel events on Slider {}
Summary:
So far PC3 version of the slider doesn't react to events, this change
enables it.

Test Plan: Used it with a test.

Reviewers: #plasma, broulik, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: davidedmundson, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D26055
2019-12-30 18:49:56 +01:00
David Edmundson fecb716b87 Add test for combobox from QQC2 2019-12-12 15:29:42 +00:00
David Edmundson a3acfbfce6 Add manual test for changing colorscope in components
Summary: For quickly other bugs in PC3

Test Plan:
Opened qmlscene on some files
It's only for unit tests anyway

Subscribers: kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D25822
2019-12-09 20:59:57 +00:00
Yuri Chornoivan 052a81f755 Fix minor issues found by EBN and typos 2019-11-10 12:06:10 +02:00
David Edmundson 4ecdbe9622 Add manual tests for PC3
Summary:
These were super useful for spotting bugs in PC2.
They show many many issues already.

Visually they should match PC2. They don't

Some API doesn't map directly. Those tests
were removed.

Test Plan:
Opened in qmlscene
Everything binds correctly. Some things look horrible.

Reviewers: #plasma

Subscribers: kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D23827
2019-09-11 11:11:47 +02:00
Aleix Pol d3b22f8828 Port trivial connects to the new style 2019-08-30 17:26:54 +02:00
David Edmundson 0bd2ea178f Add test for buttons with icon height 2019-05-13 09:54:44 +01:00
Yuri Chornoivan 72ca2f79e0 Fix minor EBN issues and typos 2018-10-22 21:05:29 +03:00
Friedrich W. H. Kossebau 30cbc2dc33 Use more nullptr 2018-07-02 00:16:21 +02:00
Laurent Montel 70a274ad3a Use override 2018-05-23 08:05:40 +02:00
Aleix Pol 49ef90bcb9 Don't show the background if Button.flat
Summary: Otherwise the flat property is ignored

Test Plan: Tested on KDE Connect port to use PlasmaComponents

Reviewers: #plasma, mart

Reviewed By: #plasma, mart

Subscribers: mart, #frameworks

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D11652
2018-04-17 13:44:11 +02: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
David Edmundson ee2b12be04 Add extra visual indicator for Checkbox/Radio keyboard focus
Summary:
This draws a line underneath a Plasma checkbox label when it has
keyboard focus. This is needed as when an item is checked, the focus
shadow is practically invisible.

Visuals when clicking is completely unchanged
This brings it more in line with our QStyle.

Test Plan: Attached runtime tests

Reviewers: #plasma, #vdg, mart

Reviewed By: #plasma, mart

Subscribers: plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D7819
2017-09-19 13:50:44 +01:00
Kai Uwe Broulik 21f954d94d [PlasmaComponents Menu] Don't crash on null action
You can assign a QAction as "action", this way you can just pass it e.g. plasmoid.action("configure").
However, when assigning a null action as can happen with kiosk restrictions, it would crash
as it assigns m_action the nullptr but never checks for that.

This patch ensures we always have a QAction, creating a new empty one, if neccessary.
Also deletes our own action if an external one is assigned

Differential Revision: https://phabricator.kde.org/D6608
2017-07-11 12:23:39 +02:00
Kai Uwe Broulik ceeb57d17f [PlasmaComponents Menu] Add maximumWidth property
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
2017-01-25 18:02:33 +01:00
David Edmundson cb9ec94625 Add an optional reveal password button to TextField
Similar to KPasswordWidget in kwidgetaddons

Also fixes:
- the clear button still being clickable when not enabled
- RTL icons
- Updating the right margin correctly

REVIEW: 128660
2016-08-15 14:34:15 +01:00
David Faure 7a9855ec77 plugintest: remove dead code 2016-06-12 15:54:47 +02:00
David Faure fc673146a6 Fix plugintest crash on startup: qApp needed. 2016-06-12 15:14:35 +02:00
Marco Martin f3c05034d9 Selected state for Plasma::Svg and IconItem
Like KIconloader, support a Selected state, in IconItem,
as in all generic svgs/framesvg
it replaces the text color with HighlightedText and the
background color with HighlightColor

Change-Id: Id97a527405d2c3feed75a172f05547defdbf440c
REVIEW:127975
2016-05-31 11:10:47 +02:00
Aleix Pol 9f62532674 Fix most of Clazy warnings in plasma-framework
REVIEW: 126672
2016-02-29 00:13:41 +01:00
Marco Martin 5b79da30f0 support simple QObjects too
support ColorScope in Svg as well (that's not a QQuickItem)
2016-01-08 16:11:19 +01:00
Marco Martin e565c5c225 rework ColorScope
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
2016-01-07 11:06:40 +01:00
Alex Richardson f35e514b7d Use SERVICE_TYPES parameter to kcoreaddons_desktop_to_json() 2015-12-09 23:10:41 +00:00
l10n daemon script 01f4cf59ea 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"
2015-11-04 17:07:45 +00:00
David Edmundson 1a4c1d7eeb Fix Button minimumWidth property
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
2015-10-19 11:30:19 +01:00