Skip to content

Commit

Permalink
Remove erroneous note about _default_background_color override beha…
Browse files Browse the repository at this point in the history
…vior on iOS (beeware#3125)

Clarified why we're capturing `_default_background_color`, and that it's not overridable.
---------

Co-authored-by: Russell Keith-Magee <[email protected]>
  • Loading branch information
proneon267 and freakboy3742 authored Jan 26, 2025
1 parent 25891f0 commit 78d3e75
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions changes/3125.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
On iOS, an erroneous note stating that widgets can override their system-assigned default background color, has now been removed.
9 changes: 7 additions & 2 deletions iOS/src/toga_iOS/widgets/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,13 @@ def __init__(self, interface):
self.native = None
self.create()

# Override this attribute to set a different default background
# color for a given widget.
# Many widgets have a "transparent" background; however, some widgets use
# UIColor.ClearColor, and some use UIExtendedGrayColorSpace 0 0, which has
# slightly different color mixing characteristics. Widgets like TextInput use
# `None` as their initial background color, so that always adapts to light/dark
# mode. Preserve the initial background color on the freshly created widget so
# that we can reset back to that color when background_color is set to None. See
# #3104 for details.
self._default_background_color = self.native.backgroundColor

@abstractmethod
Expand Down

0 comments on commit 78d3e75

Please sign in to comment.