mirror of
https://gitlab.gnome.org/june/top-bar-organizer.git
synced 2026-01-11 16:53:51 +01:00
Update: Scroll preferences window content on Drag-and-Drop
Scroll the content of the preferences window on Drag-and-Drop, when the mouse is in the upper or lower part of the content of the preferences window. This helps a user, who has e.g. a lot of items, but the preferences window with a low height, to easily move any item to any position.
This commit is contained in:
parent
a4ea0c630a
commit
edfa50f254
3 changed files with 127 additions and 2 deletions
|
|
@ -31,7 +31,7 @@ var PrefsBoxOrderItemRow = GObject.registerClass({
|
|||
Template: Me.dir.get_child("prefs-box-order-item-row.ui").get_uri(),
|
||||
Children: ["item-name-display-label"]
|
||||
}, class PrefsBoxOrderItemRow extends Gtk.ListBoxRow {
|
||||
_init(params = {}) {
|
||||
_init(params = {}, scrollManager) {
|
||||
super._init(params);
|
||||
|
||||
// Make `this` draggable by creating a drag source and adding it to
|
||||
|
|
@ -41,6 +41,10 @@ var PrefsBoxOrderItemRow = GObject.registerClass({
|
|||
dragSource.connect("prepare", () => {
|
||||
return Gdk.ContentProvider.new_for_value(this);
|
||||
});
|
||||
// Stop all scrolling, which is due to this DND operation.
|
||||
dragSource.connect("drag-end", () => {
|
||||
scrollManager.stopScrollAll();
|
||||
});
|
||||
this.add_controller(dragSource);
|
||||
|
||||
/// Make `this` accept drops by creating a drop target and adding it to
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue