namespace pv {
namespace view {
-const int ViewItem::HighlightRadius = 6;
+const QSizeF ViewItem::LabelPadding(4, 0);
+const int ViewItem::HighlightRadius = 3;
ViewItem::ViewItem() :
- context_parent_(NULL),
- selected_(false),
- drag_point_(INT_MIN, INT_MIN)
+ context_parent_(nullptr),
+ drag_point_(INT_MIN, INT_MIN),
+ selected_(false)
{
}
return drag_point_.x() != INT_MIN && drag_point_.y() != INT_MIN;
}
-QPoint ViewItem::drag_point() const
-{
- return drag_point_;
-}
-
void ViewItem::drag()
{
- drag_point_ = point();
+ drag_point_ = point(QRect());
}
void ViewItem::drag_release()
drag_point_ = QPoint(INT_MIN, INT_MIN);
}
+QRectF ViewItem::hit_box_rect(const QRectF &rect) const
+{
+ (void)rect;
+ return QRectF();
+}
+
QMenu* ViewItem::create_context_menu(QWidget *parent)
{
context_parent_ = parent;
QPen ViewItem::highlight_pen()
{
return QPen(QApplication::palette().brush(
- QPalette::Highlight), HighlightRadius,
+ QPalette::Highlight), HighlightRadius * 2,
Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin);
}
+void ViewItem::paint_back(QPainter &p, const ViewItemPaintParams &pp)
+{
+ (void)p;
+ (void)pp;
+}
+
+void ViewItem::paint_mid(QPainter &p, const ViewItemPaintParams &pp)
+{
+ (void)p;
+ (void)pp;
+}
+
+void ViewItem::paint_fore(QPainter &p, const ViewItemPaintParams &pp)
+{
+ (void)p;
+ (void)pp;
+}
+
QColor ViewItem::select_text_colour(QColor background)
{
- return (background.lightness() > 64) ? Qt::black : Qt::white;
+ return (background.lightness() > 110) ? Qt::black : Qt::white;
}
} // namespace view