Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make button selected via keyboard visible by changing its outline color #11

Open
probonopd opened this issue Apr 27, 2021 · 5 comments
Open

Comments

@probonopd
Copy link
Member

Follow-up to #10.

Now that we do not display PE_FrameFocusRect anymore, we have no way of seeing when a button has the focus by pressing the tab key.

What we would like is the button border to get a different color when it has the focus, just like with drop-down menus and with QLineEdit.

ksnip_20210427-092043

Good:

    case PE_FrameLineEdit: {
        QRect r = option->rect;
        bool hasFocus = option->state & State_HasFocus;
        bool isEnabled = option->state & State_Enabled;
        const qreal rounding = Ph::LineEdit_Rounding;
        auto pen = hasFocus ? S_highlight_outline : S_window_outline;

The problem is that no case PE_PushButton exists. Why?

@antonpat
Copy link

I think it is PE_PanelButtonCommand

@probonopd
Copy link
Member Author

probonopd commented Apr 27, 2021

That thing already has

        if (hasFocus || isDefault) {
            outline = S_highlight_outline;
        }

so I am puzzled why it is not becoming blue when being focused with tab.

@probonopd
Copy link
Member Author

But then, I am equally puzzled why the text in the buttons is more or less horizontally centered in Linux now but not on FreeBSD...

@louies0623
Copy link

louies0623 commented Dec 9, 2022

It depends on what text font its button uses, because if I remember right, there is something wrong with the text font of the button.
helloSystem/hello#152

@probonopd
Copy link
Member Author

I am puzzled why it is not becoming blue when being focused with tab.

Easy: because we are setting border-color: grey; in /usr/local/etc/xdg/stylesheet.qss...

Moving this file away removes the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants