From b4aec80fb155d11cde43352cf92090ee593807c5 Mon Sep 17 00:00:00 2001 From: Unit 193 Date: Sun, 1 Oct 2023 22:15:28 -0400 Subject: New upstream version 1.0. --- AUTHORS | 2 +- ChangeLog | 5 +++++ README | 6 ++++-- src/qt5gtk2-qtplugin/main.cpp | 5 +++-- src/qt5gtk2-qtplugin/qt5gtk2.json | 2 +- src/qt5gtk2-qtplugin/qt5gtk2dialoghelpers.cpp | 2 +- src/qt5gtk2-qtplugin/qt5gtk2dialoghelpers.h | 2 +- src/qt5gtk2-qtplugin/qt5gtk2theme.cpp | 2 +- src/qt5gtk2-qtplugin/qt5gtk2theme.h | 2 +- src/qt5gtk2-style/plugin.cpp | 2 +- src/qt5gtk2-style/qgtk2painter.cpp | 9 ++++----- src/qt5gtk2-style/qgtk2painter_p.h | 2 +- src/qt5gtk2-style/qgtkglobal_p.h | 2 +- src/qt5gtk2-style/qgtkpainter.cpp | 2 +- src/qt5gtk2-style/qgtkpainter_p.h | 2 +- src/qt5gtk2-style/qgtkstyle.cpp | 19 ++++++++----------- src/qt5gtk2-style/qgtkstyle_p.cpp | 4 ++-- src/qt5gtk2-style/qgtkstyle_p.h | 2 +- src/qt5gtk2-style/qgtkstyle_p_p.h | 2 +- src/qt5gtk2-style/qstylehelper.cpp | 3 +-- src/qt5gtk2-style/qstylehelper_p.h | 2 +- 21 files changed, 41 insertions(+), 38 deletions(-) diff --git a/AUTHORS b/AUTHORS index 48a6c79..6f3788a 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,2 +1,2 @@ The Qt Company Ltd. -Ilya Kotov , , +Ilya Kotov , , diff --git a/ChangeLog b/ChangeLog index a8ac813..047b63a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -31,3 +31,8 @@ Version 0.7 Version 0.8 * Added preview support to the file dialog (Ilya Fedin) + +Version 1.0 +* Moved home page to GitHub +* Added compatibility with qt6gtk2 +* Removed deprecated code diff --git a/README b/README index 0d3ab76..f2633e9 100644 --- a/README +++ b/README @@ -1,6 +1,6 @@ Qt5Gtk2 - GTK+2.0 integration plugins for Qt5 -Official home page: https://bitbucket.org/trialuser02/qt5gtk2 +Official home page: https://github.com/trialuser02/qt5gtk2 Requirements: @@ -26,6 +26,8 @@ the following line: export QT_QPA_PLATFORMTHEME=qt5gtk2 +(qt6gtk2 for compatibility with Qt5Gtk2) + Now restart X11 server to take the changes effect. Files and directories: @@ -34,4 +36,4 @@ libqt5gtk2.so - GTK+2.0 platform plugin libqt5gtk2-style.so - GTK+2.0 style plugin Attention! -Environment variable QT_STYLE_OVERRIDE should be removed before usage. \ No newline at end of file +Environment variable QT_STYLE_OVERRIDE should be removed before usage. diff --git a/src/qt5gtk2-qtplugin/main.cpp b/src/qt5gtk2-qtplugin/main.cpp index 096a226..5084a73 100644 --- a/src/qt5gtk2-qtplugin/main.cpp +++ b/src/qt5gtk2-qtplugin/main.cpp @@ -1,6 +1,6 @@ /*************************************************************************** * Copyright (C) 2015 The Qt Company Ltd. * - * Copyright (C) 2016-2022 Ilya Kotov, forkotov02@ya.ru * + * Copyright (C) 2016-2023 Ilya Kotov, forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -35,7 +35,8 @@ public: QPlatformTheme *Qt5Gtk2ThemePlugin::create(const QString &key, const QStringList ¶ms) { Q_UNUSED(params); - if (!key.compare(QLatin1String(Qt5Gtk2Theme::name), Qt::CaseInsensitive)) + if (!key.compare(QLatin1String(Qt5Gtk2Theme::name), Qt::CaseInsensitive) || + !key.compare(QLatin1String("qt6gtk2"), Qt::CaseInsensitive)) return new Qt5Gtk2Theme; return 0; diff --git a/src/qt5gtk2-qtplugin/qt5gtk2.json b/src/qt5gtk2-qtplugin/qt5gtk2.json index cb1b4b1..56e63db 100644 --- a/src/qt5gtk2-qtplugin/qt5gtk2.json +++ b/src/qt5gtk2-qtplugin/qt5gtk2.json @@ -1,3 +1,3 @@ { - "Keys": [ "qt5gtk2" ] + "Keys": [ "qt5gtk2", "qt6gtk2" ] } diff --git a/src/qt5gtk2-qtplugin/qt5gtk2dialoghelpers.cpp b/src/qt5gtk2-qtplugin/qt5gtk2dialoghelpers.cpp index 76cb732..2b009c5 100644 --- a/src/qt5gtk2-qtplugin/qt5gtk2dialoghelpers.cpp +++ b/src/qt5gtk2-qtplugin/qt5gtk2dialoghelpers.cpp @@ -1,6 +1,6 @@ /*************************************************************************** * Copyright (C) 2015 The Qt Company Ltd. * - * Copyright (C) 2016-2022 Ilya Kotov, forkotov02@ya.ru * + * Copyright (C) 2016-2023 Ilya Kotov, forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * diff --git a/src/qt5gtk2-qtplugin/qt5gtk2dialoghelpers.h b/src/qt5gtk2-qtplugin/qt5gtk2dialoghelpers.h index 58c0351..657b9af 100644 --- a/src/qt5gtk2-qtplugin/qt5gtk2dialoghelpers.h +++ b/src/qt5gtk2-qtplugin/qt5gtk2dialoghelpers.h @@ -1,6 +1,6 @@ /*************************************************************************** * Copyright (C) 2015 The Qt Company Ltd. * - * Copyright (C) 2016-2022 Ilya Kotov, forkotov02@ya.ru * + * Copyright (C) 2016-2023 Ilya Kotov, forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * diff --git a/src/qt5gtk2-qtplugin/qt5gtk2theme.cpp b/src/qt5gtk2-qtplugin/qt5gtk2theme.cpp index a99d108..acca6be 100644 --- a/src/qt5gtk2-qtplugin/qt5gtk2theme.cpp +++ b/src/qt5gtk2-qtplugin/qt5gtk2theme.cpp @@ -1,6 +1,6 @@ /*************************************************************************** * Copyright (C) 2015 The Qt Company Ltd. * - * Copyright (C) 2016-2022 Ilya Kotov, forkotov02@ya.ru * + * Copyright (C) 2016-2023 Ilya Kotov, forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * diff --git a/src/qt5gtk2-qtplugin/qt5gtk2theme.h b/src/qt5gtk2-qtplugin/qt5gtk2theme.h index 09370bb..9b968e7 100644 --- a/src/qt5gtk2-qtplugin/qt5gtk2theme.h +++ b/src/qt5gtk2-qtplugin/qt5gtk2theme.h @@ -1,6 +1,6 @@ /*************************************************************************** * Copyright (C) 2015 The Qt Company Ltd. * - * Copyright (C) 2016-2022 Ilya Kotov, forkotov02@ya.ru * + * Copyright (C) 2016-2023 Ilya Kotov, forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * diff --git a/src/qt5gtk2-style/plugin.cpp b/src/qt5gtk2-style/plugin.cpp index 4ab0bb5..70d4739 100644 --- a/src/qt5gtk2-style/plugin.cpp +++ b/src/qt5gtk2-style/plugin.cpp @@ -1,6 +1,6 @@ /*************************************************************************** * Copyright (C) 2015 The Qt Company Ltd. * - * Copyright (C) 2016-2022 Ilya Kotov, forkotov02@ya.ru * + * Copyright (C) 2016-2023 Ilya Kotov, forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * diff --git a/src/qt5gtk2-style/qgtk2painter.cpp b/src/qt5gtk2-style/qgtk2painter.cpp index fc7ebca..6f44c34 100644 --- a/src/qt5gtk2-style/qgtk2painter.cpp +++ b/src/qt5gtk2-style/qgtk2painter.cpp @@ -1,6 +1,6 @@ /*************************************************************************** * Copyright (C) 2015 The Qt Company Ltd. * - * Copyright (C) 2016-2022 Ilya Kotov, forkotov02@ya.ru * + * Copyright (C) 2016-2023 Ilya Kotov, forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -56,11 +56,10 @@ QPixmap QGtk2Painter::renderTheme(uchar *bdata, uchar *wdata, const QRect &rect) if (m_hflipped || m_vflipped) { return QPixmap::fromImage(converted.mirrored(m_hflipped, m_vflipped)); - } else { - // on raster graphicssystem we need to do a copy here, because - // we intend to deallocate the qimage bits shortly after... - return QPixmap::fromImage(converted.copy()); } + // on raster graphicssystem we need to do a copy here, because + // we intend to deallocate the qimage bits shortly after... + return QPixmap::fromImage(converted.copy()); } // This macro is responsible for painting any GtkStyle painting function onto a QPixmap diff --git a/src/qt5gtk2-style/qgtk2painter_p.h b/src/qt5gtk2-style/qgtk2painter_p.h index 05f6490..9c53796 100644 --- a/src/qt5gtk2-style/qgtk2painter_p.h +++ b/src/qt5gtk2-style/qgtk2painter_p.h @@ -1,6 +1,6 @@ /*************************************************************************** * Copyright (C) 2015 The Qt Company Ltd. * - * Copyright (C) 2016-2022 Ilya Kotov, forkotov02@ya.ru * + * Copyright (C) 2016-2023 Ilya Kotov, forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * diff --git a/src/qt5gtk2-style/qgtkglobal_p.h b/src/qt5gtk2-style/qgtkglobal_p.h index ff3d612..2c19da0 100644 --- a/src/qt5gtk2-style/qgtkglobal_p.h +++ b/src/qt5gtk2-style/qgtkglobal_p.h @@ -1,6 +1,6 @@ /*************************************************************************** * Copyright (C) 2015 The Qt Company Ltd. * - * Copyright (C) 2016-2022 Ilya Kotov, forkotov02@ya.ru * + * Copyright (C) 2016-2023 Ilya Kotov, forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * diff --git a/src/qt5gtk2-style/qgtkpainter.cpp b/src/qt5gtk2-style/qgtkpainter.cpp index ca19f7c..99ae828 100644 --- a/src/qt5gtk2-style/qgtkpainter.cpp +++ b/src/qt5gtk2-style/qgtkpainter.cpp @@ -1,6 +1,6 @@ /*************************************************************************** * Copyright (C) 2015 The Qt Company Ltd. * - * Copyright (C) 2016-2022 Ilya Kotov, forkotov02@ya.ru * + * Copyright (C) 2016-2023 Ilya Kotov, forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * diff --git a/src/qt5gtk2-style/qgtkpainter_p.h b/src/qt5gtk2-style/qgtkpainter_p.h index bcaae0b..22ea6cf 100644 --- a/src/qt5gtk2-style/qgtkpainter_p.h +++ b/src/qt5gtk2-style/qgtkpainter_p.h @@ -1,6 +1,6 @@ /*************************************************************************** * Copyright (C) 2015 The Qt Company Ltd. * - * Copyright (C) 2016-2022 Ilya Kotov, forkotov02@ya.ru * + * Copyright (C) 2016-2023 Ilya Kotov, forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * diff --git a/src/qt5gtk2-style/qgtkstyle.cpp b/src/qt5gtk2-style/qgtkstyle.cpp index 024fe5f..4d1935f 100644 --- a/src/qt5gtk2-style/qgtkstyle.cpp +++ b/src/qt5gtk2-style/qgtkstyle.cpp @@ -1,6 +1,6 @@ /*************************************************************************** * Copyright (C) 2015 The Qt Company Ltd. * - * Copyright (C) 2016-2022 Ilya Kotov, forkotov02@ya.ru * + * Copyright (C) 2016-2023 Ilya Kotov, forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -381,13 +381,11 @@ QPalette QGtkStyle::standardPalette() const palette.setColor(QPalette::Window, bg); palette.setColor(QPalette::Button, bg); - palette.setColor(QPalette::Background, bg); QColor disabled((fg.red() + bg.red()) / 2, (fg.green() + bg.green())/ 2, (fg.blue() + bg.blue()) / 2); palette.setColor(QPalette::Disabled, QPalette::Text, disabled); palette.setColor(QPalette::Disabled, QPalette::WindowText, disabled); - palette.setColor(QPalette::Disabled, QPalette::Foreground, disabled); palette.setColor(QPalette::Disabled, QPalette::ButtonText, disabled); palette.setColor(QPalette::Highlight, highlight); // calculate disabled colors by removing saturation @@ -1031,12 +1029,12 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element, QCommonStyle::drawPrimitive(element, option, painter, widget); if (!(option->state & State_Selected)) { break; - } else { - if (const QAbstractItemView *view = qobject_cast(widget)) { - if (!qobject_cast(view->itemDelegate())) - break; - } - } // fall through + } + if (const QAbstractItemView *view = qobject_cast(widget)) { + if (!qobject_cast(view->itemDelegate())) + break; + } + // fall through case PE_PanelItemViewItem: if (const QStyleOptionViewItem *vopt = qstyleoption_cast(option)) { @@ -1702,7 +1700,6 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom bool sunken = (titleBar->activeSubControls & SC_TitleBarContextHelpButton) && (titleBar->state & State_Sunken); qt_gtk_draw_mdibutton(painter, titleBar, contextHelpButtonRect, hover, sunken); - QColor blend; QImage image(qt_titlebar_context_help); QColor alpha = textColor; alpha.setAlpha(128); @@ -3598,7 +3595,7 @@ QRect QGtkStyle::subControlRect(ComplexControl control, const QStyleOptionComple if (subControl == SC_GroupBoxFrame) return rect; - else if (subControl == SC_GroupBoxContents) { + if (subControl == SC_GroupBoxContents) { int margin = 0; int leftMarginExtension = 8; return frameRect.adjusted(leftMarginExtension + margin, margin + topHeight + groupBoxTitleMargin, -margin, -margin); diff --git a/src/qt5gtk2-style/qgtkstyle_p.cpp b/src/qt5gtk2-style/qgtkstyle_p.cpp index 4ac2a2b..1bdf58c 100644 --- a/src/qt5gtk2-style/qgtkstyle_p.cpp +++ b/src/qt5gtk2-style/qgtkstyle_p.cpp @@ -1,6 +1,6 @@ /*************************************************************************** * Copyright (C) 2015 The Qt Company Ltd. * - * Copyright (C) 2016-2022 Ilya Kotov, forkotov02@ya.ru * + * Copyright (C) 2016-2023 Ilya Kotov, forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -386,7 +386,7 @@ bool QGtkStylePrivate::isKDE4Session() { static int version = -1; if (version == -1) - version = qgetenv("KDE_SESSION_VERSION").toInt(); + version = qEnvironmentVariableIntValue("KDE_SESSION_VERSION"); return (version == 4); } diff --git a/src/qt5gtk2-style/qgtkstyle_p.h b/src/qt5gtk2-style/qgtkstyle_p.h index 456f372..d206843 100644 --- a/src/qt5gtk2-style/qgtkstyle_p.h +++ b/src/qt5gtk2-style/qgtkstyle_p.h @@ -1,6 +1,6 @@ /*************************************************************************** * Copyright (C) 2015 The Qt Company Ltd. * - * Copyright (C) 2016-2022 Ilya Kotov, forkotov02@ya.ru * + * Copyright (C) 2016-2023 Ilya Kotov, forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * diff --git a/src/qt5gtk2-style/qgtkstyle_p_p.h b/src/qt5gtk2-style/qgtkstyle_p_p.h index d03d977..46e38be 100644 --- a/src/qt5gtk2-style/qgtkstyle_p_p.h +++ b/src/qt5gtk2-style/qgtkstyle_p_p.h @@ -1,6 +1,6 @@ /*************************************************************************** * Copyright (C) 2015 The Qt Company Ltd. * - * Copyright (C) 2016-2022 Ilya Kotov, forkotov02@ya.ru * + * Copyright (C) 2016-2023 Ilya Kotov, forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * diff --git a/src/qt5gtk2-style/qstylehelper.cpp b/src/qt5gtk2-style/qstylehelper.cpp index 00249ec..091d944 100644 --- a/src/qt5gtk2-style/qstylehelper.cpp +++ b/src/qt5gtk2-style/qstylehelper.cpp @@ -1,6 +1,6 @@ /*************************************************************************** * Copyright (C) 2015 The Qt Company Ltd. * - * Copyright (C) 2016-2022 Ilya Kotov, forkotov02@ya.ru * + * Copyright (C) 2016-2023 Ilya Kotov, forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -224,7 +224,6 @@ void drawDial(const QStyleOptionSlider *option, QPainter *painter) buttonColor.setHsv(buttonColor .hue(), qMin(140, buttonColor .saturation()), qMax(180, buttonColor.value())); - QColor shadowColor(0, 0, 0, 20); if (enabled) { // Drop shadow diff --git a/src/qt5gtk2-style/qstylehelper_p.h b/src/qt5gtk2-style/qstylehelper_p.h index d5453cb..c070f71 100644 --- a/src/qt5gtk2-style/qstylehelper_p.h +++ b/src/qt5gtk2-style/qstylehelper_p.h @@ -1,6 +1,6 @@ /*************************************************************************** * Copyright (C) 2015 The Qt Company Ltd. * - * Copyright (C) 2016-2022 Ilya Kotov, forkotov02@ya.ru * + * Copyright (C) 2016-2023 Ilya Kotov, forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * -- cgit v1.2.3