Add a SearchField and PasswordField component
ClosedPublic

Authored by ognarb on Mar 4 2019, 12:36 AM.

Details

Summary

Provide a small abstraction over ActionTextField to implement consistent standard special text field

Warning: I include a placeholder text in this two example, not sure if this is correct, because kirigami probably shouldn't include translatable content.

Also improve the ActionTextField doc

Test Plan

Compile, example works

Diff Detail

Repository
R169 Kirigami
Branch
dev
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 9735
Build 9753: arc lint + arc unit
ognarb created this revision.Mar 4 2019, 12:36 AM
Restricted Application added a project: Kirigami. · View Herald TranscriptMar 4 2019, 12:36 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
ognarb requested review of this revision.Mar 4 2019, 12:36 AM
ognarb edited the summary of this revision. (Show Details)Mar 4 2019, 12:37 AM
ognarb added reviewers: Kirigami, ngraham.
ognarb edited the test plan for this revision. (Show Details)
ognarb edited the summary of this revision. (Show Details)
apol added a subscriber: apol.Mar 4 2019, 2:19 AM
apol added inline comments.
src/controls/PasswordField.qml
52

Looks off that the clear buttons are not aligned. Invert?

ngraham added a reviewer: mart.Mar 4 2019, 3:59 AM

Wow, that was fast. I'm impressed.

src/controls/PasswordField.qml
26

Standart -> Standard

src/controls/SearchField.qml
26

Standart -> Standard

broulik added a subscriber: broulik.Mar 4 2019, 8:00 AM
broulik added inline comments.
src/controls/PasswordField.qml
28

password field

34

Better not print a password in an example code :)

52

We don't use clear buttons on password fields

src/controls/SearchField.qml
45

I think this is fine but may need a translation domain i18nd("whatever_domain_kirigami_uses", "Search...")

49

This doesn't mirror with right-to-left languages, run the app with -reverse argument to try

50

Prefer connecting to length > 0 if available, avoids a string conversion and passing around between C++ and JavaScript

ognarb updated this revision to Diff 53106.Mar 4 2019, 10:12 AM
ognarb marked 8 inline comments as done.
ognarb edited the summary of this revision. (Show Details)
  • Fix typos in doc
  • Remove edi-clear button in password field
ognarb edited the summary of this revision. (Show Details)Mar 4 2019, 10:13 AM
ognarb added inline comments.Mar 4 2019, 5:59 PM
src/controls/SearchField.qml
45

Are you sure? It would mean that Kirigami should then depends on ki18n. And them Kirigami wouldn't be a Tier 1 KDE framework anymore.

@mart should I move this in the example code or it is fine with a translation domain?

mart requested changes to this revision.Mar 17 2019, 4:35 PM
mart added inline comments.
src/controls/SearchField.qml
45

no, it can't depend from ki18n.
here we can onlt use qsTr

This revision now requires changes to proceed.Mar 17 2019, 4:35 PM
ognarb updated this revision to Diff 54117.Mar 17 2019, 5:55 PM
  • Use qsTr instead of i18n
  • Kirigami version 2.7 -> 2.8
mart accepted this revision.Mar 19 2019, 11:33 AM
This revision is now accepted and ready to land.Mar 19 2019, 11:33 AM
This revision was automatically updated to reflect the committed changes.