Ugly focus rectangle in TsButton

Viewing 17 posts - 1 through 17 (of 17 total)
  • Author
    Posts
  • #59685
    Stephane Senecal
    Participant

      TsSkinManager.ButtonsOptions.ShowFocusRect = False

      Stephane Senecal
      CIS Group
      Delphi programmer since 2001

      #59686
      HeDiBo
      Participant
        'Stephane wrote:

        TsSkinManager.ButtonsOptions.ShowFocusRect = False

        Do you really think I'll go through all my projects to make this setting?

        If it worked for years without the focus rectangle, than a new version should default not having a focus rectangle.

        #59687
        Stephane Senecal
        Participant

          Weird, I'm using version 13 of AlphaSkins and a TsButton does not draw a focus rectangle by default, but a TsBitBtn does.

          Both have the property ShowFocus to True by default. It looks like a bug that you liked.

          I agree that a focus rectangle is the ugliest way to show which control has the focus, but it is the standard way on Microsoft Windows.

          By the way, I do not work for Alpha Skins. I'm only trying to help.

          Stephane Senecal
          CIS Group
          Delphi programmer since 2001

          #59688
          HeDiBo
          Participant
            'Stephane wrote:

            Weird, I'm using version 13 of AlphaSkins and a TsButton does not draw a focus rectangle by default, but a TsBitBtn does.

            Both have the property ShowFocus to True by default. It looks like a bug that you liked.

            I agree that a focus rectangle is the ugliest way to show which control has the focus, but it is the standard way on Microsoft Windows.

            By the way, I do not work for Alpha Skins. I'm only trying to help.

            I know you're not working for AlphaSkins. Pardon me if I looked to be yelling at you. I was a bit fed up with the situation.

            I think it stands to reason not to honor the ShowFocus property if the button is skinned (it should be honored if the skin manager is not active). The skinned versions all have their own methods of showing focus, The rectangle should not be one of them, because that makes the non-skinned versions unusable (setting FocusRect to False will also be honored in non-skinned versions).

            So, this is simply a mistake.

            #59690
            SzakiLaci
            Participant
              'HeDiBo' wrote:

              Suddenly, I find a focus rectangle on TsButton, that I did not see before…

              Hi, 🙂

              I just would like to mention there is a nice way to show :

              which TsBitBtn has the focus at NON-skinned mode, by setting the .FocusedColor := clLime; property.

              It may has nothing to do with this new problem… just would like to recommend a bit precaution, because it is related to “non-skinned focus” things.

              So any new update regarding this may affect that behavior too, since it is a bit hard to test each property setup in every possible variations.

              (Delphi GeExpert addon has a great feature to replace all components on the form at once. TsButton >> TsBitBtn.)

              Cheers

              PS: could you please edit your first topic to announce which version do you experience this new behavior? (After upgrading from which?)

              It will help Serge too… 😉

              #59691
              HeDiBo
              Participant
                'SzakiLaci' wrote:

                It may has nothing to do with this new problem… just would like to recommend a bit precaution, because it is related to “non-skinned focus” things.

                So any new update regarding this may affect that behavior too, since it is a bit hard to test each property setup in every possible variations.

                PS: could you please edit your first topic to announce which version do you experience this new behavior? (After upgrading from which?)

                It will help Serge too… 😉

                I looked at the code, and the change stems from change in code in TsButton specifically.

                I updated the original topic, like you suggested.

                #59700
                Support
                Keymaster

                  I also thinking that these focuses looks not good.

                  I can change default value of the TsSkinManager.ButtonsOptions.ShowFocusRect property to False.

                  #59703
                  HeDiBo
                  Participant
                    'Support' wrote:

                    I also thinking that these focuses looks not good.

                    I can change default value of the TsSkinManager.ButtonsOptions.ShowFocusRect property to False.

                    That's not the correct way of doing it. If the property defaults to False, there's no focus rectangle in non-skinned mode. Simply do not draw a focus rectangle in skinned mode. The skin should provide a good alternative for showing the focus. If it has not, than the skin must change, not this logic.

                    If someone thought the focus does not show properly in skinned mode, maybe a new property ForceFocusRect should be introduced. The way it is now spoils it for everybody.

                    #59707
                    Support
                    Keymaster

                      I think, buttons without skins should use the ShowFocus property only.

                      They should not depend from TsSkinManager.ButtonsOptions.ShowFocusRect property if have standard look.

                      How you think?

                      #59708
                      HeDiBo
                      Participant
                        'Support' wrote:

                        I think, buttons without skins should use the ShowFocus property only.

                        They should not depend from TsSkinManager.ButtonsOptions.ShowFocusRect property if have standard look.

                        How you think?

                        I made the mistake thinking ShowFocusRect was a standard TButton property. What you're saying is correct. Default the ShowFocusRect property to False will do the trick.

                        #59710
                        SzakiLaci
                        Participant
                          'Support' wrote:

                          I think, buttons without skins should use the ShowFocus property only.

                          They should not depend from TsSkinManager.ButtonsOptions.ShowFocusRect property if have standard look.

                          How you think?

                          Sounds like a perfect solution! :a3:

                          #59860
                          HeDiBo
                          Participant

                            If TsButton.ShowFocus is false, focus is still shown. In fact, I could not find any difference between ShowFocus = True and ShowFocus = False.

                            #61521
                            Support
                            Keymaster

                              Hello!
                              I have checked it again right now, focus rectangle is not painted when ShowFocus property is False in my tests.
                              Can you confirm this issue?

                              #61536
                              HeDiBo
                              Participant

                                Hello!
                                I have checked it again right now, focus rectangle is not painted when ShowFocus property is False in my tests.

                                The problem was that ShowFocus is not honored in a TsButton. There’s no difference with ShowFocus = True and ShowFocus = False, irrespective of whether skinmanager is active or not. Only if skinmanager is active and ButtonsOptions.ShowFocusRect is true, a focus rectangle is drawn.
                                It’s a bit of a mess, because the focus rectangle should only be drawn in non-skinned mode!

                                #61550
                                Support
                                Keymaster

                                  Maybe I can’t understand a problem.
                                  I’m creating a new project with TsEdit and TsButton (without TsSkinManager).
                                  When button is focused in real-time then focus rectangle is drawn.
                                  I’m changing ShowFocus to False – focus rectangle is not visible in real-time when focused.

                                  I’m placing TsSkinManager (not active) there – same behaviour.

                                  After a skin activating focus rectangle is not visible (ShowFocus hasn’t influence).

                                  After changing of TsSkinManager.ButtonsOptions.ShowFocusRect to True works the ShowFocus property of the TsButton.

                                  You have another behavior of the TsButton? Can you show an Exe-file please?

                                  #61578
                                  HeDiBo
                                  Participant

                                    I’m very sorry, I put you through this agony 🥴
                                    I cannot reproduce it in a sample project. I thought I had this in another project, so I’ll retest that.

                                    #68202
                                    HeDiBo
                                    Participant

                                      You can close this topic, Serge.

                                    Viewing 17 posts - 1 through 17 (of 17 total)
                                    • The topic ‘Ugly focus rectangle in TsButton’ is closed to new replies.