Skip to content

Commit

Permalink
fix(dss): input is not hidden after closing the window
Browse files Browse the repository at this point in the history
  • Loading branch information
zsien committed Jul 3, 2024
1 parent b4e951b commit cdf7b90
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
15 changes: 14 additions & 1 deletion dss-network-plugin/network_module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include "networkdialog.h"
#include "secretagent.h"
#include "notificationmanager.h"
#include "dockpopupwindow.h"
#include "networkdialog/thememanager.h"

#include <QWidget>
Expand All @@ -32,6 +31,8 @@
#define NETWORK_KEY "network-item-key"

using namespace NetworkManager;

DWIDGET_USE_NAMESPACE
NETWORKPLUGIN_USE_NAMESPACE

namespace dss {
Expand Down Expand Up @@ -520,6 +521,18 @@ void NetworkPanelContainer::onPluginStateChanged(PluginState state)
}
}

void NetworkPanelContainer::showEvent(QShowEvent *event) {
if (m_contentWidget == m_dialog->panel()) {
m_contentWidget->setVisible(true);
}
}

void NetworkPanelContainer::hideEvent(QHideEvent *event) {
if (m_contentWidget == m_dialog->panel()) {
m_contentWidget->setVisible(false);
}
}

void NetworkPanelContainer::setContentWidget(QWidget *content)
{
if (m_contentWidget) {
Expand Down
4 changes: 4 additions & 0 deletions dss-network-plugin/network_module.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ class NetworkPanelContainer : public QWidget
public Q_SLOTS:
void onPluginStateChanged(PluginState state);

protected:
void showEvent(QShowEvent *event) override;
void hideEvent(QHideEvent *event) override;

private:
QLabel *m_warnLabel;
NETWORKPLUGIN_NAMESPACE::NetworkDialog *m_dialog;
Expand Down

0 comments on commit cdf7b90

Please sign in to comment.