diff options
author | Dylam De La Torre <DyXel04@gmail.com> | 2021-11-23 05:21:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-23 04:21:56 +0000 |
commit | a51a54bc5979a2491f152abc47ad54e6b63f27c8 (patch) | |
tree | ce67092b2f6df366033a65a6111e4650866766b2 /components/draglistbox.hpp | |
parent | d88079000a79e6bcbe51c5a2868d57b303b5fcb6 (diff) | |
download | abaddon-portaudio-a51a54bc5979a2491f152abc47ad54e6b63f27c8.tar.gz abaddon-portaudio-a51a54bc5979a2491f152abc47ad54e6b63f27c8.zip |
Restructure source and resource files (#46)
importantly, res is now res/res and css is now res/css
Diffstat (limited to 'components/draglistbox.hpp')
-rw-r--r-- | components/draglistbox.hpp | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/components/draglistbox.hpp b/components/draglistbox.hpp deleted file mode 100644 index 9f204be..0000000 --- a/components/draglistbox.hpp +++ /dev/null @@ -1,45 +0,0 @@ -#pragma once -#include <gtkmm.h> - -class DragListBox : public Gtk::ListBox { -public: - DragListBox(); - - void row_drag_begin(Gtk::Widget *widget, const Glib::RefPtr<Gdk::DragContext> &context); - - bool on_drag_motion(const Glib::RefPtr<Gdk::DragContext> &context, gint x, gint y, guint time) override; - - void on_drag_leave(const Glib::RefPtr<Gdk::DragContext> &context, guint time) override; - - void check_scroll(gint y); - - bool scroll(); - - void on_drag_data_received(const Glib::RefPtr<Gdk::DragContext> &context, int x, int y, const Gtk::SelectionData &selection_data, guint info, guint time) override; - - void add_draggable(Gtk::ListBoxRow *widget); - -private: - Gtk::ListBoxRow *m_hover_row = nullptr; - Gtk::ListBoxRow *m_drag_row = nullptr; - bool m_top = false; - int m_hover_top = 0; - int m_hover_bottom = 0; - bool m_should_scroll = false; - bool m_scrolling = false; - bool m_scroll_up = false; - - constexpr static int SCROLL_STEP_SIZE = 8; - constexpr static int SCROLL_DISTANCE = 30; - constexpr static int SCROLL_DELAY = 50; - - const std::vector<Gtk::TargetEntry> m_entries = { - Gtk::TargetEntry("GTK_LIST_BOX_ROW", Gtk::TARGET_SAME_APP, 0), - }; - - using type_signal_on_drop = sigc::signal<bool, Gtk::ListBoxRow *, int /* new index */>; - type_signal_on_drop m_signal_on_drop; - -public: - type_signal_on_drop signal_on_drop(); // return true to prevent drop -}; |