Skip to content

Commit

Permalink
prevent using GNOME's horrible color dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
ddennedy committed Aug 30, 2023
1 parent 38af070 commit 47bba2c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/qmltypes/colordialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ ColorDialog::ColorDialog(QObject *parent)
void ColorDialog::open()
{
auto color = m_color;
auto newColor = QColorDialog::getColor(color, nullptr, m_title, QColorDialog::ShowAlphaChannel);
QColorDialog::ColorDialogOptions flags = QColorDialog::ShowAlphaChannel;
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
if (qEnvironmentVariableIsSet("SNAP") || qEnvironmentVariableIsSet("GNOME_SHELL_SESSION_MODE"))
flags = flags | QColorDialog::DontUseNativeDialog;
#endif
auto newColor = QColorDialog::getColor(color, nullptr, m_title, flags);
if (newColor.isValid()) {
auto rgb = newColor;
auto transparent = QColor(0, 0, 0, 0);
Expand Down

0 comments on commit 47bba2c

Please sign in to comment.