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

[Patch] Nicer notebook tabs with GTK2

Expand Messages
  • François Ingelrest
    Hi, Here is a patch that improves a bit notebook tabs with GTK2. It: - Groups the creation of tab labels into one function (the code was duplicated at two
    Message 1 of 12 , Apr 30, 2008
    • 0 Attachment
      Hi,

      Here is a patch that improves a bit notebook tabs with GTK2. It:
      - Groups the creation of tab labels into one function (the code was
      duplicated at two places before)
      - Adds a file icon in front of the label

      Here are some screenshots:

      http://www.silent-blade.org/misc/gvim-notebook-before.png
      http://www.silent-blade.org/misc/gvim-notebook-after.png

      Comments are welcome :-)

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_dev" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • sc
      ... I like it better without the icons -- they take up room, and are not useful. sc --~--~---------~--~----~------------~-------~--~----~ You received this
      Message 2 of 12 , Apr 30, 2008
      • 0 Attachment
        On Wednesday 30 April 2008 14:08, François Ingelrest wrote:
        > Hi,
        >
        > Here is a patch that improves a bit notebook tabs with
        > GTK2. It: - Groups the creation of tab labels into one
        > function (the code was duplicated at two places before)
        > - Adds a file icon in front of the label
        >
        > Here are some screenshots:
        >
        > http://www.silent-blade.org/misc/gvim-notebook-before.png
        > http://www.silent-blade.org/misc/gvim-notebook-after.png
        >
        > Comments are welcome :-)

        I like it better without the icons -- they take up room, and
        are not useful.

        sc



        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_dev" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Mikolaj Machowski
        ... Are icons tied with MIME system? So it will be different icon for HTML file, different for C++ .h header? m.
        Message 3 of 12 , Apr 30, 2008
        • 0 Attachment
          Dnia Wednesday 30 of April 2008, François Ingelrest napisał:
          > http://www.silent-blade.org/misc/gvim-notebook-before.png
          > http://www.silent-blade.org/misc/gvim-notebook-after.png
          >
          > Comments are welcome :-)

          Are icons tied with MIME system? So it will be different icon for HTML
          file, different for C++ .h header?

          m.


          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_dev" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • Christian J. Robinson
          ... Actually, Vim already has the filetype detection system, so an icon for each filetype could be defined. I like this idea, but only if it can be implemented
          Message 4 of 12 , Apr 30, 2008
          • 0 Attachment
            On Wed, 30 Apr 2008, Mikolaj Machowski wrote:

            >
            > Dnia Wednesday 30 of April 2008, François Ingelrest napisa?:
            > > http://www.silent-blade.org/misc/gvim-notebook-before.png
            > > http://www.silent-blade.org/misc/gvim-notebook-after.png
            > >
            > > Comments are welcome :-)
            >
            > Are icons tied with MIME system? So it will be different icon for
            > HTML file, different for C++ .h header?

            Actually, Vim already has the filetype detection system, so an icon
            for each filetype could be defined.

            I like this idea, but only if it can be implemented for all--or at
            least most--of the GUI interfaces. And, of course, it should be
            possible to turn the icons in the tabs off.

            - Christian

            --
            It is a mistake to try to look too far ahead. The chain of destiny can only
            be grasped on link at a time. -- Sir Winston Churchill
            Christian J. Robinson <infynity@...> -- http://infynity.spodzone.com/
            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_dev" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---
          • François Ingelrest
            ... The same icon is currently always used, it s a first version of the patch :-) GTK provides a way to get icons from the current theme of the user, so I
            Message 5 of 12 , Apr 30, 2008
            • 0 Attachment
              2008/5/1 Christian J. Robinson <infynity@...>:
              > > Are icons tied with MIME system? So it will be different icon for
              > > HTML file, different for C++ .h header?
              >
              > Actually, Vim already has the filetype detection system, so an icon
              > for each filetype could be defined.
              >
              > I like this idea, but only if it can be implemented for all--or at
              > least most--of the GUI interfaces. And, of course, it should be
              > possible to turn the icons in the tabs off.

              The same icon is currently always used, it's a first version of the patch :-)

              GTK provides a way to get icons from the current theme of the user, so
              I guess it should be possible to display the correct icon based on the
              mime type of the file. However, I can work on this only for GTK, as I
              don't have any Windows or Mac at hand. Also, I don't know what would
              be the best way to disable these icons.

              I would like to get Bram's feedback before continuing to work on this.

              --~--~---------~--~----~------------~-------~--~----~
              You received this message from the "vim_dev" maillist.
              For more information, visit http://www.vim.org/maillist.php
              -~----------~----~----~----~------~----~------~--~---
            • Bram Moolenaar
              ... I also think that the space that the icon takes is too much. Most people edit files of the same type (e.g., all Java files), the icon isn t very helpful
              Message 6 of 12 , May 2, 2008
              • 0 Attachment
                Francois Ingelrest wrote:

                > Here is a patch that improves a bit notebook tabs with GTK2. It:
                > - Groups the creation of tab labels into one function (the code was
                > duplicated at two places before)
                > - Adds a file icon in front of the label
                >
                > Here are some screenshots:
                >
                > http://www.silent-blade.org/misc/gvim-notebook-before.png
                > http://www.silent-blade.org/misc/gvim-notebook-after.png
                >
                > Comments are welcome :-)

                I also think that the space that the icon takes is too much. Most
                people edit files of the same type (e.g., all Java files), the icon
                isn't very helpful then. And when you have two windows in one Tab, what
                icon are you going to show?

                --
                ARTHUR: What?
                BLACK KNIGHT: None shall pass.
                ARTHUR: I have no quarrel with you, good Sir knight, but I must cross
                this bridge.
                BLACK KNIGHT: Then you shall die.
                The Quest for the Holy Grail (Monty Python)

                /// 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 ///

                --~--~---------~--~----~------------~-------~--~----~
                You received this message from the "vim_dev" maillist.
                For more information, visit http://www.vim.org/maillist.php
                -~----------~----~----~----~------~----~------~--~---
              • Tony Mechelynck
                On 02/05/08 22:23, Bram Moolenaar wrote: [...] ... That last one is easy: the icon for the current file (whose name is displayed on the tab). I m not convinced
                Message 7 of 12 , May 2, 2008
                • 0 Attachment
                  On 02/05/08 22:23, Bram Moolenaar wrote:
                  [...]
                  > I also think that the space that the icon takes is too much. Most
                  > people edit files of the same type (e.g., all Java files), the icon
                  > isn't very helpful then. And when you have two windows in one Tab, what
                  > icon are you going to show?
                  >
                  That last one is easy: the icon for the current file (whose name is
                  displayed on the tab).

                  I'm not convinced about "all of the same type": *.vim would go with the
                  *.txt help files, *.html with *.css (and possibly *.js), and so on. Even
                  the Vim sources, which are mostly *.c files, include quite a number of
                  other "lesser" types (Makefiles, read-me-files, a lot of *.po, one *.xs,
                  some shell scripts [both *.bat and *.sh], etc., plus a few *.cpp and a
                  number of *.h which may or may not be "lumped together" with the *.c)

                  I still think that that icon is not obviously needed, but anyway it
                  doesn't concern me much since I use text-style tabs even in gvim, i.e.,
                  with the e flag unset in 'guioptions'.

                  Best regards,
                  Tony.
                  --
                  Serocki's Stricture:
                  Marriage is always a bachelor's last option.

                  --~--~---------~--~----~------------~-------~--~----~
                  You received this message from the "vim_dev" maillist.
                  For more information, visit http://www.vim.org/maillist.php
                  -~----------~----~----~----~------~----~------~--~---
                • François Ingelrest
                  Hi! ... I would not say it s useless in the sense that icons make notebook tabs a bit nicer to look at. I actually never liked notebook tabs in GVim because
                  Message 8 of 12 , May 3, 2008
                  • 0 Attachment
                    Hi!

                    On Fri, May 2, 2008 at 10:23 PM, Bram Moolenaar <Bram@...> wrote:
                    > > Here is a patch that improves a bit notebook tabs with GTK2. It:
                    > > - Groups the creation of tab labels into one function (the code was
                    > > duplicated at two places before)
                    > > - Adds a file icon in front of the label
                    > >
                    > > Here are some screenshots:
                    > >
                    > > http://www.silent-blade.org/misc/gvim-notebook-before.png
                    > > http://www.silent-blade.org/misc/gvim-notebook-after.png
                    > >
                    > > Comments are welcome :-)
                    >
                    > I also think that the space that the icon takes is too much. Most
                    > people edit files of the same type (e.g., all Java files), the icon
                    > isn't very helpful then. And when you have two windows in one Tab, what
                    > icon are you going to show?

                    I would not say it's useless in the sense that icons make notebook
                    tabs a bit nicer to look at. I actually never liked notebook tabs in
                    GVim because they are too narrow and that makes difficult to spot the
                    one I need (the main reason I wrote this small patch). Also, in this
                    perspective, the toolbar is useless as it takes too much space for
                    commands that can already easily be typed. But it's there because it's
                    the GUI version and that's the way GUIs generally look like. The same
                    goes for icons in notebook tabs: Almost all the GUI applications I can
                    think of display such an icon although the label would be sufficient.
                    It's just a bit nicer to look at.

                    Regarding multiple windows in one notebook tab: As Tony said, the
                    active window should be used. Actually the active filetype should be
                    used, and the icon should be updated as soon as it changes, be it
                    because the active window has changed or because the user has :set it.

                    Anyway, if you feel it's useless, I'm fine with that: I'm not going to
                    spend time writing code that people don't want/need. That's also why I
                    wanted your feedback :-)

                    And thanks for taking the time to reply!

                    --~--~---------~--~----~------------~-------~--~----~
                    You received this message from the "vim_dev" maillist.
                    For more information, visit http://www.vim.org/maillist.php
                    -~----------~----~----~----~------~----~------~--~---
                  • Nico Weber
                    ... FWIW, I think this is a nice change. If I edit more than, say, 5 files, I can t use a tab for each file anyways. For just two to three tabs, the icons give
                    Message 9 of 12 , May 3, 2008
                    • 0 Attachment
                      > I would not say it's useless in the sense that icons make notebook
                      > tabs a bit nicer to look at. I actually never liked notebook tabs in
                      > GVim because they are too narrow and that makes difficult to spot the
                      > one I need (the main reason I wrote this small patch). Also, in this
                      > perspective, the toolbar is useless as it takes too much space for
                      > commands that can already easily be typed. But it's there because it's
                      > the GUI version and that's the way GUIs generally look like. The same
                      > goes for icons in notebook tabs: Almost all the GUI applications I can
                      > think of display such an icon although the label would be sufficient.
                      > It's just a bit nicer to look at.

                      FWIW, I think this is a nice change. If I edit more than, say, 5
                      files, I can't use a tab for each file anyways. For just two to three
                      tabs, the icons give the tabs a much nicer look (at least on GTK,
                      where most tabs include file icons. In OS X, tabs usually don't have
                      file icons, so I wouldn't want it in the OS X version).

                      Nico

                      --~--~---------~--~----~------------~-------~--~----~
                      You received this message from the "vim_dev" maillist.
                      For more information, visit http://www.vim.org/maillist.php
                      -~----------~----~----~----~------~----~------~--~---
                    • Antony Scriven
                      ... More than just looking nicer, I think it can be a usability improvement, e.g. Firefox displays the shortcut icon in its tabs; I find this makes finding a
                      Message 10 of 12 , May 6, 2008
                      • 0 Attachment
                        Nico Weber <nicolasweber@...> wrote:

                        > > [...]
                        >
                        > > the GUI version and that's the way GUIs generally look
                        > > like. The same goes for icons in notebook tabs: Almost
                        > > all the GUI applications I can think of display such an
                        > > icon although the label would be sufficient. It's just
                        > > a bit nicer to look at.
                        >
                        > FWIW, I think this is a nice change. If I edit more than,
                        > say, 5 files, I can't use a tab for each file anyways.
                        > For just two to three tabs, the icons give the tabs
                        > a much nicer look (at least on GTK, where most tabs
                        > include file icons. In OS X, tabs usually don't have file
                        > icons, so I wouldn't want it in the OS X version).

                        More than just looking nicer, I think it can be a usability
                        improvement, e.g. Firefox displays the shortcut icon in its
                        tabs; I find this makes finding a tab easier. But... Vim can
                        detect ~500 different filetypes. Who's coming up with 500
                        distinct and easily recognizable icons? --Antony

                        --~--~---------~--~----~------------~-------~--~----~
                        You received this message from the "vim_dev" maillist.
                        For more information, visit http://www.vim.org/maillist.php
                        -~----------~----~----~----~------~----~------~--~---
                      • Antony Scriven
                        ... Btw, I didn t mean for that to sound negative. I d be happy if you could come up with a good solution for that. --Antony
                        Message 11 of 12 , May 6, 2008
                        • 0 Attachment
                          2008/5/6 Antony Scriven <adscriven@...>:

                          > [... about icons for filetypes in GUI tabs ...]
                          > But... Vim can detect ~500 different filetypes. Who's
                          > coming up with 500 distinct and easily recognizable
                          > icons? --Antony

                          Btw, I didn't mean for that to sound negative. I'd be happy
                          if you could come up with a good solution for that. --Antony

                          --~--~---------~--~----~------------~-------~--~----~
                          You received this message from the "vim_dev" maillist.
                          For more information, visit http://www.vim.org/maillist.php
                          -~----------~----~----~----~------~----~------~--~---
                        • François Ingelrest
                          ... GTK actually uses the system icons defined by the user s theme, i.e., you provide it the mime type and it provides you the icon associated to that mime
                          Message 12 of 12 , May 6, 2008
                          • 0 Attachment
                            On Tue, May 6, 2008 at 5:43 PM, Antony Scriven <adscriven@...> wrote:
                            > Nico Weber <nicolasweber@...> wrote:
                            > > > the GUI version and that's the way GUIs generally look
                            > > > like. The same goes for icons in notebook tabs: Almost
                            > > > all the GUI applications I can think of display such an
                            > > > icon although the label would be sufficient. It's just
                            > > > a bit nicer to look at.
                            > >
                            > > FWIW, I think this is a nice change. If I edit more than,
                            > > say, 5 files, I can't use a tab for each file anyways.
                            > > For just two to three tabs, the icons give the tabs
                            > > a much nicer look (at least on GTK, where most tabs
                            > > include file icons. In OS X, tabs usually don't have file
                            > > icons, so I wouldn't want it in the OS X version).
                            >
                            > More than just looking nicer, I think it can be a usability
                            > improvement, e.g. Firefox displays the shortcut icon in its
                            > tabs; I find this makes finding a tab easier. But... Vim can
                            > detect ~500 different filetypes. Who's coming up with 500
                            > distinct and easily recognizable icons? --Antony

                            GTK actually uses the system icons defined by the user's theme, i.e.,
                            you provide it the mime type and it provides you the icon associated
                            to that mime type in the current user's theme. Those icons are the
                            ones that are used for instance in Nautilus. Almost the same goes for
                            the toolbar: AFAIK, icons are taken from the user's theme and are
                            directly provided by GTK.

                            --~--~---------~--~----~------------~-------~--~----~
                            You received this message from the "vim_dev" maillist.
                            For more information, visit http://www.vim.org/maillist.php
                            -~----------~----~----~----~------~----~------~--~---
                          Your message has been successfully submitted and would be delivered to recipients shortly.