[kcmkwin/kwindecoration] Fix visuals of KCM decorations' buttons tab
ClosedPublic

Authored by vpilo on Jan 5 2019, 10:33 AM.

Details

Summary

BUG: 346222
BUG: 399992
BUG: 356076
FIXED-IN: 5.15

The QML changes make the tab look and feel less awful:

  • make the fake window borders stand out less
  • add margins to drop area to make it easier to drop buttons on the title bar (fixing 346222)
  • change cursor to a non-pointing one [1]

[1] Drag&drop: When dropping, we receive the position of the button being dropped,
not of the cursor. The two can be far (when starting drag by moving the cursor fast):
which makes the whole experience very confusing, as the user means to drop at cursor location.

Test Plan

Tested drag/drop: same (messy) behavior as before, but can now drop more loosely around titlebar items

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
vpilo created this revision.Jan 5 2019, 10:33 AM
Restricted Application added a project: KWin. · View Herald TranscriptJan 5 2019, 10:33 AM
Restricted Application added a subscriber: kwin. · View Herald Transcript
vpilo requested review of this revision.Jan 5 2019, 10:33 AM
ngraham edited the summary of this revision. (Show Details)
ngraham requested changes to this revision.Jan 6 2019, 6:40 AM
ngraham added a subscriber: ngraham.

Can confirm reduced awfulness. But while you're at it, why not make it entirely non-awful? :) The problem here is the tiny tiny tiny drag area in the fake titlebar. I think the height of the fake titlebar could be increased by a factor of 2 or even 3, which would make this UI much more pleasant to use.

kcmkwin/kwindecoration/qml/ButtonGroup.qml
52

This cursor should only be used when actually dragging (i.e. when the mouse is down), not when a drag is merely possible. For that, a more appropriate cursor might be Qt.SizeAllCursor.

kcmkwin/kwindecoration/qml/Buttons.qml
179

Same

This revision now requires changes to proceed.Jan 6 2019, 6:40 AM

Also, while you're touching this, I bet it would be really simple to fix https://bugs.kde.org/show_bug.cgi?id=399992.

Browsed other bug reports for this KCM. This patch also fixes https://bugs.kde.org/show_bug.cgi?id=356076

And it might already fix https://bugs.kde.org/show_bug.cgi?id=365254 due to the lowered opacity.

Improving the UI like I suggested would probably also be enough to fix https://bugs.kde.org/show_bug.cgi?id=350122.

vpilo marked an inline comment as done.Jan 6 2019, 11:19 AM

Also, while you're touching this, I bet it would be really simple to fix https://bugs.kde.org/show_bug.cgi?id=399992.

Indeed! Fix'd

kcmkwin/kwindecoration/qml/ButtonGroup.qml
52

looks indeed better!

vpilo marked an inline comment as done.Jan 6 2019, 4:41 PM
This comment was removed by vpilo.
vpilo added a comment.Jan 6 2019, 4:46 PM

Browsed other bug reports for this KCM. This patch also fixes https://bugs.kde.org/show_bug.cgi?id=356076

And it might already fix https://bugs.kde.org/show_bug.cgi?id=365254 due to the lowered opacity.

Improving the UI like I suggested would probably also be enough to fix https://bugs.kde.org/show_bug.cgi?id=350122.

re: 365254, I think it could look better with arrow-down instead. Thoughts?

vpilo added a comment.Jan 6 2019, 5:31 PM

Can confirm reduced awfulness. But while you're at it, why not make it entirely non-awful? :) The problem here is the tiny tiny tiny drag area in the fake titlebar. I think the height of the fake titlebar could be increased by a factor of 2 or even 3, which would make this UI much more pleasant to use.

The problem is that the entire UI is a mess; I had initially that target, but couldn't really make it work.
But thanks to your suggestion, I noticed that doubling the titlebar and buttons drag&drop is much better - I will fix it all in another patch (too many changes here already).

vpilo updated this revision to Diff 48814.Jan 6 2019, 5:43 PM
  • [kcmkwin/kwindecoration] Fix visuals of KCM decorations' buttons tab

Nice work. Go ahead and add

BUG: 399992
BUG: 356076

Regarding the icon, how about emblem-remove? Here's how that looks at half the current size and with a bit of padding between it and the text:

davidedmundson added inline comments.
kcmkwin/kwindecoration/qml/Buttons.qml
54

what's this about?

145

It still makes sense to calculate this from the icon and text like before.

(Though with QFontMetrics instead of fake Text elements)

vpilo added a comment.Jan 6 2019, 9:57 PM

Nice work. Go ahead and add

BUG: 399992
BUG: 356076

Regarding the icon, how about emblem-remove? Here's how that looks at half the current size and with a bit of padding between it and the text:

I'm adding that, looks nicer than now.

vpilo added inline comments.Jan 6 2019, 10:09 PM
kcmkwin/kwindecoration/qml/Buttons.qml
54

Without this, the top border of the fake window is double thickness, since it's actually two borders (the whole window + the titlebar).
I couldn't find less depressing way to fix it.

145

How so? From kcm.cpp via a property? Or the TextMetrics QML type?

vpilo updated this revision to Diff 48828.Jan 6 2019, 10:55 PM
  • [kcmkwin/kwindecoration] Fix visuals of KCM decorations' buttons tab
ngraham added inline comments.Jan 7 2019, 12:59 AM
kcmkwin/kwindecoration/qml/Buttons.qml
209

Maybe medium would be more appropriate here? smallMedium is a bit, well, small!

ngraham edited the summary of this revision. (Show Details)Jan 7 2019, 12:59 AM
vpilo added inline comments.Jan 7 2019, 9:20 PM
kcmkwin/kwindecoration/qml/Buttons.qml
209

I've got another patch lined up to take care of the sizes, among other things.. First things first :)

vpilo added a comment.Jan 8 2019, 12:06 AM

@davidedmundson
I could not use TextMetrics; it was not accessible outside of the Delegate and useless when associated to the dragHint (that's why I just used dragHint.implicitHeight). Did you mean something else?

Re: cellHeight, the easiest way I found to have it look decent is letting QML do the job - I tried A LOT of different ways, something always got messed up.
This qml is... delicate.

ngraham accepted this revision.Jan 8 2019, 1:20 AM

Yeah, the QML for this particular tab on the KCM is a little more fragile that I think anyone would want. These changes seem sane within the existing constraints and I can verify that they fix all the bugs listed in the summary section.

This revision is now accepted and ready to land.Jan 8 2019, 1:20 AM
This revision was automatically updated to reflect the committed changes.