-
Notifications
You must be signed in to change notification settings - Fork 569
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 file format popup mac #1847
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, this looks good! A few comments inline, and CI is complaining in a few places, but all trivial things. Thanks!
@@ -142,3 +164,116 @@ pub(crate) unsafe fn build_panel(ty: FileDialogType, mut options: FileDialogOpti | |||
} | |||
panel | |||
} | |||
|
|||
// AppKit has a build-in file format accessory view. However, this is only |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// AppKit has a build-in file format accessory view. However, this is only | |
// AppKit has a built-in file format accessory view. However, this is only |
let _: () = msg_send![label, setDrawsBackground:false]; | ||
// FIXME: As we have to roll our own view hierachy, we're not getting a translated | ||
// title here. So we ought to find a way to translate this. | ||
let title = NSString::alloc(nil).init_str("File Format:").autorelease(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is interesting. our architecture does not expect druid-shell to ever need to be locale aware; the idea is that localization will happen higher up in the stack, with correctly localized strings passed in to druid-shell where needed. I'm not sure how best to do that here, though. For the time being I'm happy to punt on this, but we will want to revisit it eventually..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks!
It looks like we used to expose the path
field through a getter, but I think having both of these be pub
is reasonable.
Okay, CI is failing because |
Thanks! @cmyr I'll have a look now. Sorry for the long delay, the last couple of days were rather busy. |
I think this needs to be rebased to fix the clippy lints. :( |
Updated docs, thanks! Co-authored-by: Colin Rofls <[email protected]>
Thanks! Co-authored-by: Colin Rofls <[email protected]>
afd0ba2
to
702a131
Compare
@cmyr I did a rebase, I guess there is no easy way to run the Windows test suite locally except by booting up a Windows machine or running a VM, right? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thank you very much @terhechte!
This fixes #998 by adding a file format popup. A couple of caveats (as also explained in my comment here:
NSDocument
based apps. In order to have a similar experience, we have to build our own view hierarchy. This might not be pixel perfect similar to, say, how TextEdit does it.File Format:
is currently hard coded into the implementation. This is fine but will break with localization. There's no way to retrieve the operating system resource that is used in apps like TextEdit.This is what it looks like:
![Screen Shot 2021-07-02 at 11 41 21](https://user-images.githubusercontent.com/132234/124274510-a571fc00-db41-11eb-8e3a-11e1148218c9.png)