diff --git a/lib/thumbnailview/contextbarbutton.h b/lib/thumbnailview/contextbarbutton.h --- a/lib/thumbnailview/contextbarbutton.h +++ b/lib/thumbnailview/contextbarbutton.h @@ -18,6 +18,17 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. */ + +/* + ***************************************************** + ****************************************************** + **** NOTE: This class is deprecated. Do not use it. ** + **** It will be removed in the QT 6 timeframe. ** + ****************************************************** + ****************************************************** +*/ + + #ifndef CONTEXTBARBUTTON_H #define CONTEXTBARBUTTON_H diff --git a/lib/thumbnailview/contextbarbutton.cpp b/lib/thumbnailview/contextbarbutton.cpp --- a/lib/thumbnailview/contextbarbutton.cpp +++ b/lib/thumbnailview/contextbarbutton.cpp @@ -18,6 +18,17 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. */ + +/* + ***************************************************** + ****************************************************** + **** NOTE: This class is deprecated. Do not use it. ** + **** It will be removed in the QT 6 timeframe. ** + ****************************************************** + ****************************************************** +*/ + + // Self #include "contextbarbutton.h" diff --git a/lib/thumbnailview/previewitemdelegate.cpp b/lib/thumbnailview/previewitemdelegate.cpp --- a/lib/thumbnailview/previewitemdelegate.cpp +++ b/lib/thumbnailview/previewitemdelegate.cpp @@ -37,6 +37,7 @@ #include #include #include +#include // KDE #include @@ -48,7 +49,6 @@ // Local #include "archiveutils.h" -#include "contextbarbutton.h" #include "itemeditor.h" #include "paintutils.h" #include "thumbnailview.h" @@ -610,16 +610,20 @@ d->mContextBar = new QWidget(d->mView->viewport()); d->mContextBar->hide(); - d->mToggleSelectionButton = new ContextBarButton("list-add"); + d->mToggleSelectionButton = new QToolButton; + d->mToggleSelectionButton->setIcon(SmallIcon("list-add")); connect(d->mToggleSelectionButton, &QToolButton::clicked, this, &PreviewItemDelegate::slotToggleSelectionClicked); - d->mFullScreenButton = new ContextBarButton("view-fullscreen"); + d->mFullScreenButton = new QToolButton; + d->mFullScreenButton->setIcon(SmallIcon("view-fullscreen")); connect(d->mFullScreenButton, &QToolButton::clicked, this, &PreviewItemDelegate::slotFullScreenClicked); - d->mRotateLeftButton = new ContextBarButton("object-rotate-left"); + d->mRotateLeftButton = new QToolButton; + d->mRotateLeftButton->setIcon(SmallIcon("object-rotate-left")); connect(d->mRotateLeftButton, &QToolButton::clicked, this, &PreviewItemDelegate::slotRotateLeftClicked); - d->mRotateRightButton = new ContextBarButton("object-rotate-right"); + d->mRotateRightButton = new QToolButton; + d->mRotateRightButton->setIcon(SmallIcon("object-rotate-right")); connect(d->mRotateRightButton, &QToolButton::clicked, this, &PreviewItemDelegate::slotRotateRightClicked); QHBoxLayout* layout = new QHBoxLayout(d->mContextBar); @@ -631,7 +635,8 @@ layout->addWidget(d->mRotateRightButton); // Save button - d->mSaveButton = new ContextBarButton("document-save", d->mView->viewport()); + d->mSaveButton = new QToolButton(d->mView->viewport()); + d->mSaveButton->setIcon(SmallIcon("document-save")); d->mSaveButton->hide(); connect(d->mSaveButton, &QToolButton::clicked, this, &PreviewItemDelegate::slotSaveClicked); } diff --git a/lib/thumbnailview/thumbnailbarview.cpp b/lib/thumbnailview/thumbnailbarview.cpp --- a/lib/thumbnailview/thumbnailbarview.cpp +++ b/lib/thumbnailview/thumbnailbarview.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -43,7 +44,6 @@ #include "lib/hud/hudtheme.h" #include "lib/paintutils.h" #include "lib/thumbnailview/abstractthumbnailviewhelper.h" -#include "lib/thumbnailview/contextbarbutton.h" namespace Gwenview { @@ -73,16 +73,17 @@ ThumbnailBarItemDelegate* q; ThumbnailView* mView; - ContextBarButton* mToggleSelectionButton; + QToolButton* mToggleSelectionButton; QColor mBorderColor; QPersistentModelIndex mIndexUnderCursor; void setupToggleSelectionButton() { - mToggleSelectionButton = new ContextBarButton("list-add", mView->viewport()); + mToggleSelectionButton = new QToolButton(mView->viewport()); + mToggleSelectionButton->setIcon(SmallIcon("list-add")); mToggleSelectionButton->hide(); - QObject::connect(mToggleSelectionButton, &ContextBarButton::clicked, q, &ThumbnailBarItemDelegate::toggleSelection); + QObject::connect(mToggleSelectionButton, &QToolButton::clicked, q, &ThumbnailBarItemDelegate::toggleSelection); } void showToolTip(QHelpEvent* helpEvent)