mirror of
https://github.com/tnodir/fort
synced 2024-11-15 08:46:03 +00:00
UI: WindowManager: Move showWidget() to WidgetWindow
This commit is contained in:
parent
e62ffcd199
commit
11dbd70e62
@ -10,6 +10,7 @@
|
||||
#include <form/controls/controlutil.h>
|
||||
#include <manager/windowmanager.h>
|
||||
#include <util/guiutil.h>
|
||||
#include <util/window/widgetwindow.h>
|
||||
|
||||
PasswordDialog::PasswordDialog(QWidget *parent) : QDialog(parent)
|
||||
{
|
||||
@ -111,7 +112,7 @@ bool PasswordDialog::getPassword(QString &password, UnlockType &unlockType, QWid
|
||||
{
|
||||
PasswordDialog dialog(parent);
|
||||
|
||||
WindowManager::showWidget(&dialog);
|
||||
WidgetWindow::showWidget(&dialog);
|
||||
|
||||
if (dialog.exec() == 0)
|
||||
return false;
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include <manager/windowmanager.h>
|
||||
#include <util/iconcache.h>
|
||||
#include <util/ioc/ioccontainer.h>
|
||||
#include <util/window/widgetwindow.h>
|
||||
|
||||
#include "programscontroller.h"
|
||||
|
||||
@ -98,7 +99,7 @@ void ProgramEditDialog::initialize(const AppRow &appRow, const QVector<qint64> &
|
||||
|
||||
void ProgramEditDialog::activate()
|
||||
{
|
||||
WindowManager::showWidget(this);
|
||||
WidgetWindow::showWidget(this);
|
||||
|
||||
m_editPath->selectAll();
|
||||
m_editPath->setFocus();
|
||||
|
@ -85,16 +85,6 @@ void WindowManager::tearDown()
|
||||
closeAll();
|
||||
}
|
||||
|
||||
void WindowManager::showWidget(QWidget *w)
|
||||
{
|
||||
if (w->isMinimized()) {
|
||||
w->setWindowState(w->windowState() ^ Qt::WindowMinimized);
|
||||
}
|
||||
w->show();
|
||||
w->raise();
|
||||
w->activateWindow();
|
||||
}
|
||||
|
||||
QFont WindowManager::defaultFont()
|
||||
{
|
||||
static QFont g_font(
|
||||
@ -285,7 +275,7 @@ void WindowManager::showHomeWindow()
|
||||
|
||||
setupHomeWindow();
|
||||
|
||||
showWidget(m_homeWindow);
|
||||
m_homeWindow->showWindow();
|
||||
}
|
||||
|
||||
void WindowManager::closeHomeWindow()
|
||||
@ -309,7 +299,7 @@ void WindowManager::showProgramsWindow()
|
||||
setupProgramsWindow();
|
||||
}
|
||||
|
||||
showWidget(m_progWindow);
|
||||
m_progWindow->showWindow();
|
||||
}
|
||||
|
||||
void WindowManager::closeProgramsWindow()
|
||||
@ -348,7 +338,7 @@ void WindowManager::showOptionsWindow()
|
||||
emit optWindowChanged(true);
|
||||
}
|
||||
|
||||
showWidget(m_optWindow);
|
||||
m_optWindow->showWindow();
|
||||
}
|
||||
|
||||
void WindowManager::closeOptionsWindow()
|
||||
@ -387,7 +377,7 @@ void WindowManager::showPoliciesWindow()
|
||||
setupPoliciesWindow();
|
||||
}
|
||||
|
||||
showWidget(m_policiesWindow);
|
||||
m_policiesWindow->showWindow();
|
||||
}
|
||||
|
||||
void WindowManager::closePoliciesWindow()
|
||||
@ -411,7 +401,7 @@ void WindowManager::showStatisticsWindow()
|
||||
setupStatisticsWindow();
|
||||
}
|
||||
|
||||
showWidget(m_statWindow);
|
||||
m_statWindow->showWindow();
|
||||
}
|
||||
|
||||
void WindowManager::closeStatisticsWindow()
|
||||
@ -435,7 +425,7 @@ void WindowManager::showServicesWindow()
|
||||
setupServicesWindow();
|
||||
}
|
||||
|
||||
showWidget(m_serviceWindow);
|
||||
m_serviceWindow->showWindow();
|
||||
}
|
||||
|
||||
void WindowManager::closeServicesWindow()
|
||||
@ -459,7 +449,7 @@ void WindowManager::showZonesWindow()
|
||||
setupZonesWindow();
|
||||
}
|
||||
|
||||
showWidget(m_zoneWindow);
|
||||
m_zoneWindow->showWindow();
|
||||
}
|
||||
|
||||
void WindowManager::closeZonesWindow()
|
||||
|
@ -40,8 +40,6 @@ public:
|
||||
void setUp() override;
|
||||
void tearDown() override;
|
||||
|
||||
static void showWidget(QWidget *w);
|
||||
|
||||
static QFont defaultFont();
|
||||
|
||||
signals:
|
||||
|
@ -4,6 +4,16 @@
|
||||
|
||||
WidgetWindow::WidgetWindow(QWidget *parent) : QWidget(parent) { }
|
||||
|
||||
void WidgetWindow::showWidget(QWidget *w)
|
||||
{
|
||||
if (w->isMinimized()) {
|
||||
w->setWindowState(w->windowState() ^ Qt::WindowMinimized);
|
||||
}
|
||||
w->show();
|
||||
w->raise();
|
||||
w->activateWindow();
|
||||
}
|
||||
|
||||
void WidgetWindow::moveEvent(QMoveEvent *event)
|
||||
{
|
||||
QWidget::moveEvent(event);
|
||||
|
@ -10,6 +10,10 @@ class WidgetWindow : public QWidget
|
||||
public:
|
||||
explicit WidgetWindow(QWidget *parent = nullptr);
|
||||
|
||||
void showWindow() { showWidget(this); }
|
||||
|
||||
static void showWidget(QWidget *w);
|
||||
|
||||
signals:
|
||||
void activationChanged(bool isActive);
|
||||
void activated();
|
||||
|
Loading…
Reference in New Issue
Block a user