Code Monkey home page Code Monkey logo

Comments (7)

r-smith avatar r-smith commented on May 14, 2024

It seems to only happen with a columns widget. Pile widgets don't have this behavior. In a way, mouse hovering causing focus events is a nice feature, just inconsistent with the library. A separate mouse focus widget might be kind of cool.

I came up with a fix for the columns widget, but I don't know if it's the right way to approach it. What do you think of this?

On widgets/columns/columns.go line 300:
Original

if evm, ok := ev.(*tcell.EventMouse); ok {

My proposal

if evm, ok := ev.(*tcell.EventMouse); ok && evm.Buttons() != 0 {

from gowid.

r-smith avatar r-smith commented on May 14, 2024

Hang on, that proposed fix causes other issues with mouse clicks in columns. I'll see if I can work out a better solution.

from gowid.

gcla avatar gcla commented on May 14, 2024

Thanks :) I'll take a look at your examples this weekend

from gowid.

gcla avatar gcla commented on May 14, 2024

Hi @r-smith - could you try your example again with gowid updated to commit 30a0793? Let me know!

from gowid.

gcla avatar gcla commented on May 14, 2024

Err, I changed my mind 😕 Could you try the branch mousefocus instead? I'm not 100% sure of these changes yet, though so far they seem well-behaved. I put them on a branch for a couple of days out of caution. You can make your app use this branch with something like this, assuming your example above is called myapp.go:

mkdir myapp
mv myapp.go myapp/
cd myapp
go mod init myapp
export GO111MODULE=on
go get github.com/gcla/gowid@mousefocus
go run myapp.go

I think this also addresses issue #16.

from gowid.

r-smith avatar r-smith commented on May 14, 2024

I tried the mousefocus branch and it seems to work well. It fixes both issues I reported and so far I can't find any unwanted side effects. I think it looks good. Thanks for taking the time to look into this.

from gowid.

gcla avatar gcla commented on May 14, 2024

np, thanks for the bug report :) I'll close this now

from gowid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.