Skip to content

Text should be also selectable in "read only" mode #1123

Closed

Description

@vlakoff

I open a database in "read only" mode, then I select a cell. Its content is displayed in the "edit database cell" top right pane. The widget is read only (grayed out), but the text is not selectable, it would be convenient if it were :)

Activity

  1. justinclift commented on Sep 9, 2017

    @justinclift
    Member

    Ohhh yeah. That definitely makes sense.

    Thanks for reporting it @vlakoff, that should be pretty easy to fix. 😄

  2. added
    bugConfirmed bugs or reports that are very likely to be bugs.
    on Sep 9, 2017
  3. added this to the 3.10.1 - Gaaah! milestone on Sep 9, 2017
  4. MKleusberg commented on Sep 10, 2017

    @MKleusberg
    Member

    This should work in tomorrow's nightly build. Are you ok to download that and test if it's working as expected, @vlakoff? 😄

  5. vlakoff commented on Sep 10, 2017

    @vlakoff
    ContributorAuthor

    Sure thing. Apparently it wasn't as trivial to fix as I was hoping.

    Will the textarea still be grayed out?

  6. MKleusberg commented on Sep 10, 2017

    @MKleusberg
    Member

    No, the text area shouldn't be greyed out anymore in the new version 😄 You won't be able to edit the contents but you should be able to select and copy it.

    The change is indeed a bit tricky but not that complicated. If you're interested I can explain a little 😉 The Edit Database Cell dock can be put into three different states: completely disabled, read only mode, and fully enabled. So all I had to do is make sure that it's put into read only mode if the database is opened in read only mode. However, there are tons of different scenarios where we're changing the state of the dialog. It depends on whether a database is opened or not, the active tab, whether you're browsing a table or a view, ... Because of this we not only have to make sure that the dialog is put into read only mode but also that in stays in read only mode. But all that should be done in the next nightly 😄

  7. vlakoff commented on Sep 11, 2017

    @vlakoff
    ContributorAuthor

    I have tried it, at first glance it seems to work, I can select text using the mouse.

    (fwiw, the pane looks like the "non read-only mode": on first draw the pane has a white background and the text has a grey background, which disappears after I click in the pane)

    One caveat though: there is no blinking caret, so notably I can't select text using keyboard Shift + arrows.

  8. justinclift commented on Sep 18, 2017

    @justinclift
    Member

    @MKleusberg Should we leave this open and look into the blinking caret thing, or close this?

  9. MKleusberg commented on Sep 18, 2017

    @MKleusberg
    Member

    I think we can leave it open and see if we can do something about it. It looks like this is more a Qt issue than a DB4S one but maybe we can work around it somehow. But I haven't tried yet to be honest 😄

  10. vlakoff commented on Sep 19, 2017

    @vlakoff
    ContributorAuthor

    Just in case, I asked about it on Stack Overflow.

  11. justinclift commented on Sep 19, 2017

    @justinclift
    Member

    @vlakoff Good thinking. 😄

    If you're into IRC, asking on the Qt IRC channel is likely to get helpful info too.

  12. added a commit that references this issue on Dec 5, 2017
  13. mgrojo commented on Dec 5, 2017

    @mgrojo
    Member

    @vlakoff I've just applied the answer from Stack Overflow and it works as expected. If you want to take a look at the next nightly build: https://nightlies.sqlitebrowser.org/latest

  14. justinclift commented on Dec 6, 2017

    @justinclift
    Member

    @mgrojo Good stuff. @vlakoff If you have a chance to, would you be ok to test this and confirm if it does/doesn't work well for you now?

    @vlakoff As a thought, maybe also let ekhumoro on Stack Overflow know too, as they mention they use DB4S as well and were interested in knowing if it worked. 😄

  15. vlakoff commented on Dec 6, 2017

    @vlakoff
    ContributorAuthor

    It seems to work. Just a minor caveat: the caret doesn't blink 😄

    Also, as discussed earlier, any chance the textarea background could be made grey again?

  16. vlakoff commented on Dec 9, 2017

    @vlakoff
    ContributorAuthor

    I just found this forum thread: http://www.qtcentre.org/threads/39941-readonly-QTextEdit-with-visible-Cursor.

    • post #6: An user uses the same fix as here, and he has a non-blinking caret too.
    • post #7: Another solution is proposed, though it seems a bit heavy...

    So, I guess the current solution is the best we can achieve, isn't it?

  17. mgrojo commented on Feb 3, 2018

    @mgrojo
    Member

    @vlakoff I made a change for setting the same palette as the disabled state. It seems to affect only the selection and not the background, but that could be only in my environment. If you'd like to test it, it will be available in the next nightly build.

    I don't think that the non-bllinking caret is an issue. That would make me think that I can write, and that wouldn't be true.

  18. vlakoff commented on Feb 4, 2018

    @vlakoff
    ContributorAuthor

    I have just tested it, and it seems to work as expected on Windows 7: the whole pane background is grey.

    As a reminder, previously I was seeing it as so:

    (fwiw, the pane looks like the "non read-only mode": on first draw the pane has a white background and the text has a grey background, which disappears after I click in the pane)

  19. mgrojo commented on Feb 5, 2018

    @mgrojo
    Member

    Great to know. Then, can we close this issue? Or does anybody still think that the caret should blink?

  20. vlakoff commented on Feb 6, 2018

    @vlakoff
    ContributorAuthor

    I think it should be good enough. Text is now selectable, and background is grey, as previously. A handful of code has already been added to achieve this. Going further would be what I call "excess of quality".

  21. mgrojo commented on Feb 6, 2018

    @mgrojo
    Member

    Ok, @vlakoff Thanks for your feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed bugs or reports that are very likely to be bugs.

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions