Add iconSize property to PC2 ToolButton
AbandonedPublic

Authored by ndavis on Apr 6 2020, 3:57 AM.

Details

Reviewers
mart
Group Reviewers
Plasma
Summary

iconSize sets the size of the ToolButton's icon if it is set to a value.
If no value is set, the ToolButtonStyle IconItem's minimumWidth is bound to buttonContent.height like it was before this patch and iconSize is bound to the paintedWidth of the icon.

Usecases:

  1. In places where a custom icon size is wanted, a developer must create an IconItem nested in the ToolButton. This makes it so a developer only needs to change a single property.
  2. In places where a ToolButton has an icon, a developer cannot get the size of the icon unless they use a nested IconItem instead of the ToolButton's icon. This makes it so a developer only has to bind to iconSize.
Test Plan
  1. Set iconSize for a PC2 ToolButton and see if the icon size is changed.
  2. Bind the width of a component to a ToolButton's iconSize and see if it works.3. Do step 2, but don't do step 1 and see if it works

Diff Detail

Repository
R242 Plasma Framework (Library)
Branch
pc2-toolbutton-iconSize (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 24816
Build 24834: arc lint + arc unit
ndavis created this revision.Apr 6 2020, 3:57 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptApr 6 2020, 3:57 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
ndavis requested review of this revision.Apr 6 2020, 3:57 AM
ndavis retitled this revision from Add iconSize to PC2 ToolButton to Add iconSize property to PC2 ToolButton.Apr 6 2020, 3:57 AM
ndavis edited the summary of this revision. (Show Details)Apr 6 2020, 4:01 AM
ndavis added a comment.EditedApr 6 2020, 4:09 AM

I'm getting a binding loop: <Unknown File>: QML QQuickLayoutAttached: Binding loop detected for property "minimumWidth"
I'm guessing that's Layout.minimumWidth inside the ToolButtonStyle IconItem

ngraham added a subscriber: ngraham.Apr 6 2020, 4:20 AM

If the developer has these needs, why not port to the PC3 version, which has this feature already?

ndavis added a subscriber: broulik.Apr 6 2020, 4:30 AM

If the developer has these needs, why not port to the PC3 version, which has this feature already?

@broulik said we can't do that for some things like notifications and KRunner because of how the tooltips work.

Darn. Maybe we should fix the PC3 tooltips though? :)

ngraham added a reviewer: mart.Apr 6 2020, 4:33 AM

Adding Marco as a reviewer since I know he just looooooooooooooooves ToolButton sizing. :)

ndavis added a comment.Apr 6 2020, 4:35 AM

Adding Marco as a reviewer since I know he just looooooooooooooooves ToolButton sizing. :)

This doesn't actually affect toolbutton sizing, just icon sizing. Although, if you make the icon size too big, it'll bleed out of the button.

ndavis added a comment.Apr 6 2020, 4:39 AM

Darn. Maybe we should fix the PC3 tooltips though? :)

Maybe, but I don't know what that would entail.
For more context: I asked Kai about porting notifications to PC3 so that I could fix the size of icons with larger fonts. He said he wouldn't accept patches that do that for notifications or KRunner because of the issues with PC3, so I figured it would be easier to just add icon sizes to PC2.

He said he wouldn't accept patches that do that for notifications or KRunner because of the issues with PC3

I doubt that's what was meant.

There have definitely been some bad patches that blindly ported to PC3 without adequate testing. That's highly problematic.

But use of PC3 with work put into fixing components of issues that arise should certainly be a target. I'll bring it up in the meeting.

mart added a comment.Apr 6 2020, 10:34 AM

I don't think we should put any new feature in plasmacomponents2. it will be removed in qt6 anyways and work should be more concentrated to a) port away from it altogether abd b) if the pc3 version doesn't work, put effort in fixing that

ndavis abandoned this revision.Apr 6 2020, 11:44 AM