Skip to content

kcm: Fixes and UI improvements

ivan tkachenko requested to merge work/r/fogetful into master

might split out the UI improvements in a separate MR. Let me know if you feel like this is needed

kcm: Drop QML import versions

They are deprecated and unhelpful.

This is an automated change using the following regexp: Search: (import \S+) \d\S*( as \S*)? Replace: \1\2

kcm: Drop semicolon from import statements

That's pretty unusual for our code style, and completely unnecessary.

kcm: Add import aliases for org.kde.kcmutils QML module

kcm: Fix indentation

kcm: Add missing spacing to the layouts

The default spacing is 5px which does not align with anything in our design system. The closest value is smallSpacing which is 4px.

kcm: Declare properties with appropriate types

kcm: Fix missing else branch for a property binding, fix up condition

A block without an explicit return like this one produces an undefined value, which is an illegal value for a string property text.

As a drive-by, drop the visibility condition on percentage int implicitly cast to bool. If a device is discharging all the way down to a last-minute 0% level, why should we hide the number?

kcm: Fix broken function deviceTypeToString

The default branch wasn't working at all for multiple reasons. While fixing it to work the way it was intended, I also modernized some expressions, simplified arguments list and added types, wrapped comma separator in an i18n call.

Amends a2443725

kcm: Rewrite function setBluetoothEnabled

Rewrite the index based raw loop using the iterative method forEach; also add types to the method itself.

kcm: Port mutually exclusive if-conditions to a switch-case

kcm: Add type annotations to every QML method

kcm: Bind action directly to the Switch button

Visibility doesn't need to be bound either, because the component won't be displayed for an invisible action by the tool bar anyway.

kcm: Port to qualified property access and pragma ComponentBehavior: Bound

Add icons to the Send File & setup Network buttons

Changes an existing icon in the applet to something more appropriately looking. The icon for network setups is taken directly from the plasma-nm model code.

kcm: Device.qml: Move the makeCall method to the top-level component

Because why would it be buried deep inside?

kcm: Factor out action and dialog+controller for forgetting the devices

It will be convenient when adding or moving the "Forget" button to the device page later. It also removes the need for IIFE hack, because the whole dialog is now being created outside of the fragile ListView delegate's context.

Add the "Forget" button to the Device page

Imagine you opened a page specifically to manage the device, and the removal button just isn't there. Why?

image

the device page could use some title bar actions as well, but I couldn't decide which one would be more "entitled": Dis/connect or Forget? Having both feels like too much, might not fit in some languages and would make custom busy indicator somewhat more difficult to implement.

Edited by ivan tkachenko

Merge request reports

Loading