File indexing completed on 2024-04-28 04:48:37
0001 /* 0002 SPDX-FileCopyrightText: 2008 David Edmundson <kde@davidedmundson.co.uk> 0003 SPDX-FileCopyrightText: 2022 Harald Sitter <sitter@kde.org> 0004 0005 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0006 */ 0007 0008 #include "loadView.h" 0009 #include "codeine.h" 0010 0011 #include <QAction> 0012 #include <QIcon> 0013 #include <QToolButton> 0014 0015 namespace Dragon 0016 { 0017 0018 LoadView::LoadView(QWidget *parent) 0019 : QWidget(parent) 0020 , Ui_LoadView() 0021 { 0022 setupUi(this); 0023 0024 const auto largeSize = 128; 0025 m_icon->setPixmap(QIcon::fromTheme(QStringLiteral("dragonplayer")).pixmap(largeSize)); 0026 } 0027 0028 void LoadView::setToolbarActions(const QList<QAction *> &actions) 0029 { 0030 for (const auto &action : actions) { 0031 if (!action->isVisible()) { 0032 continue; 0033 } 0034 auto button = new QToolButton(this); 0035 button->setDefaultAction(action); 0036 button->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); 0037 horizontalLayout->insertWidget(horizontalLayout->count() - 1, button); 0038 } 0039 } 0040 0041 } // namespace Dragon 0042 0043 #include "moc_loadView.cpp"