Is this a known bug in TabbedPanel?

40 views
Skip to first unread message

Henrik R.

unread,
Jan 20, 2020, 4:12:49 PM1/20/20
to Kivy users support
I have attached, below, an image that shows the difference between how a Layout on a tab is rendered in a window on an Ubuntu PC and on an Android phone.
As you can see, part of the label-text near the top of the Layout is hidden behind the TabbedPanel on the Android phone, but not in the Ubuntu-window.
Is this difference a known bug, or do I have to try to create a small piece of code that demonstrates/reproduces it?

Bug in TabbedPanle P1060295.JPG


Elliot Garbus

unread,
Jan 20, 2020, 5:43:35 PM1/20/20
to kivy-...@googlegroups.com
While it is certainly possible it is a bug, it looks like the Linux screen is longer than the android screen. As you make the Linux screen shorter, does the text get clipped by the top of the window?


Sent from my iPad

On Jan 20, 2020, at 2:13 PM, Henrik R. <henrik.r...@gmail.com> wrote:


I have attached, below, an image that shows the difference between how a Layout on a tab is rendered in a window on an Ubuntu PC and on an Android phone.
As you can see, part of the label-text near the top of the Layout is hidden behind the TabbedPanel on the Android phone, but not in the Ubuntu-window.
Is this difference a known bug, or do I have to try to create a small piece of code that demonstrates/reproduces it?

<Bug in TabbedPanle P1060295.JPG>


--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/d43fa136-9c8b-48c4-b3fb-d4cbd521941b%40googlegroups.com.
<Bug in TabbedPanle P1060295.JPG>

Robert Flatt

unread,
Jan 20, 2020, 10:23:49 PM1/20/20
to Kivy users support
Tabbed panel works for me on Android and Windows without exhibiting this behavior.

Because I have the fixed size content inside a ScrollView to adjust for fixed size screens.

Perhaps the case described here also has fixed size content? That big diagram (optimized for width?)  suggest this might be the case. Elliot's question gets to that.

There are some minor differences in scroll behavior between platforms at the upper and lower bounds, but it is probably an OS specific feature :)

On Monday, January 20, 2020 at 12:43:35 PM UTC-10, Elliot Garbus wrote:
While it is certainly possible it is a bug, it looks like the Linux screen is longer than the android screen. As you make the Linux screen shorter, does the text get clipped by the top of the window?


Sent from my iPad

On Jan 20, 2020, at 2:13 PM, Henrik R. <henrik....@gmail.com> wrote:


I have attached, below, an image that shows the difference between how a Layout on a tab is rendered in a window on an Ubuntu PC and on an Android phone.
As you can see, part of the label-text near the top of the Layout is hidden behind the TabbedPanel on the Android phone, but not in the Ubuntu-window.
Is this difference a known bug, or do I have to try to create a small piece of code that demonstrates/reproduces it?

<Bug in TabbedPanle P1060295.JPG>


--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-...@googlegroups.com.

Henrik R.

unread,
Jan 21, 2020, 2:06:34 AM1/21/20
to Kivy users support
Yes (of course). :-) Here is a screen shot:

TabbedPanel bug 2020-01-21.png



mandag den 20. januar 2020 kl. 23.43.35 UTC+1 skrev Elliot Garbus:
While it is certainly possible it is a bug, it looks like the Linux screen is longer than the android screen. As you make the Linux screen shorter, does the text get clipped by the top of the window?


Sent from my iPad

On Jan 20, 2020, at 2:13 PM, Henrik R. <henrik....@gmail.com> wrote:


I have attached, below, an image that shows the difference between how a Layout on a tab is rendered in a window on an Ubuntu PC and on an Android phone.
As you can see, part of the label-text near the top of the Layout is hidden behind the TabbedPanel on the Android phone, but not in the Ubuntu-window.
Is this difference a known bug, or do I have to try to create a small piece of code that demonstrates/reproduces it?

<Bug in TabbedPanle P1060295.JPG>


--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-...@googlegroups.com.

Henrik R.

unread,
Jan 21, 2020, 6:19:55 AM1/21/20
to Kivy users support
NB! Maybe I should rephrase my message:
It seems that on the Android the content of the tab that contains a FloatLayout inside a Boxlayout is in the same area of the screen as the tabs themselves.
That should be a bug, shouldn't it? The question is whether it is know and whether there is a workaround?
Any help will be appreciated! Thank you.

Robert Flatt

unread,
Jan 21, 2020, 12:33:24 PM1/21/20
to Kivy users support
An interesting question:

Given a layout that is in the most general case impossible to implement, we have two different failure mechanisms.
Where is the error ? Mechanism #1, mechanism #2, or the layout?

That should keep the philosophers busy :)

Henrik R.

unread,
Feb 10, 2020, 12:42:57 PM2/10/20
to Kivy users support
Maybe the Label-text was displayed differently because the window-width on Ubuntu and Android were different.
Now I have studied how to format text on a Label (inside a BoxLayout) again, and after having changed the code to the following, the text is displayed correctly (fully) both on Ubuntu and Android. (The BoxLayout is inside a FloatLayout which is on a tab in a TabbedPanel:

BoxLayout:
padding: '10dp'
spacing: '10dp'
size_hint: 1, 1
Label:
id: t_label
text_size: self.size
halign: 'left'
valign: 'top'
color: (0, 0, 0, 1)
text: 'Wait...' # Will be set later in Python, because the following doesn't work...:
# root.trial_id if (root.trial_id and self.parent.parent) else ''

Henrik R.

unread,
Feb 19, 2020, 12:07:36 PM2/19/20
to Kivy users support
I have changed the code again, to something which looks and works better:
In Python, I instantiate a BoxLayout as the content of the relevant Tab:

self.train_box = TrainBox(self.config_data, self.trials_data, **kwargs)
# Place it on TabbedPanelItem:
self.ids.train_tab.add_widget(self.train_box)

In the initialization of that TrainBox(BoxLayout) I add 2 widgets, first a Label, then a FloatLayout:

self.label_text = f"Some text ... bla  bla. " \
f"Some more text...."

self.top_label = TopLabel()
self.add_widget(self.top_label)
self.top_label.text = self.label_text
self.touch_input_screen = Touchtracer()
self.add_widget(self.touch_input_screen)

Here is the relevant kv:

<TrainBox>:
orientation: 'vertical'

<TopLabel>:
id: t_label
text: 'Wait...' # Will be set later in Python, to avoid strange errors.
text_size: self.width, None
size: self.texture_size
size_hint_y: None
padding: (15,15)

Now it looks good no matter what screen size or format (aspect ratio).
Reply all
Reply to author
Forward
0 new messages