FrameSVG: Use QMargins
AbandonedPublic

Authored by zzag on Jun 2 2018, 3:04 PM.

Details

Reviewers
None
Group Reviewers
Plasma
Frameworks
Summary

Use QMargins to store margins and measures. As a side effect of this
diff, updateSizes and contentGeometry are more simpler now,
which is good, I guess.

Diff Detail

Repository
R242 Plasma Framework (Library)
Branch
framesvg-modernize
Lint
No Linters Available
Unit
No Unit Test Coverage
zzag created this revision.Jun 2 2018, 3:04 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptJun 2 2018, 3:04 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
zzag requested review of this revision.Jun 2 2018, 3:04 PM
zzag updated this revision to Diff 35444.Jun 3 2018, 9:36 AM

Forward-declare QMarginsF. (to be consistent with QRectF, QSizeF, etc)

zzag updated this revision to Diff 35453.Jun 3 2018, 11:54 AM

Fix ::margins() and ::fixedMargins()

zzag added a comment.Jun 3 2018, 12:06 PM

I'm not sure whether that's a good idea to use QMargins for measures, maybe, it would be better to have something like

struct {
    QSize left;
    QSize top;
    QSize right;
    QSize bottom;
} sizes, fixedSizes;

in FrameData, which then should go in a different diff (if you think it's worth it).

Also, I think it will simplify generateFrameBackground a little bit, e.g.

paintBorder(p, frame, FrameSvg::RightBorder, frame->sizes.right * q->devicePixelRatio, contentRect);

so there won't be a need for const int leftHeight = q->elementSize(frame->prefix % QLatin1String("left")).height();

zzag abandoned this revision.Jun 3 2018, 4:07 PM

The diff is crap. I'll abandon it.