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

native: Implement keyboard focus support in Tab widget #1173

Merged
merged 3 commits into from
Apr 20, 2022

Conversation

hunger
Copy link
Member

@hunger hunger commented Apr 13, 2022

Focus the tabs straight away when pressing cursor left/right keys.

@hunger
Copy link
Member Author

hunger commented Apr 13, 2022

This is how Qt apps behave on my linux system. I assume this is actually different on other platforms.

}

fs := FocusScope {
key-pressed(event) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No handling for activation?

Apart from this, is there any difference between this TabBarImpl and the one in the fluent style?

Should the 8px spacing come from the native style metrics?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from this, is there any difference between this TabBarImpl and the one in the fluent style?

It seems not. So this could be moved in the common/common.slint and re-exported

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But the spacing is indeed suspicious.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used Krita as an example app and that just switches between tabs as you move with the arrow keys between the different tabs.

The style krita is using by default is pretty horrible. The difference between focused tab-bar and unfocused tab-bar is basically non-existent:-/ But now that I went and looked for it: It does exist, so I need to fix that.

@ogoffart
Copy link
Member

Don't you need to set the focus flags in the QStyle?

@ogoffart
Copy link
Member

I think the CI issue will be fix by #1180 because it registers all enums.

@hunger hunger merged commit 9ef1f08 into slint-ui:master Apr 20, 2022
@hunger hunger deleted the native_tab branch April 20, 2022 13:19
@@ -634,6 +634,10 @@ export global NativeStyleMetrics := {
property <color> placeholder-color : native_output;
property <color> placeholder-color-disabled : native_output;

// Tab Bar metrics:
property <length> tab-bar-spacing : native_output;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the tab-bar-spacing is not used

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

Successfully merging this pull request may close these issues.

3 participants