Renamed function

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97 2023-06-28 18:41:47 +03:00
parent 8f9bd9617f
commit 0008b22d8b
No known key found for this signature in database
GPG Key ID: 55EF5DA53DB36318
3 changed files with 8 additions and 5 deletions

View File

@ -927,7 +927,7 @@ void MainWindow::onCatToggled(bool state)
void MainWindow::setCatBackground(bool enabled) void MainWindow::setCatBackground(bool enabled)
{ {
view->setCatVisible(enabled); view->setPaintCat(enabled);
view->viewport()->repaint(); view->viewport()->repaint();
} }

View File

@ -74,7 +74,7 @@ InstanceView::InstanceView(QWidget *parent)
setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
setAcceptDrops(true); setAcceptDrops(true);
setAutoScroll(true); setAutoScroll(true);
setCatVisible(APPLICATION->settings()->get("TheCat").toBool()); setPaintCat(APPLICATION->settings()->get("TheCat").toBool());
} }
InstanceView::~InstanceView() InstanceView::~InstanceView()
@ -500,10 +500,13 @@ void InstanceView::mouseDoubleClickEvent(QMouseEvent *event)
} }
} }
void InstanceView::setCatVisible(bool visible) void InstanceView::setPaintCat(bool visible)
{ {
m_catVisible = visible; m_catVisible = visible;
m_catPixmap.load(QString(":/backgrounds/%1").arg(ThemeManager::getCatImage())); if (visible)
m_catPixmap.load(QString(":/backgrounds/%1").arg(ThemeManager::getCatImage()));
else
m_catPixmap = QPixmap();
} }
void InstanceView::paintEvent(QPaintEvent* event) void InstanceView::paintEvent(QPaintEvent* event)

View File

@ -86,7 +86,7 @@ public:
virtual QRegion visualRegionForSelection(const QItemSelection &selection) const override; virtual QRegion visualRegionForSelection(const QItemSelection &selection) const override;
int spacing() const { return m_spacing; }; int spacing() const { return m_spacing; };
void setCatVisible(bool visible); void setPaintCat(bool visible);
public slots: public slots:
virtual void updateGeometries() override; virtual void updateGeometries() override;