10#include <QContextMenuEvent>
83 void dropEvent(QDropEvent* event)
override;
90 void updateDropIndicator(
const QPoint& pos);
91 int findInsertIndex(
const QPoint& pos)
const;
96 QHBoxLayout* layout_ =
nullptr;
97 std::map<QString, DraggableToolbarSection*> sections_;
98 QList<DraggableToolbarSection*> orderedSections_;
99 std::map<QString, ToolbarSpacer*> spacersBefore_;
102 int dropIndicatorIndex_ = -1;
103 bool showDropIndicator_ =
false;
106 QWidget* endSpacer_ =
nullptr;
109 bool locked_ =
false;
151 return contentLayout_;
155 void setResizable(
bool resizable,
int minWidth = 50,
int maxWidth = 400);
189 bool isOnResizeHandle(
const QPoint& pos)
const;
192 QString displayName_;
194 QHBoxLayout* contentLayout_ =
nullptr;
197 QPoint dragStartPos_;
198 bool dragging_ =
false;
199 bool hovered_ =
false;
203 bool resizable_ =
false;
204 bool resizing_ =
false;
205 int resizeStartX_ = 0;
206 int originalWidth_ = 0;
210 static constexpr int RESIZE_HANDLE_WIDTH = 6;
211 static constexpr int DRAG_START_DISTANCE = 10;