diff options
| author | Pietro Gagliardi <[email protected]> | 2014-06-25 23:44:22 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-06-25 23:44:22 -0400 |
| commit | 4a68c3cb7a984d144378c683e7587dadd5ebe62f (patch) | |
| tree | d5486b9bfe6c5f841b20334bbb0b21dbdc2df798 /prefsize_unix.go | |
| parent | 6e170ad1dbe842081a6d28f9cccf6c86d6fd0a4e (diff) | |
Applied the new control sizing system to the GTK+ backend.
Diffstat (limited to 'prefsize_unix.go')
| -rw-r--r-- | prefsize_unix.go | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/prefsize_unix.go b/prefsize_unix.go deleted file mode 100644 index 68ea589..0000000 --- a/prefsize_unix.go +++ /dev/null @@ -1,24 +0,0 @@ -// +build !windows,!darwin,!plan9 - -// 23 february 2014 - -package ui - -// GTK+ 3 makes this easy: controls can tell us what their preferred size is! -// ...actually, it tells us two things: the "minimum size" and the "natural size". -// The "minimum size" is the smallest size we /can/ display /anything/. The "natural size" is the smallest size we would /prefer/ to display. -// The difference? Minimum size takes into account things like truncation with ellipses: the minimum size of a label can allot just the ellipses! -// So we use the natural size instead. -// There is a warning about height-for-width controls, but in my tests this isn't an issue. -// For Areas, we manually save the Area size and use that, just to be safe. - -// We don't need to worry about y-offset because label alignment is "vertically center", which GtkLabel does for us. - -func (s *sysData) preferredSize() (width int, height int, yoff int) { - if s.ctype == c_area { - return s.areawidth, s.areaheight, 0 - } - - _, _, width, height = gtk_widget_get_preferred_size(s.widget) - return width, height, 0 -} |
