Skip to content

Commit

Permalink
Preallocate Area widget
Browse files Browse the repository at this point in the history
On Fedora 27, recent Debian, and Ubuntu 18.04, the Area widget was not
seen.  The widget was default allocation 1x1, a single pixel, and not
easy to see.

Workaround was to show a toolbar menu, which causes a resize of the
canvas.

Existing code tries to set the Area widget to the correct size once the
activity widget is mapped and the scrolled window widget size is
allocated.

Before recent changes in GTK+, the second resize worked fine.  Now, the
second resize after the map is buffered somehow.

Rather than fixing GTK+, or making the activity incompatible with
previous versions of GTK+, we set an initial size of screen width and
screen height less grid cell size.

Fixes #27.
  • Loading branch information
quozl committed Dec 2, 2017
1 parent 19884e3 commit a8828f1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions OficinaActivity.py
Expand Up @@ -116,6 +116,7 @@ def __init__(self, handle):
self.textview.hide() # will be shown when text tool is used

self.area = Area(self)
self.area.setup(self._width, self._height - style.GRID_CELL_SIZE)
self.area.show()
self.fixed.put(self.area, 0, 0)
self.fixed.put(self.textview, 0, 0)
Expand Down

0 comments on commit a8828f1

Please sign in to comment.