Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions libimageviewer/viewpanel/viewpanel.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2020 - 2024 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2020-2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later

Expand Down Expand Up @@ -448,6 +448,8 @@ void LibViewPanel::initExtensionPanel()
if (!m_extensionPanel) {
m_extensionPanel = new ExtensionPanel(this);
connect(m_info, &LibImageInfoWidget::extensionPanelHeight, m_extensionPanel, &ExtensionPanel::updateRectWithContent);
connect(m_extensionPanel, &ExtensionPanel::previousRequested, this, &LibViewPanel::showPrevious);
connect(m_extensionPanel, &ExtensionPanel::nextRequested, this, &LibViewPanel::showNext);
connect(m_view, &LibImageGraphicsView::clicked, this, [ = ] {
this->m_extensionPanel->hide();
this->m_info->show();
Expand Down Expand Up @@ -1906,8 +1908,6 @@ void LibViewPanel::onMenuItemClicked(QAction *action)
m_info->setImagePath(path); //执行强制重刷
m_info->show();
m_extensionPanel->setContent(m_info);
//清除焦点
m_extensionPanel->setFocus(Qt::NoFocusReason);
m_extensionPanel->show();
if (this->window()->isFullScreen() || this->window()->isMaximized()) {
m_extensionPanel->move(this->window()->width() - m_extensionPanel->width() - 24,
Expand Down
11 changes: 10 additions & 1 deletion libimageviewer/widgets/extensionpanel.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2020-2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later

Expand Down Expand Up @@ -192,6 +192,15 @@ void ExtensionPanel::init()
// emit hideExtensionPanel();
this->hide();
});

QShortcut *previousShortcut = new QShortcut(QKeySequence(Qt::Key_Left), this);
previousShortcut->setContext(Qt::WindowShortcut);
connect(previousShortcut, &QShortcut::activated, this, &ExtensionPanel::previousRequested);

QShortcut *nextShortcut = new QShortcut(QKeySequence(Qt::Key_Right), this);
nextShortcut->setContext(Qt::WindowShortcut);
connect(nextShortcut, &QShortcut::activated, this, &ExtensionPanel::nextRequested);

// Esc
m_scEsc = new QShortcut(QKeySequence(Qt::Key_Escape), this);
m_scEsc->setContext(Qt::WindowShortcut);
Expand Down
4 changes: 3 additions & 1 deletion libimageviewer/widgets/extensionpanel.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2020-2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later

Expand Down Expand Up @@ -30,7 +30,9 @@
void init();
signals:
void requestStopAnimation();
void previousRequested();
void nextRequested();
public slots:

Check warning on line 35 in libimageviewer/widgets/extensionpanel.h

View workflow job for this annotation

GitHub Actions / cppcheck

There is an unknown macro here somewhere. Configuration is required. If slots is a macro then please configure it.
void updateRectWithContent(int height);
private:
QColor m_coverBrush;
Expand Down
Loading