Skip to content

Commit

Permalink
remove window on taskbar on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
josephshen committed Jul 18, 2017
1 parent 74d7cc7 commit 78336f0
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 9 deletions.
32 changes: 23 additions & 9 deletions src/ColorPicker/ColorPickerHost.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ const QImage& GetPictureSurroundedCurrentCursor()
}

ColorPickerCanvas::ColorPickerCanvas()
// :QWidget(nullptr, Qt::Tool)
#ifdef Q_OS_WIN
:QWidget(nullptr, Qt::Tool)
#endif
#ifdef Q_OS_MAC
:QWidget(nullptr)
#endif
//
,m_pixmap_circle_mask_x1(QPixmap(":/Res/CircleMask"))
,m_pixmap_circle_mask_x2(QPixmap(":/Res/CircleMask@2"))
Expand Down Expand Up @@ -311,6 +315,9 @@ ColorPickerHost::traceMouseButtonDown(const int x, const int y, const int mask)
return;
}
// qDebug() << __CURRENT_FUNCTION_NAME__;
#ifdef Q_OS_MAC
onMousePickedEvent();
#endif // Q_OS_MAC
}

void
Expand All @@ -320,7 +327,21 @@ ColorPickerHost::traceMouseButtonUp(const int x, const int y, const int mask)
return;
}
// qDebug() << __CURRENT_FUNCTION_NAME__;
#ifdef Q_OS_WIN
onMousePickedEvent();
#endif // Q_OS_WIN
}

void
ColorPickerHost::GetFired(int value)
{
// qDebug() << __CURRENT_FUNCTION_NAME__ << value;
ColorPickerHost::SetColorPickerVisible();
}

void
ColorPickerHost::onMousePickedEvent()
{
//qDebug() << currentColor().name().toUpper();
printf("%s\n", currentColor().name().toUpper().toStdString().c_str());
fflush(stdout);
Expand All @@ -332,11 +353,4 @@ ColorPickerHost::traceMouseButtonUp(const int x, const int y, const int mask)

m_color_picker_canvas->close();
qGuiApp->exit(0);
}

void
ColorPickerHost::GetFired(int value)
{
// qDebug() << __CURRENT_FUNCTION_NAME__ << value;
ColorPickerHost::SetColorPickerVisible();
}
}
2 changes: 2 additions & 0 deletions src/ColorPicker/ColorPickerHost.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ private:
void traceMouseMove(const int x, const int y);
void traceMouseButtonDown(const int x, const int y, const int mask);
void traceMouseButtonUp(const int x, const int y, const int mask);
private:
void onMousePickedEvent();
private Q_SLOTS:
void GetFired(int value);
};
Expand Down

0 comments on commit 78336f0

Please sign in to comment.