FocusScope and Plasma CheckBox

David Edmundson david at davidedmundson.co.uk
Tue Jul 9 13:37:12 UTC 2013


I /think/ you want to change the checkbox to monitor activeFocus rather
than focus to show the correct highlight.

i.e in.
plasma/declarativeimports/plasmacomponents/qml/Private/DualStateButton.qml
change

line 79.
-        state: (dualButton.enabled && (dualButton.focus ||
mouseArea.containsMouse)) ? "hover" : "shadow"
+        state: (dualButton.enabled && (dualButton.activeFocus ||
mouseArea.containsMouse)) ? "hover" : "shadow"


Note the above is completely untested :)

David

On Tue, Jul 9, 2013 at 2:08 PM, Kai Uwe Broulik <kde at privat.broulik.de>wrote:

> Hi,
>
> I'm currently trying to improve (implement at all) keyboard navigation for
> the
> battery monitor. It works quite well except that the sliders don't have any
> visual "has focus" indication.
>
> What also gives me trouble is the checkbox.
> I have code that looks like
>
> FocusScope {
>     id: brightnessItem
>     focus: true
>
>     Components.CheckBox {
>         id: pmCheckBox
>         anchors …
>         focus: true
>         checked: true
>     }
> }
>
> Once the brightness item has focus (ie. I tabbed to it) I can turn the
> checkbox on and off using space or return. The checkbox itself, however,
> always looks like it's hovered, no matter if it has focus or not. What am I
> doing wrong here?
>
> Best,
> Kai Uwe
> _______________________________________________
> Plasma-devel mailing list
> Plasma-devel at kde.org
> https://mail.kde.org/mailman/listinfo/plasma-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20130709/acab555c/attachment.html>


More information about the Plasma-devel mailing list