Author Topic: B2: "Name" column goes offscreen in "Files" tool window when clicking on path  (Read 3144 times)

rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
I'm able to reproduce this problem in a VM that I provided in another post: https://community.slickedit.com/index.php/topic,15458.msg58927.html#msg58927

Follow the instructions in that post and get to the point where both "RunContext.hh" and "RunContext.cc" are open.

Make the "Files" tool window visible, and dock it to the same group of windows as "Project", "Open", etc, as illustrated in attached "name_offscreen1.png".

Double click on the part of the file with the "Path" in it, and you will see that the "Name" column disappears and need to scroll to the left to see it again.

See attached pictures for a more graphical description.
« Last Edit: September 05, 2017, 08:29:47 PM by rowbearto »

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2896
  • Hero Points: 153
This is how the Qt tree operates.  If there is a scroll bar (or maybe even if there isn't), when you click on something it scrolls it into view horizontally.  Normally the only place you see it is the tool windows that are docked horizontally.

rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
Is there anything in the Qt API to turn off this behavior?

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2896
  • Hero Points: 153
I haven't found anything, and I have looked.  But I'll take another peek.

rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
OK, thanks for looking.

Now I know to be careful to only click in the "Name" column to avoid this.

jporkkahtc

  • Senior Community Member
  • Posts: 2620
  • Hero Points: 210
  • Text
You can fix this with a change to TBFILELIST.e - and unfortunately, similar changes in other tool windows that have the same problem. Basically, what this does is if you click on the 2nd or later columns it makes like you clicked on the 1st column.

The side effect is now you get the scroll-left problem -- when you click on an item, it will always scroll to the left - but usually this is better than scrolling to the right.


In tbfilelist.e change the lbutton_up() function:

Code: [Select]
#define FIX_SCROLLER
void ctl_file_list.lbutton_up()
{
   #ifdef FIX_SCROLLER
   // This is the change to keep the horizonal scroller to the left.
   // Same code needs to be added to many of the Slickedit listboxes that have the auto-right-scroll bug.
   if (true) {
       int curIndex=_TreeCurIndex();
       if (curIndex<0) {
          return;
       }
       // get a list of the selected items
       int buffers_to_close[];
       buffers_to_close._makeempty();
       bufid := 0;

       int info;
       for (ff:=1;;ff=0) {
          index := ctl_file_list._TreeGetNextSelectedIndex(ff,info);
          if (index <= 0 && ff)
             index = ctl_file_list._TreeCurIndex();
          if (index <= 0)
             break;
          buffers_to_close[buffers_to_close._length()] = index;
       }

       int sib = _TreeGetNextSiblingIndex(curIndex);
       if (sib >= 0) {
           _TreeDeselectAll();
          _TreeSetCurIndex(sib);
       }
       _TreeSetCurIndex(curIndex);
       for (i:=0; i<buffers_to_close._length(); ++i) {
          _TreeSelectLine(buffers_to_close[i], false);
       }
   }
   #else
   if (p_active_form.p_name == DOCUMENT_TAB_FORM) {
      open_selected_files();
   }
   #endif
}

rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
I'd be happy with this change in tbfilelist.e and a scroll left "problem".

Perhaps the official SE build can add a variable to enable/disable to always scroll left in these situations? Then for folks who want to always scroll left we can set this variable.