Capture GUI refactor (#1939)
* Merge CTB::ButtonType into CaptureTool::Type Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com> * Remove configshortcuts.cpp which I forgot to do earlier Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com> * Add activeButtonTool & activeButtonToolType in CaptureWidget Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com> * Rename slots in CaptureTool for better mnemonics Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com> * Fix move tool bug Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com> * Refactor ShortcutsWidget::initButtons Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com> * Move code from CaptureWidget to SelectionWidget: part 1 Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com> * Move code from CaptureWidget to SelectionWidget: part 2 Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com> * Move code from CaptureWidget to SelectionWidget: part 3 Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com> * Move code from CaptureWidget to SelectionWidget: part 4 Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com> * Add SelectionWidget::updateCursor Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com> * Move code from CaptureWidget to SelectionWidget: part 5 Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com> * Refactor mouse events in CaptureWidget Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com> * Overlay message update Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com> * Replace connect/disconnect with blockSignals Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com> * updateIcon on button animation finished Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com> * Remove CaptureWidget::selectAll Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com> * Move moveLeft and similar to SelectionWidget Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com> * Mark update calls for removal Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com> * Specialize CaptureWidget update to affected rects Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com> * Tune update of tool objects Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com> * Remove redundant CaptureTool requests Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com> * Improve performance of update in CaptureWidget Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com> * Fix failing builds Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com> * Fix failing builds again Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com> * Fix undo/redo update Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com> * Undo/redo update workaround Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com> * Extend capture tool update rects Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com> * Fix circle count tool update bug Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com> * Add 'Left Double-Click' tooltip to copy button Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com> * Improve ColorPicker performance Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
This commit is contained in:
@@ -57,6 +57,11 @@ bool TextTool::showMousePreview() const
|
||||
return false;
|
||||
}
|
||||
|
||||
QRect TextTool::boundingRect() const
|
||||
{
|
||||
return m_textArea;
|
||||
}
|
||||
|
||||
QIcon TextTool::icon(const QColor& background, bool inEditor) const
|
||||
{
|
||||
Q_UNUSED(inEditor)
|
||||
@@ -82,9 +87,9 @@ QString TextTool::info()
|
||||
return name();
|
||||
}
|
||||
|
||||
ToolType TextTool::type() const
|
||||
CaptureTool::Type TextTool::type() const
|
||||
{
|
||||
return ToolType::TEXT;
|
||||
return CaptureTool::TYPE_TEXT;
|
||||
}
|
||||
|
||||
QString TextTool::description() const
|
||||
@@ -220,7 +225,7 @@ void TextTool::drawObjectSelection(QPainter& painter)
|
||||
if (m_text.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
drawObjectSelectionRect(painter, m_textArea);
|
||||
drawObjectSelectionRect(painter, boundingRect());
|
||||
}
|
||||
|
||||
void TextTool::paintMousePreview(QPainter& painter,
|
||||
@@ -252,7 +257,7 @@ void TextTool::pressed(const CaptureContext& context)
|
||||
Q_UNUSED(context)
|
||||
}
|
||||
|
||||
void TextTool::colorChanged(const QColor& c)
|
||||
void TextTool::onColorChanged(const QColor& c)
|
||||
{
|
||||
m_color = c;
|
||||
if (m_widget) {
|
||||
@@ -260,7 +265,7 @@ void TextTool::colorChanged(const QColor& c)
|
||||
}
|
||||
}
|
||||
|
||||
void TextTool::thicknessChanged(int th)
|
||||
void TextTool::onThicknessChanged(int th)
|
||||
{
|
||||
m_size = th;
|
||||
m_font.setPointSize(m_size + BASE_POINT_SIZE);
|
||||
|
||||
Reference in New Issue
Block a user