1592 Commits

Author SHA1 Message Date
Marco Martin
f9b4b12b38 don't make pixmaps bigger than needed
create the pixmap texture of icons just as big as icon's actualsize
for that given size, not having unneeded padding around.
It also makes plaintedWidth/paintedHeight return actually sensible
values
2021-01-07 10:19:51 +00:00
Konrad Materka
1051a4045b Fix Connections warnings
Qt 5.14 introduced new syntax for defining Connections. Fix warnings like this one:
QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
2021-01-02 19:15:59 +00:00
David Edmundson
2c07c2a455 [components] Hook up Mnemonics
Currently in buttons and tabs the mnemonics were shown, but never
actually attached to do anything.

This copies code from QQC2-desktop-style and creates an explicit
shortcut.
2020-12-31 12:41:33 +00: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
1a1e32bff3 [PlasmaComponents/TabGroup] Fix check if item inherits from Page
TabGroup had a feature where if the item inserted in the stack was a
PlasmaComponents.Page it would update a property.

The check that this property exists was previously bogus leading to
errors if TabGroup was used with non-Page items that happened to have
the same property, such as Loader
2020-12-23 01:23:43 +00:00
Carson Black
e03b9bf081 Port various components to veryShortDuration on hover 2020-12-21 14:16:16 -05:00
Carson Black
7622e09bc0 Move ListItems to use veryShortDuration for hover instead of longDuration
This will generally make UIs using ListItems feel more responsive
2020-12-21 14:00:23 -05:00
Carson Black
aecf9237cc Add veryShortDuration
This adds an veryShortDuration for UI elements that should animate near instantly, but should have a hint of smoothness.
2020-12-21 14:00:22 -05:00
Nate Graham
ddac70f40c Fix typo in 1cb14c21a9d2e8be066f764a3638ba324362ea67 2020-12-19 08:03:24 -07:00
Albert Astals Cid
ec41734969 Remove ifdefs, we require Qt 5.14 now 2020-12-18 21:46:01 +01:00
Nate Graham
1cb14c21a9 Don't allow negative calendar years
The concept is nonsensical and trying to display them crashes the
app displaying the calendar.

BUG: 430320
FIXED-IN: 5.78
2020-12-17 10:10:57 -07:00
Marco Martin
f09b46bec6 Draft: Replace QString cache IDs with a struct-based version
As it turns out, QString::number() is quite expensive, especially when
using it in a code path that is called a lot of times. So instead, use a
struct with a custom hash method as cache ID. This is significantly
faster since we do not need to do memory allocations or string
conversions.
2020-12-17 11:31:27 +00:00
Mikel Johnson
b1b91fb3eb [TabGroup] Reverse animations in RTL mode 2020-12-14 11:27:22 +00:00
Nate Graham
08c5cb671d Hide disabled contextual actions from ExpandableListItem
The concept of a disabled contextual item is nonsensical;
the set of context-sensitive actions is always supposed to be responsive
to the context. Accordingly, if the calling code has marked any actions
as disabled, let's hide them entirely.

We can't remove them from the model because they might become re-enabled
at a time when the calling app sees fit (perhaps the context has
changed). So instead we have to set visible to false and height to 0, to
ensure that the listview has the correct height. This is a hack, but I
don't see a better way to do it.

The memory penalty to having invisible but created items should be
negligible since there are only ever a maximum of about 3 items in here.
2020-12-08 15:47:22 -07:00
Mikel Johnson
904e9bb856 [Representation] Only remove top/bottom padding when header/footer is visible 2020-12-03 16:03:08 +00:00
Mikel Johnson
479c90137f [PlasmoidHeading] Use technique from Representation for inset/margins 2020-12-03 14:59:49 +00:00
Marco Martin
0e973e852f Add a Representation component
Add a Page-derived component intended as a root
for full representations.
It may go over the plasmoid edges (both on desktop and popups)
with the properties applyHorizontalPadding and applyVerticalPadding.
When the contentItem is a ScrollView or a Scrollarea,
the plasmoid margins will be automatically removed.
2020-12-02 14:05:29 +00:00
Mikel Johnson
0de09e8825 [FrameSvg] Rename insetMargin to inset 2020-12-02 11:24:03 +03:00
Mikel Johnson
1be527bd27 [PC3] Use PC3 Scrollbar in ScrollView 2020-11-29 15:53:05 +03:00
Mikel Johnson
c8e563efa7 [FrameSvg*] Rename shadowMargins to inset 2020-11-26 09:35:55 +00:00
David Redondo
472f4212a9 Finish the animation before changing the length of the progressbar highlight
This messes with the running animation and can lead to it overshooting the track.
BUG:428955
2020-11-25 07:55:24 +00:00
Nate Graham
c5fa23f858 [textfield] Fix clear button overlapping text
This change mirrors what the Kirigami ActionTextField does to solve the
same problem.

BUG: 429187
FIXED-IN: 5.77
2020-11-24 17:01:31 +00:00
Marco Martin
255eb93070 check for parent 2020-11-23 12:44:09 +01:00
Mikel Johnson
f8ae743c2f Revert "[IconItem] Add selected property"
This reverts commit 9c8cf7078eccbb4e54d5c53abe2c62090d4551b9
2020-11-20 13:26:54 +00:00
David Redondo
624fc88f7a BasicPlasmoidHeading: Use i18nd
GIT_SILENT
2020-11-20 08:57:12 +01:00
Mikel Johnson
ecb1820357 [TabBar] Add highlight on keyboard focus 2020-11-19 17:07:30 +00:00
Mikel Johnson
9c8cf7078e [IconItem] Add selected property 2020-11-19 17:07:30 +00:00
Mikel Johnson
d6656a545a [FrameSvg*] Expose shadows margins 2020-11-19 17:06:51 +00:00
Mikel Johnson
9df6f42c60 [TabButton] Align center icon and text when text is beside the icon 2020-11-14 16:40:20 +00:00
Nate Graham
90e92a9c67 [SpinBox] Fix logic error in scroll directionality
Scrolling up was decreasing the value, when the reverse should be true.
2020-11-13 10:45:54 -07:00
Marco Martin
8e0344a979 fix mobile scrollbar in RTL mode 2020-11-12 14:53:37 +01:00
Marco Martin
bf339509e3 fix RTL for sliders
colored area in sliders positioned correctly in RTL mode
2020-11-12 14:30:06 +01:00
Nate Graham
d66afc1fd0 [RoundButton] Fix binding loop in extraSpace property 2020-11-11 10:33:17 -07:00
Noah Davis
7b39642f29 [PC3 ToolBar] Don't disable borders 2020-11-10 20:08:06 +00:00
Noah Davis
6fd1f919c2 [PC3 ToolBar] Use correct svg margin properties for padding 2020-11-10 20:08:06 +00:00
Nicolas Fella
dc7d0f5b85 [pc3/scrollview] Remove pixelAligned
This is severly breaking touch scrolling. The view gets stuck during overshoot and doesn't go back to the target position.
2020-11-10 12:13:34 +01:00
Marco Martin
8b7b4f74c6 Revert "Revert "BasicPlasmoidHeading component""
This reverts commit 3a3b78c14683cb46e9e1f9f23e0e8186c78000cd.
2020-11-09 18:35:28 +00:00
Marco Martin
3a3b78c146 Revert "BasicPlasmoidHeading component"
This reverts commit 18ee2d9eed780cc52381362c370d0359fb872944.
2020-11-09 16:10:41 +01:00
Marco Martin
18ee2d9eed BasicPlasmoidHeading component
plasmoids can use it as a standard heading with a config button and a
menu with all actions. this heading would be visible only when
plasmoids are not in the systemtray which has an header that replaces it
2020-11-05 16:51:11 +00:00
Nate Graham
e845f3dbcc Always show ExpandableListitem buttons, not just on hover
Hover buttons suffer from discoverability problems and can't be used on
touch, and this component is explicitly trying to be touch-friendly. So
let's make the buttons always be visible, not just on hover.

To avoid the appearance becoming too heavy, the Buttons are turned
into ToolButtons.

BUG: 428624
FIXED-IN: 5.76
2020-11-04 13:32:08 -07:00
Carson Black
b96f23cd3a [PlasmoidHeading]: Set implicit sizing properly
The implicit sizing was set strangely, with implicitHeight not being set, and implicitWidth not following QQC2 conventions. Content height was also being set for some reason.
2020-11-04 12:57:00 -05:00
Aleix Pol
bc25ad21f0 Fix porting issue
textField does not exist here, it's called control. Also QQC2.TextField
doesn't have length, we need to check the text.
2020-11-03 02:27:39 +01:00
Noah Davis
b3ee36cfbb Add margin hints to toolbar.svg and refactor PC3 ToolBar
There's no need to redefine contentWidth and contentHeight. For controls based on QQC2 Pane, content size is implicit size if not 0, else the implicit size of the top level child item if there is only one.
2020-10-29 15:18:20 +00:00
Noah Davis
13b0bb8364 Add AbstractButton and Pane to PC3
These 2 don't contain much, but they should be a good base for making custom controls in plasmoids and plasmashell (where that makes sense)
2020-10-29 15:18:20 +00:00
Fabian Vogt
d578c2a154 Fix BusyIndicator rotating even when invisible, again
After "BusyIndicator: Do not rotate when invisible", plasmashell started
consuming 100% CPU due to plasma-nm's icon having an invisible BusyIndicator.
Adding the "visible" property back into the equation avoids this.

Third time's the charm?
2020-10-24 15:56:11 +02:00
Laurent Montel
e2c16864c8 If include is define in .h remove it if it's defined in .cpp too (scripted) 2020-10-23 08:39:01 +02:00
Aleix Pol
c3259fc2df Solve some clazy warnings
My last patch triggered me to run clazy on the project. This patch
solves some of them:
- Proper iteration of some types, saving their copy.
- compile-time connects
- prefer using connects with the 3rd argument as an object when using
lambdas.
2020-10-22 11:12:32 +00:00
Marco Martin
f93c8769ef remove dead code 2020-10-21 15:19:16 +00:00
Marco Martin
c2f281452c Better Menu in PlasmaComponents3
add the missing MenuSeparator component
support for radio buttons
like the desktop style, put icons and checkboxes in two separate columns, making them
all aligned to each other when there is a combination of neither, only icon, only checkbox, both
2020-10-21 15:19:16 +00:00
Laurent Montel
fa06d610dd Remove not implemented method 2020-10-19 07:12:43 +02:00