Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sidebar slider not resizing #2530

Merged
merged 1 commit into from
Apr 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/widgets/capture/capturewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1225,6 +1225,7 @@ void CaptureWidget::handleToolSignal(CaptureTool::Request r)
*/
void CaptureWidget::onToolSizeChanged(int t)
{
m_context.toolSize = t;
CaptureTool* tool = activeButtonTool();
if (tool && tool->showMousePreview()) {
setCursor(Qt::BlankCursor);
Expand All @@ -1247,6 +1248,7 @@ void CaptureWidget::onToolSizeChanged(int t)
drawToolsData();
updateTool(toolItem);
}

// Force a repaint to prevent artifacting
this->repaint();
}
Expand Down
10 changes: 5 additions & 5 deletions src/widgets/panel/sidepanelwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ SidePanelWidget::SidePanelWidget(QPixmap* p, QWidget* parent)
, m_pixmap(p)
{

if (parent) {
if (parent != nullptr) {
parent->installEventFilter(this);
}

Expand Down Expand Up @@ -101,11 +101,11 @@ SidePanelWidget::SidePanelWidget(QPixmap* p, QWidget* parent)
&SidePanelWidget::colorChanged);
}

void SidePanelWidget::onColorChanged(const QColor& c)
void SidePanelWidget::onColorChanged(const QColor& color)
{
m_color = c;
updateColorNoWheel(c);
m_colorWheel->setColor(c);
m_color = color;
updateColorNoWheel(color);
m_colorWheel->setColor(color);
}

void SidePanelWidget::onToolSizeChanged(int t)
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/panel/sidepanelwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class SidePanelWidget : public QWidget

signals:
void colorChanged(const QColor& color);
void toolSizeChanged(int tootl);
void toolSizeChanged(int size);
void togglePanel();

public slots:
Expand Down