Add SegmentedIndicators::s_centralIndicatorMaxWidth/height
So the user can change the maximum size of the central indicator
(cherry-picked from commit f84006347b)
This commit is contained in:
@@ -25,7 +25,8 @@ qreal SegmentedIndicators::s_draggedWindowOpacity = 0.7;
|
||||
QColor SegmentedIndicators::s_segmentPenColor = Qt::black;
|
||||
QColor SegmentedIndicators::s_segmentBrushColor = QColor(0xbb, 0xd5, 0xee, /*alpha=*/200);
|
||||
QColor SegmentedIndicators::s_hoveredSegmentBrushColor = QColor(0x3574c5);
|
||||
|
||||
int SegmentedIndicators::s_centralIndicatorMaxWidth = 300;
|
||||
int SegmentedIndicators::s_centralIndicatorMaxHeight = 160;
|
||||
|
||||
SegmentedIndicators::SegmentedIndicators(Controllers::DropArea *dropArea)
|
||||
: DropIndicatorOverlay(dropArea)
|
||||
@@ -98,8 +99,8 @@ QHash<DropLocation, QPolygon> SegmentedIndicators::segmentsForRect(QRect r, bool
|
||||
const QPoint centerPos = bounds.boundingRect().center();
|
||||
|
||||
// Build the center
|
||||
const int indicatorWidth = qMin(300, maxWidth - 100);
|
||||
const int indicatorHeight = qMin(160, int(indicatorWidth * 0.60));
|
||||
const int indicatorWidth = qMin(s_centralIndicatorMaxWidth, maxWidth - 100);
|
||||
const int indicatorHeight = qMin(s_centralIndicatorMaxHeight, int(indicatorWidth * 0.60));
|
||||
const int tabWidth = int(indicatorWidth * 0.267);
|
||||
const int tabHeight = int(indicatorHeight * 0.187);
|
||||
const int centerRectLeft = centerPos.x() - indicatorWidth / 2;
|
||||
|
||||
@@ -35,6 +35,8 @@ public:
|
||||
|
||||
static int s_segmentGirth;
|
||||
static int s_segmentPenWidth;
|
||||
static int s_centralIndicatorMaxWidth;
|
||||
static int s_centralIndicatorMaxHeight;
|
||||
static qreal s_draggedWindowOpacity;
|
||||
static QColor s_segmentPenColor;
|
||||
static QColor s_segmentBrushColor;
|
||||
|
||||
Reference in New Issue
Block a user