data: Option to run only C/C++ preprocessor when indexing (issue 297)
* Added as checkbox to indexing start dialog * Only shown for C/C++ projects * Files will be marked incomplete
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
#include "qt/element/QtIconButton.h"
|
||||
|
||||
#include "qt/utility/utilityQt.h"
|
||||
|
||||
QtIconButton::QtIconButton(QString iconPath, QString hoveredIconPath, QWidget* parent)
|
||||
: QPushButton("", parent)
|
||||
, m_iconPath(iconPath)
|
||||
, m_hoveredIconPath(hoveredIconPath)
|
||||
, m_color(Qt::transparent)
|
||||
{
|
||||
setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
||||
setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac
|
||||
@@ -14,11 +17,17 @@ QtIconButton::QtIconButton(QString iconPath, QString hoveredIconPath, QWidget* p
|
||||
leaveEvent(nullptr);
|
||||
}
|
||||
|
||||
void QtIconButton::setColor(QColor color)
|
||||
{
|
||||
m_color = color;
|
||||
leaveEvent(nullptr);
|
||||
}
|
||||
|
||||
void QtIconButton::enterEvent(QEvent *event)
|
||||
{
|
||||
if (m_hoveredIconPath.size())
|
||||
{
|
||||
setIcon(QIcon(QPixmap(m_hoveredIconPath)));
|
||||
setIconFromPath(m_hoveredIconPath);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +35,18 @@ void QtIconButton::leaveEvent(QEvent *event)
|
||||
{
|
||||
if (m_iconPath.size())
|
||||
{
|
||||
setIcon(QIcon(QPixmap(m_iconPath)));
|
||||
setIconFromPath(m_iconPath);
|
||||
}
|
||||
}
|
||||
|
||||
void QtIconButton::setIconFromPath(QString path)
|
||||
{
|
||||
QPixmap pixmap = QPixmap(path);
|
||||
|
||||
if (m_color != Qt::transparent)
|
||||
{
|
||||
pixmap = utility::colorizePixmap(pixmap, m_color);
|
||||
}
|
||||
|
||||
setIcon(QIcon(pixmap));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user