toga icon indicating copy to clipboard operation
toga copied to clipboard

Enable all background color tests on all widgets

Open proneon267 opened this issue 1 year ago • 3 comments

What is the problem or limitation you are having?

Related PRs: #3009, #2484

Context:

Currently all the 3 background color tests on the testbed cannot be enabled for all widgets, since there are problems associated with the widget background color on some platforms like on Android and Winforms. If we enable all 3 background color tests on every widget, then the testbed would pass on some, but would fail on other platforms. At the same time, we cannot correct their behavior to make them pass the tests as fixes for those platforms exist on separate PRs. For example, If we enable all the 3 tests: test_background_color, test_background_color_reset, test_background_transparent on the Box widget then the tests would pass on iOS, but would fail on Winforms, since the fix for winforms exists on a separate PR.

Since behavioral changes need tests that confirms their behavior. So, to prevent a deadlock situation that would prevent this PR from being merged, I have created this issue to keep track of the widgets on which background color tests are not enabled. Since all 3 tests are enabled on most widgets so the list would be small. Afterwards, when all 3 dependent PRs are merged, we can enable all the 3 background color tests on all the widgets.

Current status:

test_background_color test_background_color_reset test_background_color_transparency
ActivityIndicator
Box :white_check_mark: :white_check_mark:
Button :white_check_mark: :white_check_mark: :white_check_mark:
Canvas :white_check_mark: :white_check_mark: :white_check_mark:
DateInput :white_check_mark: :white_check_mark: :white_check_mark:
DetailedList
Divider
ImageView :white_check_mark: :white_check_mark: :white_check_mark:
Label :white_check_mark: :white_check_mark: :white_check_mark:
MapView
MultilineTextInput :white_check_mark: :white_check_mark: :white_check_mark:
NumberInput :white_check_mark: :white_check_mark: :white_check_mark:
OptionContainer
PasswordInput :white_check_mark: :white_check_mark: :white_check_mark:
ProgressBar
ScrollContainer :white_check_mark: :white_check_mark: :white_check_mark:
Selection :white_check_mark: :white_check_mark: :white_check_mark:
Slider
SplitContainer
Switch
Table :white_check_mark: :white_check_mark:
TextInput :white_check_mark: :white_check_mark: :white_check_mark:
TimeInput :white_check_mark: :white_check_mark: :white_check_mark:
Tree :white_check_mark: :white_check_mark:
WebView

Additional context

Note: There are some widgets on which background color setting might not be relevant like on MapView or WebView. So, I will add more context for those widgets later.

proneon267 avatar Dec 04 '24 06:12 proneon267

I would like to ask if it is possible to change the background color and font color of a single row in a table. Similar to the state that row is selected. Thanks.

royccg avatar Dec 23 '24 01:12 royccg

@royccg That's not really related to this ticket - but no. There are very limited controls on the colors used in a table.

freakboy3742 avatar Dec 23 '24 01:12 freakboy3742

FWIW for ActivityIndicator -- we decided that background_color while hidden isn't worth the extra effort to implement consistently -- effectively the case where someone would be using a stopped ActivityIndicator to draw a solid background it would not draw because we're implementing stopped by using custom logic for native widget hidden on some platforms. So the tests for background color for ActivityIndicator, if we decide it's worth it, should probably be ran while the widget is running. The specific details of implementing that, I haven't really thought about yet. Just posting to let y'all know since ActivityIndiactor is the first widget on that list.

johnzhou721 avatar Oct 04 '25 00:10 johnzhou721