-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for new Yosemite views, controls, etc. #17
Comments
A checkbox also needs some editing. The title seems always disabled… see https://github.com/typemytype/vanilla/commit/ffdee5d7a6a3e9f6a188f195e7f4a09fb261f315 |
A small proposal showing how localization could work, without losing the cocoa default implementation. will make a sample app later on this week https://dl.dropboxusercontent.com/u/41873/locaVanillaTest.zip |
The checkbox issue should be fixed now: f4836f0 |
This looks like a good way to handle localization. I guess my dream of RoboFont extensions being able to declare their localizations isn't going to work out since NSBundle is immutable. |
maybe a small request: make column headers in a List not sortable. (this could be an argument in init def __init__(self, posSize, … columnsCanSort=True, ….):
…
self._columnsCanSort = columnsCanSort
def _makeColumnsWithColumnDescriptions(self, columnDescriptions):
bindingOptions = None
if self._columnsCanSort:
bindingOptions={NSCreatesSortDescriptorBindingOption:False}
…
column.bind_toObject_withKeyPath_options_(binding, self._arrayController, keyPath, bindingOptions) https://github.com/typesupply/vanilla/blob/yosemite/Lib/vanilla/vanillaList.py#L659 |
yeah a nsBundle is idd immutable and once it is loaded, it seems very hacky to reload it. will check it out... |
Column sorting can now be turned off on a full list or single column basis. Example: import vanilla
class Test(object):
def __init__(self):
self.w = vanilla.Window((500, 500))
columnDescriptions = [
dict(title="one"),
dict(title="two", allowsSorting=False),
dict(title="three"),
]
self.w.l = vanilla.List((10, 10, -10, -10),
[
dict(one="A", two="D", three="G"),
dict(one="B", two="E", three="H"),
dict(one="C", two="F", three="I"),
],
columnDescriptions=columnDescriptions,
allowsSorting=True
)
self.w.open()
from vanilla.test.testTools import executeVanillaTest
executeVanillaTest(Test) |
a proposal for the auto layout https://gist.github.com/typemytype/b9c85801762c579448d7 As this could be a radical change, it maybe better to first concentrate on getting all elements 10.10 ready and then make a new branch focussed on auto layout… but this could be very cool :) |
This looks great! It's all coming back to me now. Using "auto" as the posSize will be a nice indicator. We'll have to look through the vanilla objects to make sure that there aren't any posSize dependencies. I don't think this is going to be that big of a change, but yeah let's get 10.10 support done first. |
and all the existing subclasses... |
a Window object could have an optional argument supporting full screen: # not sure if NSWindowCollectionBehaviorFullScreenPrimary is already in pyObjC
if supportFullSCreen:
try:
self._window.setCollectionBehavior_(128) #NSWindowCollectionBehaviorFullScreenPrimary
except:
# fail silently on 10.6
pass |
We already have support for full screen. I've sketched out the new window appearance settings API above. Let me know what you think. I'm happy with it. |
I committed and pushed the window appearance changes. |
running against some issues on 10.9.5 maybe testing version nrs with distutils is better from distutils.version import StrictVersion
print '10.9' >= '10.10'
print StrictVersion('10.9.5') > StrictVersion('10.10') |
Hm. We could define some constants that use this. Something like: osVersionCurrent = StrictVersion(platform.mac_ver()[0])
osVersion10_10 = StrictVersion("10.10")
osVersion10_9 = StrictVersion("10.9")
osVersion10_8 = StrictVersion("10.8")
osVersion10_7 = StrictVersion("10.7")
osVersion10_6 = StrictVersion("10.6") That way the code wouldn't have a lot of StrictVersion(...) sprinkled throughout. |
I would even add the results as a bool in the constants |
I patched vanilla with using the StrictVersion osVersion comparison. Will send a pull request soon. An other thing that could be handy is a convenient way to put a vanilla.Group into a vanilla.ScrollView. |
a patch to support embedded Groups into a ScrollView https://gist.github.com/typemytype/c9ac5349183209a7d3e7 I can also implement this and send a pull request... |
Thanks. I'm hoping to get back to updating vanilla next week. I had to do some of my day job work and the problem with List made me not want to work on vanilla for a while. I think List is going to have to be rewritten to not use bindings. Ugh. |
added an ActionButton to my fork, can send a pull request when you are ready |
Are there any plans to move that into that master branch? |
I'd love to, but I don't have time right now. My open source time is going to other projects. Patches are welcome! |
I had a quick look at the changes. Some are really related to changes in Yosemite. But there are several things that should work in earlier version, too. Why I can across this is someone tried to write a script that works in RoboFont and Glyphs. And RF 1.7 seems to use a version of vanilla that supports this particular argument (so it might use this branch?). |
Some of this stuff apparently is integrated now, some is not. I suggest to close this issue and open new ones for the remaining feature requests, if that's indeed what they are. |
related to Lists:
yes that is needed, only to support searching and shared dateSource over different views
will create a new issue for that |
Is there any possibility to get the dark VisualEffectViews working? I can trigger light vibrant windows by adding Anyways since there is https://github.com/typesupply/vanilla/blob/2d27b1fe7abfd94a3cc6d574efe804dfad1d4029/Lib/vanilla/vanillaGroup.py#L11 we have no option to choose between the VisualEffectViews, not even when _nsObject is triggered, or is there? |
So, I've got that fixed by adding:
|
Been 6 years, but could you pull request this? It would be handy to use ScrollView without relying on pyobjc and keep vanilla interoperable within itself. |
Just started to read the thread again after seeing the notification. I found this:
The full size content view and titlebar transparency should not be set together. There are a lot cases that need a visible titlebar. It is used when there is a scroll view adjacent to the toolbar and the scrolled content should go under the (translucent) title bar. See Safari and Maps. |
Totally makes sense to me and agree, however my concerns on |
@form-follows-function made a new issue for this request --> #132 |
AppKit Release notes: https://developer.apple.com/library/mac/releasenotes/AppKit/RN-AppKit/
NSVisualEffectView(done)This is handled simply with a new Group kwarg:
Internally, this is handled not so simply.
Window Styles(done)These are the current init kwargs that specify window appearance.
10.10 adds new appearance options: https://developer.apple.com/library/mac/releasenotes/AppKit/RN-AppKit/#10_10Window
Full Size Content View
This pushes the content view underneath the title and toolbars. Those should then be set to be transparent. (Not always, but I don't want two flags so if the transparency is not desired a coder can override this with
getNSWindow().setTitlebarAppearsTransparent_(False)
.) I'm not sure when this is used but we may as well make it possible.Titlebar Visibility
This will show/hide the title of the window. If it is hidden, the toolbar moves to the space formally occupied by the title.
NSTitlebarAccessoryViewController
This is an advanced thing that should be handled outside of vanilla.
HUDWindow(done)Action Button with Menu
How would callbacks work?
List
add ticks to list slider(done)image cell(done)segmented cell(done)image cellcheckbox cellslider cellpopup cellcolumn width bug(hopefully done)should the column resizing behavior be an init kwarg?(no. this is handled with column construction data.)make it possible to disable column sorting.(done)Cell vs. View Mode
Here's a tricky one: the use of cells in NSTableView is now deprecated. Instead, we are supposed to use views. That's easy enough to switch but mixing cells and views in the same table is not permitted. So, we can't simply change things like SliderListCell to be view based instead of cell based. We do need to make the change though. (Plus, view based tables can do some really useful stuff.)
I think we could handle this change by automatically detecting the cell types during
__init__
by skimming the "cell" settings in columnDescriptions. If anything there is cell based, the table view would be set to cell mode. Otherwise it would be set to view mode.I'm still researching this so this could change.
Localization
This is going to require some research on how localization is handled at the app level. I'm not sure if localization will be able to be specified on the fly per control, which is what would be ideal for vanilla.
Auto-Layout
This is going to be tricky but it might be a very worthwhile thing to add.
NSMatrix
This class is now deprecated. It looks like RadioGroup can be rebuilt with a Group as a parent and individual buttons set to be radio buttons. According to the documentation, those will automatically be linked as a group in 10.8+.
Misc
Remove any hacks needed for < 10.6.(done)conditionally remove cell interaction when osVersion >= 10.10 since cells are slowly being deprecated.(done. Apple hasn't assigned view based methods for everything yet so there are still some cell calls.)The text was updated successfully, but these errors were encountered: