Thursday, June 9, 2011

KDevelop: Browser Like Tabs

After the very nice week in Randa at the KDevelop sprint - which I enjoyed a lot (big thanks to Mario and his helpers for that) -  I'd like to present an idea for a fundamental UI change for KDevelop I had for quite some time.
The problem I want to solve is that due to the very good code navigation features you end up with many many open files - which are displayed as tabs. And tabs just don't scale - the only thing that helps is regular closing.
When "browsing" source code, you normally browse like with a web browser. And I think everybody would agree that opening a new tab for every clicked link would be stupid. In a web browser the user has the choice. Ctrl+Click opens a new tab, a normal click navigates to the link in the current tab. When entering an url the same - by default stay in the same tab, but the user can choose to open a new tab first.
And exactly that I implemented for KDevelop:
  •  by default open in current tab
    • except: current file as unsaved changes
    • or: current tab is marked as "Sticky" (as in "Keep it open, I want to edit that file")
  • Keyboard modifiers for actions that open files
    • Code navigation in document: Ctrl+Shift+Click (instead of Ctrl+Click)
    • Ctrl+Enter in Quick Open
    • Ctrl+Click in Project View
If this sounds interesting for you - give it a try! Checkout the "browser-like-tabs" branch in kdevplatfrom and kdevelop:

git clone git://anongit.kde.org/kdevplatform
git checkout browser-like-tabs
mkdir build && cd build && cmake .. && make && make install

git clone git://anongit.kde.org/kdevelop
git checkout browser-like-tabs
mkdir build && cd build && cmake .. && make && make install

Activate the feature in Configuration -> UI Configuration -> Browser like tabs checkbox. (It's disabled by default) Try to get used to it, and send us your thoughts to our mailing list.

TODO:
  • The history navigation is broken
  • Modifiers for Filesystem view and Grep view
  • Find solution for Ctrl+Dbl-Click in project view extends selection