mirror of
https://github.com/KDE/latte-dock.git
synced 2025-02-05 17:47:23 +03:00
add menu/about in Latte Settings window
This commit is contained in:
parent
fb3764e432
commit
1ab273753e
@ -72,6 +72,7 @@ public:
|
||||
virtual bool isOnCurrentActivity(WindowId wid) const = 0;
|
||||
virtual const std::list<WindowId> &windows() const = 0;
|
||||
|
||||
virtual void setKeepAbove(const QDialog &dialog, bool above = true) const = 0;
|
||||
virtual void skipTaskBar(const QDialog &dialog) const = 0;
|
||||
virtual void slideWindow(QWindow &view, Slide location) const = 0;
|
||||
virtual void enableBlurBehind(QWindow &view) const = 0;
|
||||
|
@ -662,6 +662,7 @@ void DockCorona::aboutApplication()
|
||||
aboutDialog = new KAboutApplicationDialog(KAboutData::applicationData());
|
||||
connect(aboutDialog.data(), &QDialog::finished, aboutDialog.data(), &QObject::deleteLater);
|
||||
WindowSystem::self().skipTaskBar(*aboutDialog);
|
||||
WindowSystem::self().setKeepAbove(*aboutDialog, true);
|
||||
|
||||
aboutDialog->show();
|
||||
}
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include <QDir>
|
||||
#include <QFileDialog>
|
||||
#include <QHeaderView>
|
||||
#include <QMenuBar>
|
||||
#include <QMessageBox>
|
||||
#include <QProcess>
|
||||
#include <QStandardItem>
|
||||
@ -118,6 +119,20 @@ LatteConfigDialog::LatteConfigDialog(QWidget *parent, LayoutManager *manager)
|
||||
ui->buttonBox->button(QDialogButtonBox::Apply)->setEnabled(true);
|
||||
});
|
||||
|
||||
//! About Menu
|
||||
QMenuBar *menuBar = new QMenuBar(this);
|
||||
QMenuBar *rightAlignedMenuBar = new QMenuBar(menuBar);
|
||||
|
||||
layout()->setMenuBar(menuBar);
|
||||
menuBar->setCornerWidget(rightAlignedMenuBar);
|
||||
|
||||
QMenu *helpMenu = new QMenu(i18n("Help"), rightAlignedMenuBar);
|
||||
rightAlignedMenuBar->addMenu(helpMenu);
|
||||
|
||||
QAction *aboutAction = helpMenu->addAction(i18n("About Latte"));
|
||||
aboutAction->setIcon(QIcon::fromTheme("latte-dock"));
|
||||
|
||||
connect(aboutAction, &QAction::triggered, m_manager, &LayoutManager::showAboutDialog);
|
||||
}
|
||||
|
||||
LatteConfigDialog::~LatteConfigDialog()
|
||||
|
@ -588,6 +588,11 @@ void LayoutManager::loadLatteLayout(QString layoutPath)
|
||||
}
|
||||
}
|
||||
|
||||
void LayoutManager::showAboutDialog()
|
||||
{
|
||||
m_corona->aboutApplication();
|
||||
}
|
||||
|
||||
void LayoutManager::importLatteLayout(QString layoutPath)
|
||||
{
|
||||
//! This might not be needed as it is Layout responsibility
|
||||
|
@ -105,6 +105,7 @@ public:
|
||||
void importPresets(bool includeDefault = false);
|
||||
|
||||
public slots:
|
||||
void showAboutDialog();
|
||||
Q_INVOKABLE void showLatteConfigDialog();
|
||||
|
||||
//! switch to specified layout, default previousMemoryUsage means that it didnt change
|
||||
|
@ -202,6 +202,15 @@ const std::list<WindowId> &WaylandInterface::windows() const
|
||||
return m_windows;
|
||||
}
|
||||
|
||||
void WaylandInterface::setKeepAbove(const QDialog &dialog, bool above) const
|
||||
{
|
||||
if (above) {
|
||||
KWindowSystem::setState(dialog.winId(), NET::KeepAbove);
|
||||
} else {
|
||||
KWindowSystem::clearState(dialog.winId(), NET::KeepAbove);
|
||||
}
|
||||
}
|
||||
|
||||
void WaylandInterface::skipTaskBar(const QDialog &dialog) const
|
||||
{
|
||||
KWindowSystem::setState(dialog.winId(), NET::SkipTaskbar);
|
||||
|
@ -67,6 +67,7 @@ public:
|
||||
bool isOnCurrentActivity(WindowId wid) const override;
|
||||
const std::list<WindowId> &windows() const override;
|
||||
|
||||
void setKeepAbove(const QDialog &dialog, bool above = true) const override;
|
||||
void skipTaskBar(const QDialog &dialog) const override;
|
||||
void slideWindow(QWindow &view, Slide location) const override;
|
||||
void enableBlurBehind(QWindow &view) const override;
|
||||
|
@ -162,6 +162,15 @@ const std::list<WindowId> &XWindowInterface::windows() const
|
||||
return m_windows;
|
||||
}
|
||||
|
||||
void XWindowInterface::setKeepAbove(const QDialog &dialog, bool above) const
|
||||
{
|
||||
if (above) {
|
||||
KWindowSystem::setState(dialog.winId(), NET::KeepAbove);
|
||||
} else {
|
||||
KWindowSystem::clearState(dialog.winId(), NET::KeepAbove);
|
||||
}
|
||||
}
|
||||
|
||||
void XWindowInterface::skipTaskBar(const QDialog &dialog) const
|
||||
{
|
||||
KWindowSystem::setState(dialog.winId(), NET::SkipTaskbar);
|
||||
|
@ -52,6 +52,7 @@ public:
|
||||
bool isOnCurrentActivity(WindowId wid) const override;
|
||||
const std::list<WindowId> &windows() const override;
|
||||
|
||||
void setKeepAbove(const QDialog &dialog, bool above = true) const override;
|
||||
void skipTaskBar(const QDialog &dialog) const override;
|
||||
void slideWindow(QWindow &view, Slide location) const override;
|
||||
void enableBlurBehind(QWindow &view) const override;
|
||||
|
Loading…
x
Reference in New Issue
Block a user