diff --git a/src/mainwidget.cpp b/src/mainwidget.cpp index a4f338c..f7941e9 100644 --- a/src/mainwidget.cpp +++ b/src/mainwidget.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #define App (static_cast(QCoreApplication::instance())) MainWidget::MainWidget(QWidget *parent) : @@ -155,15 +156,17 @@ void MainWidget::setupUi(QWidget *Widget) QSpacerItem *horizontalSpacer = new QSpacerItem(159, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); m_buttonHorizontalLayout->addItem(horizontalSpacer); - m_copyBtn = new DIconButton(Widget); - m_copyBtn->setObjectName(QStringLiteral("Copy")); + m_copyBtn = new DToolButton(Widget); + m_copyBtn->setObjectName(QStringLiteral("Copy text")); m_copyBtn->setMaximumSize(QSize(40, 40)); + m_copyBtn->setToolTip(tr("Copy text")); m_buttonHorizontalLayout->addWidget(m_copyBtn); - m_exportBtn = new DIconButton(Widget); - m_exportBtn->setObjectName(QStringLiteral("Export")); + m_exportBtn = new DToolButton(Widget); + m_exportBtn->setObjectName(QStringLiteral("Save as TXT")); m_exportBtn->setMaximumSize(QSize(40, 40)); + m_exportBtn->setToolTip(tr("Save as TXT")); m_buttonHorizontalLayout->addWidget(m_exportBtn); @@ -382,12 +385,10 @@ void MainWidget::setIcons(DGuiApplicationHelper::ColorType themeType) if (m_copyBtn) { m_copyBtn->setIcon(QIcon(":/assets/copy_dark.svg")); m_copyBtn->setIconSize(QSize(36, 36)); - m_copyBtn->setFlat(true); } if (m_exportBtn) { m_exportBtn->setIcon(QIcon(":/assets/download_dark.svg")); m_exportBtn->setIconSize(QSize(36, 36)); - m_exportBtn->setFlat(true); } App->setWindowIcon(QIcon(":/assets/appicon_dark.svg")); @@ -407,12 +408,10 @@ void MainWidget::setIcons(DGuiApplicationHelper::ColorType themeType) if (m_copyBtn) { m_copyBtn->setIcon(QIcon(":/assets/copy_light.svg")); m_copyBtn->setIconSize(QSize(36, 36)); - m_copyBtn->setFlat(true); } if (m_exportBtn) { m_exportBtn->setIcon(QIcon(":/assets/download_light.svg")); m_exportBtn->setIconSize(QSize(36, 36)); - m_exportBtn->setFlat(true); } App->setWindowIcon(QIcon(":/assets/appicon_light.svg")); diff --git a/src/mainwidget.h b/src/mainwidget.h index 6c2fd4e..442b646 100644 --- a/src/mainwidget.h +++ b/src/mainwidget.h @@ -9,6 +9,7 @@ #include #include +#include #include "resulttextview.h" #include "textloadwidget.h" @@ -19,6 +20,7 @@ class QGridLayout; class QHBoxLayout; class ImageView; + DWIDGET_USE_NAMESPACE class MainWidget : public DWidget @@ -61,8 +63,8 @@ private: QHBoxLayout *m_buttonHorizontalLayout{nullptr}; QHBoxLayout *m_tipHorizontalLayout{nullptr}; DLabel *m_tiplabel{nullptr}; - DIconButton *m_copyBtn{nullptr}; - DIconButton *m_exportBtn{nullptr}; + DToolButton *m_copyBtn{nullptr}; + DToolButton *m_exportBtn{nullptr}; ImageView *m_imageview{nullptr}; DLabel *m_tipIconLabel{nullptr};