Loading ...
Sorry, an error occurred while loading the content.
 

Re: vim mac close button state patch

Expand Messages
  • Bram Moolenaar
    ... I haven t tried it but it s good to try to make Vim look like other Mac applications. The implementation is rather brute force. I think it won t be
    Message 1 of 3 , Jul 9, 2006
      Nicolas Weber wrote:

      > this patch sets the close button state according to "Indicating
      > Changes With the Close Button" in the Apple HIG ( http://
      > developer.apple.com/documentation/UserExperience/Conceptual/
      > OSXHIGuidelines/XHIGWindows/chapter_17_section_3.html ).
      >
      > I set the button state in gui_mch_flush(), if a buffer was changed
      > then gui_mch_flush() will probably called...at least I couldn't find
      > a better place to do this :-P

      I haven't tried it but it's good to try to make Vim look like other Mac
      applications.

      The implementation is rather brute force. I think it won't be difficult
      to add a call to where buf->b_changed is set or reset and only update
      the info then. I think it can be done in maketitle(), since that's
      where the "+" is added to the window title. Although perhaps unloading
      a changed buffer other than one that's in the current window needs an
      extra call.

      BTW: Instead of b_changed bufIsChanged() should be used, and only for
      loaded buffers.

      --
      At some point in the project somebody will start whining about the need to
      determine the project "requirements". This involves interviewing people who
      don't know what they want but, curiously, know exactly when they need it.
      (Scott Adams - The Dilbert principle)

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      \\\ download, build and distribute -- http://www.A-A-P.org ///
      \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
    • Nicolas Weber
      Hi, ... I ll try to improve it. I like to add proxy icons as well (see above link too), which deprecates this patch anyways. A proxy icon is a small icon of
      Message 2 of 3 , Jul 10, 2006
        Hi,

        >> this patch sets the close button state according to "Indicating
        >> Changes With the Close Button" in the Apple HIG ( http://
        >> developer.apple.com/documentation/UserExperience/Conceptual/
        >> OSXHIGuidelines/XHIGWindows/chapter_17_section_3.html ).
        >
        > I haven't tried it but it's good to try to make Vim look like other
        > Mac
        > applications.
        >
        > The implementation is rather brute force.

        I'll try to improve it. I like to add proxy icons as well (see above
        link too), which deprecates this patch anyways. A proxy icon is a
        small icon of the current document (ie. active buffer in active tab)
        in the windows toolbar which you can drag to other programs (for
        example, to create a link to an opened file, drag its proxy icon to
        some folder in the finder). You can Command-click the proxy icon to
        display the path to the current document as well. When the current
        file isn't saved, the proxy icon is deactivated because it's not
        predictable for the user what happens when you drag the icon.

        Sadly, you call the same function to change the close button and to
        (de)activate the proxy icon, which doesn't work well with
        multidocument windows. I looked at several other mac text editors;
        they all set the close button to the "document was modified" state
        when the active document was modified (to keep the proxy icon for
        unmodified buffers activated when such a buffer is selected). I will
        try to add this behaviour to mac vim as well (but it will take me
        some time, currently I'm busy with exams :-| ).

        Bye & sorry for the long mail,
        Nico
      Your message has been successfully submitted and would be delivered to recipients shortly.