bugGNU Octave - Bugs: bug #53346, Command History window selects two...

 
 

bug #53346: Command History window selects two lines with mouse click

Submitter:  Dan Sebald <sebald>
Submitted:  Wed 14 Mar 2018 10:28:26 PM UTC
   
 
Category:  GUI Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 22 Mar 2018 07:13:58 PM UTC, comment #5: 

I don't see any underlining (Cinnamon on Mint).  Strange.  Is it underlining just the text?  Or could it be the outline of the whole area being selected but a portion of the outline is hidden by a line above or below?  Could you screen capture after selecting a few lines?  Perhaps a new bug report (for search benefit in the future).

Dan Sebald <sebald>
Thu 22 Mar 2018 06:11:25 PM UTC, comment #4: 

I pushed your change to the stable branch here (http://hg.savannah.gnu.org/hgweb/octave/rev/2eca27a6c876).  I notice that when selecting a line of history, the text itself is underlined.  Do we need that?  It seems like it is enough that the selected line itself appears in a different highlight color.

Marking this bug as fixed and closing.

Rik <rik5>
Group administrator
Thu 22 Mar 2018 07:46:06 AM UTC, comment #3: 
Dan Sebald <sebald>
Thu 22 Mar 2018 07:32:07 AM UTC, comment #2: 

I believe I've found the issue.  I'm attaching a patch.

I'm also attaching a couple screen shots to illustrate how this two-line-select comes about.  There is a QListView and then there is a model-selector object (I think, roughly speaking) and somehow those two have to be in agreement.  That is, the list is displaying items with a particular grid size, and the selector is selecting things within a particular rectangle size.

I changed the grid size to h/2 as below:


    m_history_list_view->setGridSize (QSize (w,h/2));


and then got the result in screenshot history_multiline_h_divide_by_2_Screenshot_from_2018-03-22_02-01-54.png  Notice how the selector now appears to scan across 4 lines, so one click selects four lines.

OK, other direction.  I changed th grid size to h + 10 as below:


    m_history_list_view->setGridSize (QSize (w,h+10));


which resulted in the screenshot history_multiline_h_plus_10_Screenshot_from_2018-03-22_02-08-21.png  Notice how the much more spaced lines result in only one line selected with a click.

The Qt documentation suggests that the default is typically fine rather than trying to hand-roll the sizes.  I suppose the original programmer was intending to fit more lines in the window via narrower spacing or something.  If we want to do that, then we'll have to experiment with the grid size and the selector size.

(file #43624,

Dan Sebald <sebald>
Thu 22 Mar 2018 05:04:09 AM UTC, comment #1: 

Confirmed.  I find that if I also do a second click that the two highlighted entries then go to just a single one.  But that is a pretty poor workaround.

Rik <rik5>
Group administrator
Wed 14 Mar 2018 10:28:26 PM UTC, original submission:  

I'm finding that if I click on a line in the Command History window that two lines are selected: the line clicked, and the line below that.  Copy/paste will yank the two lines.  If after the two lines are selected I click one of those two lines only that line is highlighted.

I thought it might have something to do with alternate row highlighting, but the File Browser also has alternate row highlighting and doesn't exhibit this problem.

Dan Sebald <sebald>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by sebald (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-03-22 rik5 StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2018-03-22 sebald Attached File- Added octave-history_two_line_select-djs2018mar22.patch, #43624
        Attached File- Added history_multiline_h_divide_by_2_Screenshot_from_2018-03-22_02-01-54.png, #43625
        Attached File- Added history_multiline_h_plus_10_Screenshot_from_2018-03-22_02-08-21.png, #43626
    2018-03-22 rik5 StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code