enthought / enthought/traitsui

Enum view (w/ custom style and EnumEditor) is compressed to less than its natural size on MacOS

Open
#587 1 comment 0 reactions 0 assignees View on GitHub
type: bug
Dominant language
Python
Stars
306
Forks
99
PR merge metrics
No merged PRs in 30d

Description

Using PyQt4 on a Mac, the view of an Enum with `style=custom` and a `EnumEditor` appears compressed:

### Example
```python
from traits.api import *
from traitsui.api import *

class Foo(HasTraits):
_enum_values = List(["alpha", "beta", "gamma"])
_enum_descriptions = Dict(Unicode(), Unicode())
selector = Enum(values="_enum_values")

traits_view = View(
HGroup(
UItem(
'selector',
style="custom",
editor=EnumEditor(name="_enum_descriptions")
),
show_border=True,
label="Foo"
)
)

def __enum_descriptions_default(self):
return dict(
(item, ", ".join([item]*4)) for item in self._enum_values
)

foo = Foo()
foo.configure_traits()
```

This looks like this (note the overlapping radio buttons):

![compressed](https://user-images.githubusercontent.com/7642150/61280049-23029d00-a7af-11e9-8223-07bd739adef3.png)

If `resizable=True` is used for the `View`, it becomes apparent that the View can be enlarged to a more natural look (requires user action):

![enlarged](https://user-images.githubusercontent.com/7642150/61280163-504f4b00-a7af-11e9-9516-4ccccdcbbb61.png)

I don't have a mac, so I'm pinging @mdickinson who created the screenshots. Also pinging @flongford for information.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.