1
0
mirror of https://github.com/KDE/latte-dock.git synced 2024-12-26 11:21:40 +03:00

add KDE official Help menu

--in that way Latte gains easily language
switching from user
--exposure of how/where to report bugs
This commit is contained in:
Michail Vourlakos 2020-01-01 12:23:30 +02:00
parent 07a1065320
commit fdf798b49f
2 changed files with 13 additions and 7 deletions

View File

@ -156,12 +156,17 @@ SettingsDialog::SettingsDialog(QWidget *parent, Latte::Corona *corona)
menuBar->addMenu(fileMenu); menuBar->addMenu(fileMenu);
QMenu *layoutMenu = new QMenu(i18n("Layout"), menuBar); QMenu *layoutMenu = new QMenu(i18n("Layout"), menuBar);
//rightAlignedMenuBar->addMenu(helpMenu);
menuBar->addMenu(layoutMenu); menuBar->addMenu(layoutMenu);
QMenu *helpMenu = new QMenu(i18n("Help"), menuBar); //! Help menu
m_helpMenu = new KHelpMenu(menuBar);
menuBar->addMenu(m_helpMenu->menu());
//rightAlignedMenuBar->addMenu(helpMenu); //rightAlignedMenuBar->addMenu(helpMenu);
menuBar->addMenu(helpMenu);
//! hide help menu actions that are not used
m_helpMenu->action(KHelpMenu::menuHelpContents)->setVisible(false);
m_helpMenu->action(KHelpMenu::menuWhatsThis)->setVisible(false);
QAction *screensAction = fileMenu->addAction(i18n("Sc&reens...")); QAction *screensAction = fileMenu->addAction(i18n("Sc&reens..."));
screensAction->setIcon(QIcon::fromTheme("document-properties")); screensAction->setIcon(QIcon::fromTheme("document-properties"));
@ -180,9 +185,6 @@ SettingsDialog::SettingsDialog(QWidget *parent, Latte::Corona *corona)
infoLayoutAction->setIcon(QIcon::fromTheme("document-properties")); infoLayoutAction->setIcon(QIcon::fromTheme("document-properties"));
infoLayoutAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_I)); infoLayoutAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_I));
QAction *aboutAction = helpMenu->addAction(i18n("About Latte"));
aboutAction->setIcon(QIcon::fromTheme("latte-dock"));
//! RTL support for labels in preferences //! RTL support for labels in preferences
if (qApp->layoutDirection() == Qt::RightToLeft) { if (qApp->layoutDirection() == Qt::RightToLeft) {
ui->behaviorLbl->setAlignment(Qt::AlignRight | Qt::AlignTop); ui->behaviorLbl->setAlignment(Qt::AlignRight | Qt::AlignTop);
@ -239,7 +241,6 @@ SettingsDialog::SettingsDialog(QWidget *parent, Latte::Corona *corona)
updateApplyButtonsState(); updateApplyButtonsState();
}); });
connect(aboutAction, &QAction::triggered, m_corona, &Latte::Corona::aboutApplication);
connect(quitAction, &QAction::triggered, this, [&]() { connect(quitAction, &QAction::triggered, this, [&]() {
close(); close();
m_corona->closeApplication(); m_corona->closeApplication();

View File

@ -33,6 +33,9 @@
#include <QStandardItemModel> #include <QStandardItemModel>
#include <QTimer> #include <QTimer>
// KDE
#include <KHelpMenu>
namespace Ui { namespace Ui {
class SettingsDialog; class SettingsDialog;
} }
@ -145,6 +148,8 @@ private:
QTimer m_activityClosedTimer; QTimer m_activityClosedTimer;
bool m_blockDeleteOnReject{false}; bool m_blockDeleteOnReject{false};
KHelpMenu *m_helpMenu{nullptr};
Latte::Corona *m_corona{nullptr}; Latte::Corona *m_corona{nullptr};
QAction *m_editLayoutAction{nullptr}; QAction *m_editLayoutAction{nullptr};