Skip to content
This repository has been archived by the owner. It is now read-only.

Add example for dnd in a listbox with a listmodel #245

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

@jsparber
Copy link

@jsparber jsparber commented May 12, 2019

This is an example for implementing a queue or anything where the user
can reader a list via dnd. This includes also some animation for hidding
and showing rows

@jsparber
Copy link
Author

@jsparber jsparber commented May 12, 2019

I still need to add more comments

Loading

@sdroege
Copy link
Member

@sdroege sdroege commented May 13, 2019

Nice :) I'll review once the comments are there, let me know!

Loading

@sdroege
Copy link
Member

@sdroege sdroege commented Jun 19, 2019

@jsparber What's the status of this? Do you plan to update it? :) Would be nice to get this merged as nothing really is missing here apart from some comments from what I understand?

Loading

src/bin/drag_and_drop_listbox_model.rs Outdated Show resolved Hide resolved
Loading
src/bin/drag_and_drop_listbox_model.rs Outdated Show resolved Hide resolved
Loading
let index = row.get_index() as u32;
let alloc = row.get_allocation();

let index = if y < alloc.y + alloc.height/2 {
Copy link
Member

@sdroege sdroege Jun 19, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe you want to run cargo fmt once :)

Loading

Copy link
Member

@sdroege sdroege Sep 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still seems like a good idea :)

Loading

Copy link
Author

@jsparber jsparber Sep 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apparently rustfmt doesn't fix the spaces, actually it doesn't change the file add all

Loading

Copy link
Member

@sdroege sdroege Sep 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's curious. Don't worry about that then, I'll take a look once the code is done

Loading

w.draw(&g);

//TODO fix positioning
//https://stackoverflow.com/questions/24844489/how-to-use-gdk-device-get-position
Copy link
Member

@sdroege sdroege Jun 19, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth to ask someone who knows GTK well to go through these FIXME/TODO comments :)

Loading

Copy link
Author

@jsparber jsparber Aug 30, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those are there because i didn't had time to do it. But are actually not that complicated.

Loading

Copy link
Member

@sdroege sdroege Sep 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's wait until that is done before merging then?

Loading

This is an example for implementing a queue or anything where the user
can needs to rorder a list via dnd. This includes also some animation
for hidding and showing rows
@sdroege
Copy link
Member

@sdroege sdroege commented Sep 12, 2019

@jsparber any updates? :)

Loading

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants