D8641: FormLayout

Marco Martin noreply at phabricator.kde.org
Tue Nov 14 11:02:55 UTC 2017


mart added a comment.


  In https://phabricator.kde.org/D8641#167459, @hein wrote:
  
  > So if I understand correctly, the Mnemonic stuff currently doesn't seem to have the same aims as KAcceleratorManager does ...
  >
  > KAcceleratorManager acts on a hierarchy of widgets, traverses it, assigns weights to actionable things and possible mnemonics and overall smartly tries to distribute mnemonics across the hierarchy.
  >
  > If I understand correctly this is more like a convenience wrapper around QKeySequence::mnemonic() that you can get both the label and a sequence to pass to shortcut to.
  
  
  no, it's kindof like kacceleratormanager.. but much more primitive, as it has just a single global pool in which accelerators are unique.
  
  so what it would need and i may try, is to make and hash per different window, and then  have something about widgets hyerarchies.
  tough i was thinking that may be enough if is global per-window and shortcuts are unique based on only one enabled at the moment (so like if there is a stackview, only the topmost current page would be enabled)
  
  > I'm not really sure about those static mappings members ... there currently doesn't seem to be any duplicate mnemonic tracking yet, right?
  
  basically it just avoids any duplicates... first come first served
  
  > My feeling is that this is still too much boiler plate for the dev. At least within a FormLayout, which has knowledge of what labels go with what, all the assignment should probably just happen automatically without needing to have your own Shortcut {} instances and getting the labels out of the Mnemonic thing. Do you think we can do that somehow?
  
  there would be boiler plate for who writes their own controls (which oone should try hard to avoid anyways)
  using a formlayout just works and for primitive controls should just work automatically as well, if this is done in the style.
  
  > Overall the code in KAcceleratorManagement is quite good and nicely commented, there's likely stuff of value in there (e.g. the algorithm it uses to weight mnemonic characters).
  
  i'll look at the algorythm to see if is reusable

REPOSITORY
  R169 Kirigami

REVISION DETAIL
  https://phabricator.kde.org/D8641

To: mart, #plasma, #kirigami, hein
Cc: colomar, ngraham, davidedmundson, plasma-devel, ZrenBot, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart, hein
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20171114/55797808/attachment-0001.html>


More information about the Plasma-devel mailing list