Opened 11 years ago
Closed 10 years ago
#4279 closed defect (fixed)
tray items not always left aligned
Reported by: | erikos | Owned by: | humitos |
---|---|---|---|
Priority: | Normal | Milestone: | Unspecified |
Component: | Sugar | Version: | 0.97.x |
Severity: | Minor | Keywords: | regression |
Cc: | erikos | Distribution/OS: | OLPC |
Bug Status: | Unconfirmed |
Description
When testing #3565 I came across the following issue:
- open Browse
- create a session bookmark
---> a bookmark is added to the tray, left to it is some space for the 'go-forward' button but it is not shown
- add more bookmarks until the forward/backward buttons are shown
- now remove one bookmark
---> the bookmarks are now left aligned, no space reserved for the forward button
Attachments (3)
Change History (14)
comment:1 Changed 11 years ago by humitos
- Owner changed from manuq to humitos
- Status changed from new to accepted
Changed 11 years ago by humitos
comment:2 Changed 11 years ago by humitos
- Cc erikos added
- Keywords r? added
The patch attached fixes this test case but I don't like the solution. I'm not really sure why the _size_allocated_cb is called with allocation.width/height in 1 yet. I need to keep researching about this and maybe propose a better solution.
Anyway, please take a look at the patch maybe you see other things and I'm not seeing... (the patch has a long commit message explaining what I did)
Changed 11 years ago by humitos
PATCH to test this ticket easly. This patch does not worrie about adding a repeated link
comment:3 Changed 11 years ago by humitos
Some docs to read about this topic: http://developer.gnome.org/gtk3/3.4/GtkWidget.html#geometry-management
comment:4 Changed 11 years ago by humitos
From a mailing list: https://mail.gnome.org/archives/gtk-devel-list/2002-August/msg00111.html
comment:5 Changed 11 years ago by manuq
The issue happens because the tray is not visible, so when the size-allocate callback is called for the first time, it's size is unknown, and it is set to 1x1 as the documentation say:
http://developer.gnome.org/gtk3/stable/GtkWidget.html#gtk-widget-size-allocate
Adding a show() in Browse tray fixes the issue if you resume a Browse instance that has the tray already displayed. But this breaks the Browse functionality (tray hidden by default).
--- a/webactivity.py +++ b/webactivity.py @@ -178,6 +178,7 @@ class WebActivity(activity.Activity): self._tray = HTray() self.set_tray(self._tray, Gtk.PositionType.BOTTOM) + self._tray.show() self._primary_toolbar = PrimaryToolbar(self._tabbed_view, self) self._edit_toolbar = EditToolbar(self)
So I think we are good adding the conditional for the 1x1 size case as per humitos patch, with a better comment.
comment:6 Changed 11 years ago by manuq
Pushed 0788e546 but let's leave this open as we may find a real solution.
comment:7 Changed 11 years ago by erikos
- Keywords r? removed
- Milestone changed from 0.98 to 1.0
comment:8 Changed 10 years ago by dnarvaez
- Component changed from sugar-toolkit-gtk3 to Sugar
comment:9 Changed 10 years ago by dnarvaez
- Milestone changed from 1.0 to Unspecified
comment:10 Changed 10 years ago by dnarvaez
- Bug Status changed from Assigned to Unconfirmed
comment:11 Changed 10 years ago by dnarvaez
- Resolution set to fixed
- Status changed from accepted to closed
A candidate solution; not the best one.