GUI messagepage: add placeholder text to address field (like in sendcoins dialog)... #1204

pull Diapolo wants to merge 1 commits into bitcoin:master from Diapolo:messagepage_focus_placeholder changing 4 files +13 −13
  1. Diapolo commented at 1:26 PM on May 5, 2012: none
    • set focus to address field on opening messagepage or "Clear All"
    • consolidate BitcoinGUI::gotoMessagePage() functions into a single one
    • rename window title to "Sign Message Dialog"

    If you directly open the message page via clicking Sign Message and passing an address, the focus is in the message input field, as intended. If you simply open the message page via menu, focus is set to the address field.

  2. in src/qt/bitcoingui.cpp:None in 91db233d48 outdated
     722 | @@ -723,7 +723,6 @@ void BitcoinGUI::gotoMessagePage()
     723 |      disconnect(exportAction, SIGNAL(triggered()), 0, 0);
     724 |  #else
     725 |      messagePage->show();
     726 | -    messagePage->setFocus();
    


    luke-jr commented at 4:38 PM on May 6, 2012:

    Why remove this?


    Diapolo commented at 8:18 PM on May 6, 2012:

    Because we want the focus in signFrom, so this is obsolete. Try it out, it works!


    luke-jr commented at 10:10 PM on May 6, 2012:

    "It works" != "It's guaranteed to work"; I would be fairly disappointed if setting focus on a widget also brought the window into focus.


    Diapolo commented at 4:55 AM on May 7, 2012:

    If I leave this setFocus(), signFrom is NOT focused, but I guess @laanwj should verify my code then.


    laanwj commented at 10:30 AM on May 7, 2012:

    I'm not sure about this. Would need to be tested on various OSes :/


    Diapolo commented at 11:25 AM on May 7, 2012:

    If I set the focus on an element in a widget instead of the widget itself ... perhaps I find the answer via a web-search. Sounds pretty logical though.


    Diapolo commented at 11:55 AM on May 7, 2012:

    As the MessagePage has set the flag focusPolicy = NoFocus (which is the default), I'm rather sure the setFocus() had no function before! And signFrom has focusPolicy = StrongFocus, which allows setting the focus to.

    See http://qt-project.org/doc/qt-4.8/qt.html#FocusPolicy-enum

  3. Diapolo commented at 8:12 AM on May 7, 2012: none

    Rebased and reworked to be Qt < 4.7 compatible by using setPlaceholderText in the code instead of the ui-file.

  4. laanwj commented at 12:12 PM on May 7, 2012: member

    Good!

    Btw, I think it is confusing that there are two slots gotoMessagePage. If you want, you can consolidate the gotoMessagePage to one slot that takes a QString argument that defaults to the empty string. Then add:

    if(!addr.isEmpty())
        messagePage->setAddress(addr);
    
  5. Diapolo commented at 12:56 PM on May 7, 2012: none

    @laanwj I added your suggestion and consolidated gotoMessagePage() into 1 function.

  6. add placeholder text to address field (like in sendcoins) and set focus to address field on opening messagepage or "Clear All" / consolidate gotoMessagePage() to 1 function / rename windowTitle to "Sign Message Dialog" 840470ec79
  7. Diapolo commented at 1:53 PM on May 10, 2012: none

    Rebased (resolves merge conflict) and added:

    • rename window title to "Sign Message Dialog"
  8. laanwj referenced this in commit b66737e6df on May 11, 2012
  9. laanwj merged this on May 11, 2012
  10. laanwj closed this on May 11, 2012

  11. coblee referenced this in commit f215482d5c on Jul 17, 2012
  12. suprnurd referenced this in commit 072b0fd708 on Dec 5, 2017
  13. lateminer referenced this in commit 404e7793ca on Jan 22, 2019
  14. lateminer referenced this in commit 24a00fcf9c on Dec 25, 2019
  15. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-21 18:16 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me