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

fix bug with tabview button appearances #10657

Merged
merged 4 commits into from
Mar 1, 2024

Conversation

p9malino26
Copy link
Contributor

This PR fixes an issue with appearances in a qx.ui.tabview.TabView, where if the first tab has its tabVisibility set to excluded, the first visible tab will not have the state firstTab, which will break appearance.

Copy link
Contributor

@cboulanger cboulanger left a comment

Choose a reason for hiding this comment

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

Looks good to me, but I can't test it visually at the moment.

Copy link
Member

@oetiker oetiker left a comment

Choose a reason for hiding this comment

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

same here .,.. looks sensible, not testetd

Copy link
Contributor

@goldim goldim left a comment

Choose a reason for hiding this comment

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

I disagree that it is a bug. The first tab is first tab. Why it should move own state to other button otherwise if the first or last button is removed but in case of removal everything is fine. Also could you create an issue next time for discussion please and code example attached to it also would be great bc it is time for other devs to reproduce the issue.

@johnspackman
Copy link
Member

Why it should move own state to other button

Because it looks weird from the users point of view - if the first tab's visibility is excluded, then it means that the user's "first" tab does not look like the first when the theme's appearance needs to style that "first" tab differently (eg due to borders etc).

When a tab widget has a state like "first", this is only something which is passed to the appearance, it seems reasonable that this state is saying which tab "appears first"

@goldim
Copy link
Contributor

goldim commented Feb 14, 2024

@johnspackman For me first tab is tab which first in array of tabs and not in visible ones. Maybe users' apps are based on old behavior and I may consider this like broken BC, am I right? I would like hear everyone's opinion on this problem. Maybe to create separate discussion?

@goldim
Copy link
Contributor

goldim commented Feb 14, 2024

@p9malino26 In old implementation if I have 3 buttons, removed first and third, central button will have both states. In yours only lastTab.

@johnspackman
Copy link
Member

by all means create a separate discussion, or we can carry on here; I guess my point is that the state of "first" is only for the appearance, and if the tab is excluded then the appearance will never see a "first" tab (without this PR), in which case what would be the point of a "first" state.

page.removeState("lastTab");
}
firstPage?.addState("firstTab");
firstPage?.removeState("lastTab");
Copy link
Contributor

@goldim goldim Feb 15, 2024

Choose a reason for hiding this comment

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

You already remove this state in cycle. Btw if you get rid of these two lines you will fix the problem which I told: one tab will have both states.

firstPage?.removeState("lastTab");

lastPage?.addState("lastTab");
lastPage?.removeState("firstTab");
Copy link
Contributor

Choose a reason for hiding this comment

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

The same

@goldim
Copy link
Contributor

goldim commented Feb 17, 2024

@johnspackman I can see that it is a bug actually. Classic Theme:
image

@goldim
Copy link
Contributor

goldim commented Feb 17, 2024

@p9malino26 just fix what I suggested above and I gonna approve it.

@hkollmann hkollmann merged commit a42bde8 into qooxdoo:master Mar 1, 2024
6 checks passed
WillsterJohnsonAtZenesis pushed a commit to WillsterJohnsonAtZenesis/qooxdoo that referenced this pull request Mar 5, 2024
* fix bug with tabview button appearances

* remove redundant code

---------

Co-authored-by: Patryk Malinowski <pmalinowski@vmn.digital>
Co-authored-by: Henner Kollmann <henner.kollmann@gmx.de>

Thanks @p9malino26 !
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.

None yet

8 participants