Ejemplo n.º 1
0
bool LoginScreen::event(QEvent* event)
{
    if (event->type() == QEvent::WindowActivate || event->type() == QEvent::WindowStateChange)
       emit windowStateChanged(windowState());

    return QWidget::event(event);
}
Ejemplo n.º 2
0
bool ActivateDialog::event(QEvent* event)
{
    if (event->type() == QEvent::WindowActivate || event->type() == QEvent::WindowStateChange)
        emit windowStateChanged(windowState());

    return QDialog::event(event);
}
Ejemplo n.º 3
0
PandemicWindow::PandemicWindow(PandemicModuleBase *module, QWidget *widget) :
    QMdiSubWindow(), _module(module), _package(module->generateWindowPackage())
{
    setObjectName("PandemicWindow");
    setWindowFlags(windowFlags() | Qt::FramelessWindowHint);

    _cursor = cursor();
    _resizePoint = NoEdge;
    _resizing = false;
    _titleBar = new SubWindowTitleBar(this);

    _centralWidget = new QWidget();
    _centralLayout = new QGridLayout();
    _centralWidget->setLayout(_centralLayout);

    _centralLayout->setSpacing(0);
    _centralLayout->setContentsMargins(0, 1, 0, 0);
    _centralWidget->setObjectName("PandemicWindowContent");

    _centralLayout->addWidget(_titleBar, 0, 0, 1, 1);
    _centralLayout->addWidget(widget, 1, 0, 1, 1);

    layout()->setContentsMargins(8, 0, 8, 8);
    setWidget(_centralWidget);

    setMinimumSize(QSize(widget->sizeHint().width(), widget->sizeHint().height()));
    resize(minimumSize());

    connect(this, SIGNAL(windowStateChanged(Qt::WindowStates,Qt::WindowStates)),
            this, SLOT(stateChanged(Qt::WindowStates,Qt::WindowStates)));

}
Ejemplo n.º 4
0
SimulationWindow::SimulationWindow(QWidget *parent, Qt::WindowFlags flags)
    : QMdiSubWindow(parent, flags)
{
    setWidget(&m_widget);

    connect(this, SIGNAL(windowStateChanged(Qt::WindowStates, Qt::WindowStates)),
                  SLOT(onWindowStateChanged(Qt::WindowStates, Qt::WindowStates)));
}
Ejemplo n.º 5
0
void KviMdiManager::manageChild(KviMdiChild * lpC)
{
	connect(lpC, SIGNAL(windowStateChanged(Qt::WindowStates,Qt::WindowStates)),
		this, SLOT(processWindowStateChanged(Qt::WindowStates,Qt::WindowStates)));

	addSubWindow((QMdiSubWindow*)lpC);

	if(!m_bInSDIMode && KVI_OPTION_BOOL(KviOption_boolAutoTileWindows))
		tile();
}
Ejemplo n.º 6
0
void PsMainWindow::psInitFrameless() {
    psUpdatedPositionTimer.setSingleShot(true);
	connect(&psUpdatedPositionTimer, SIGNAL(timeout()), this, SLOT(psSavePosition()));

	if (frameless) {
		//setWindowFlags(Qt::FramelessWindowHint);
	}

    connect(windowHandle(), SIGNAL(windowStateChanged(Qt::WindowState)), this, SLOT(psStateChanged(Qt::WindowState)));
}
Ejemplo n.º 7
0
TitleWidget::TitleWidget(MainWindow *window) : TWidget(window)
, wnd(window)
, hideLevel(0)
, hider(0)
, _back(this, st::titleBackButton, lang(lng_menu_back))
, _cancel(this, lang(lng_cancel), st::titleTextButton)
, _settings(this, lang(lng_menu_settings), st::titleTextButton)
, _contacts(this, lang(lng_menu_contacts), st::titleTextButton)
, _about(this, lang(lng_menu_about), st::titleTextButton)
, _lock(this, window)
, _update(this, window, lang(lng_menu_update))
, _minimize(this, window)
, _maximize(this, window)
, _restore(this, window)
, _close(this, window)
, _a_update(animation(this, &TitleWidget::step_update))
, lastMaximized(!(window->windowState() & Qt::WindowMaximized))
{
	setGeometry(0, 0, wnd->width(), st::titleHeight);
	setAttribute(Qt::WA_OpaquePaintEvent);
	_lock.hide();
	_update.hide();
    _cancel.hide();
    _back.hide();
	if (
#ifndef TDESKTOP_DISABLE_AUTOUPDATE
		Sandbox::updatingState() == Application::UpdatingReady ||
#endif
		cHasPasscode()
	) {
		showUpdateBtn();
	}
	stateChanged();

	connect(&_back, SIGNAL(clicked()), window, SLOT(hideSettings()));
	connect(&_cancel, SIGNAL(clicked()), this, SIGNAL(hiderClicked()));
	connect(&_settings, SIGNAL(clicked()), window, SLOT(showSettings()));
	connect(&_contacts, SIGNAL(clicked()), this, SLOT(onContacts()));
	connect(&_about, SIGNAL(clicked()), this, SLOT(onAbout()));
	connect(wnd->windowHandle(), SIGNAL(windowStateChanged(Qt::WindowState)), this, SLOT(stateChanged(Qt::WindowState)));

#ifndef TDESKTOP_DISABLE_AUTOUPDATE
	Sandbox::connect(SIGNAL(updateReady()), this, SLOT(showUpdateBtn()));
#endif

    if (cPlatform() != dbipWindows) {
        _minimize.hide();
        _maximize.hide();
        _restore.hide();
        _close.hide();
    }
}
int QMdiSubWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: windowStateChanged((*reinterpret_cast< Qt::WindowStates(*)>(_a[1])),(*reinterpret_cast< Qt::WindowStates(*)>(_a[2]))); break;
        case 1: aboutToActivate(); break;
        case 2: showSystemMenu(); break;
        case 3: showShaded(); break;
        case 4: d_func()->_q_updateStaysOnTopHint(); break;
        case 5: d_func()->_q_enterInteractiveMode(); break;
        case 6: d_func()->_q_processFocusChanged((*reinterpret_cast< QWidget*(*)>(_a[1])),(*reinterpret_cast< QWidget*(*)>(_a[2]))); break;
        }
        _id -= 7;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< int*>(_v) = keyboardSingleStep(); break;
        case 1: *reinterpret_cast< int*>(_v) = keyboardPageStep(); break;
        }
        _id -= 2;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setKeyboardSingleStep(*reinterpret_cast< int*>(_v)); break;
        case 1: setKeyboardPageStep(*reinterpret_cast< int*>(_v)); break;
        }
        _id -= 2;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 2;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 2;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 2;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 2;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 2;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 2;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
Ejemplo n.º 9
0
void Window::init() {
	psInitFrameless();
	setWindowIcon(wndIcon);

	App::app()->installEventFilter(this);
	connect(windowHandle(), SIGNAL(windowStateChanged(Qt::WindowState)), this, SLOT(stateChanged(Qt::WindowState)));
	connect(windowHandle(), SIGNAL(activeChanged()), this, SLOT(checkHistoryActivation()));

	QPalette p(palette());
	p.setColor(QPalette::Window, st::wndBG->c);
	setPalette(p);

	title = new TitleWidget(this);

    psInitSize();
}
Ejemplo n.º 10
0
bool LoginScreen::event(QEvent* event)
{
    switch (event->type())
    {
#ifdef Q_OS_MAC
    case QEvent::WindowActivate:
    case QEvent::WindowStateChange:
        emit windowStateChanged(windowState());
        break;
#endif
    default:
        break;
    }


    return QWidget::event(event);
}
Ejemplo n.º 11
0
TitleWidget::TitleWidget(QWidget *parent) : TWidget(parent)
, _cancel(this, lang(lng_cancel), st::titleTextButton)
, _settings(this, lang(lng_menu_settings), st::titleTextButton)
, _contacts(this, lang(lng_menu_contacts), st::titleTextButton)
, _about(this, lang(lng_menu_about), st::titleTextButton)
, _lock(this)
, _update(this)
, _minimize(this)
, _maximize(this)
, _restore(this)
, _close(this)
, _a_update(animation(this, &TitleWidget::step_update))
, lastMaximized(!(parent->windowState() & Qt::WindowMaximized)) {
	setGeometry(0, 0, parent->width(), st::titleHeight);
	setAttribute(Qt::WA_OpaquePaintEvent);

	onWindowStateChanged();
	updateControlsVisibility();

	connect(&_cancel, SIGNAL(clicked()), this, SIGNAL(hiderClicked()));
	connect(&_settings, SIGNAL(clicked()), parent, SLOT(showSettings()));
	connect(&_contacts, SIGNAL(clicked()), this, SLOT(onContacts()));
	connect(&_about, SIGNAL(clicked()), this, SLOT(onAbout()));
	connect(parent->windowHandle(), SIGNAL(windowStateChanged(Qt::WindowState)), this, SLOT(onWindowStateChanged(Qt::WindowState)));

#ifndef TDESKTOP_DISABLE_AUTOUPDATE
	Sandbox::connect(SIGNAL(updateReady()), this, SLOT(updateControlsVisibility()));
#endif // !TDESKTOP_DISABLE_AUTOUPDATE

	subscribe(Adaptive::Changed(), [this]() { updateAdaptiveLayout(); });
	if (Media::Player::exists()) {
		subscribe(Media::Player::instance()->usePanelPlayer(), [this](bool usePanel) {
			updatePlayerButton(usePanel);
		});
	}

    if (cPlatform() != dbipWindows) {
        _minimize.hide();
        _maximize.hide();
        _restore.hide();
        _close.hide();
    }
}
Ejemplo n.º 12
0
TitleWidget::TitleWidget(Window *window)
	: QWidget(window)
	, wnd(window)
    , hideLevel(0)
    , hider(0)
	, _back(this, st::titleBackButton, lang(lng_menu_back))
	, _cancel(this, lang(lng_cancel), st::titleTextButton)
	, _settings(this, lang(lng_menu_settings), st::titleTextButton)
	, _contacts(this, lang(lng_menu_contacts), st::titleTextButton)
	, _about(this, lang(lng_menu_about), st::titleTextButton)
	, _update(this, window, lang(lng_menu_update))
	, _minimize(this, window)
	, _maximize(this, window)
	, _restore(this, window)
	, _close(this, window)
    , lastMaximized(!(window->windowState() & Qt::WindowMaximized))
{
	setGeometry(0, 0, wnd->width(), st::titleHeight);
	_update.hide();
    _cancel.hide();
    _back.hide();
	if (App::app()->updatingState() == Application::UpdatingReady) {
		showUpdateBtn();
	}
	stateChanged();

	connect(&_back, SIGNAL(clicked()), window, SLOT(hideSettings()));
	connect(&_cancel, SIGNAL(clicked()), this, SIGNAL(hiderClicked()));
	connect(&_settings, SIGNAL(clicked()), window, SLOT(showSettings()));
	connect(&_contacts, SIGNAL(clicked()), this, SLOT(onContacts()));
	connect(&_about, SIGNAL(clicked()), this, SLOT(onAbout()));
	connect(wnd->windowHandle(), SIGNAL(windowStateChanged(Qt::WindowState)), this, SLOT(stateChanged(Qt::WindowState)));
	connect(App::app(), SIGNAL(updateReady()), this, SLOT(showUpdateBtn()));

    if (cPlatform() != dbipWindows) {
        _minimize.hide();
        _maximize.hide();
        _restore.hide();
        _close.hide();
    }
}
Ejemplo n.º 13
0
WindowsModel::WindowsModel (QObject *parent)
    : QAbstractItemModel (parent)
    , CurrentDesktop_ (Util::XWrapper::Instance ().GetCurrentDesktop ())
    , ImageProvider_ (new TaskbarImageProvider (QIcon::fromTheme ("xorg")))
{
    auto& w = Util::XWrapper::Instance ();
    auto windows = w.GetWindows ();
    for (auto wid : windows)
        AddWindow (wid, w);

    connect (&w,
             SIGNAL (windowListChanged ()),
             this,
             SLOT (updateWinList ()));
    connect (&w,
             SIGNAL (activeWindowChanged ()),
             this,
             SLOT (updateActiveWindow ()));

    connect (&w,
             SIGNAL (windowNameChanged (ulong)),
             this,
             SLOT (updateWindowName (ulong)));
    connect (&w,
             SIGNAL (windowIconChanged (ulong)),
             this,
             SLOT (updateWindowIcon (ulong)));
    connect (&w,
             SIGNAL (windowStateChanged (ulong)),
             this,
             SLOT (updateWindowState (ulong)));
    connect (&w,
             SIGNAL (windowActionsChanged (ulong)),
             this,
             SLOT (updateWindowActions (ulong)));
    connect (&w,
             SIGNAL (windowDesktopChanged (ulong)),
             this,
             SLOT (updateWindowDesktop (ulong)));
    connect (&w,
             SIGNAL (desktopChanged ()),
             this,
             SLOT (updateCurrentDesktop ()));

    QHash<int, QByteArray> roleNames;
    roleNames [Role::WindowName] = "windowName";
    roleNames [Role::WindowID] = "windowID";
    roleNames [Role::IconGenID] = "iconGenID";
    roleNames [Role::IsCurrentDesktop] = "isCurrentDesktop";
    roleNames [Role::IsActiveWindow] = "isActiveWindow";
    roleNames [Role::IsMinimizedWindow] = "isMinimizedWindow";
    setRoleNames (roleNames);

    int eventBase, errorBase;
    if (XCompositeQueryExtension (w.GetDisplay (), &eventBase, &errorBase))
    {
        int major = 0, minor = 2;
        XCompositeQueryVersion (w.GetDisplay (), &major, &minor);

        if (major > 0 || minor >= 2)
            qDebug () << "all good, has NamePixmap";
    }
}