302
303
void KviMainWindow::installAccelerators()
304
new QShortcut(QKeySequence(KVI_SHORTCUTS_WIN_PREV),this,SLOT(switchToPrevWindow()),0,Qt::ApplicationShortcut);
305
new QShortcut(QKeySequence(KVI_SHORTCUTS_WIN_NEXT),this,SLOT(switchToNextWindow()),0,Qt::ApplicationShortcut);
306
new QShortcut(QKeySequence(KVI_SHORTCUTS_WIN_PREV_CONTEXT),this,SLOT(switchToPrevWindowInContext()),0,Qt::ApplicationShortcut);
307
new QShortcut(QKeySequence(KVI_SHORTCUTS_WIN_NEXT_CONTEXT),this,SLOT(switchToNextWindowInContext()),0,Qt::ApplicationShortcut);
308
new QShortcut(QKeySequence(KVI_SHORTCUTS_WIN_PREV_HIGHLIGHT),this,SLOT(switchToPrevHighlightedWindow()),0,Qt::ApplicationShortcut);
309
new QShortcut(QKeySequence(KVI_SHORTCUTS_WIN_NEXT_HIGHLIGHT),this,SLOT(switchToNextHighlightedWindow()),0,Qt::ApplicationShortcut);
310
new QShortcut(QKeySequence(KVI_SHORTCUTS_WIN_MAXIMIZE),this,SLOT(maximizeWindow()),0,Qt::ApplicationShortcut);
311
new QShortcut(QKeySequence(KVI_SHORTCUTS_WIN_MINIMIZE),this,SLOT(minimizeWindow()),0,Qt::ApplicationShortcut);
305
m_pAccellerators = new KviPointerList<QShortcut>;
306
m_pAccellerators->append(KviShortcut::create(KVI_SHORTCUTS_WIN_PREV,this,SLOT(switchToPrevWindow()),0,Qt::ApplicationShortcut));
307
m_pAccellerators->append(KviShortcut::create(KVI_SHORTCUTS_WIN_NEXT,this,SLOT(switchToNextWindow()),0,Qt::ApplicationShortcut));
308
m_pAccellerators->append(KviShortcut::create(KVI_SHORTCUTS_WIN_PREV_CONTEXT,this,SLOT(switchToPrevWindowInContext()),0,Qt::ApplicationShortcut));
309
m_pAccellerators->append(KviShortcut::create(KVI_SHORTCUTS_WIN_NEXT_CONTEXT,this,SLOT(switchToNextWindowInContext()),0,Qt::ApplicationShortcut));
310
m_pAccellerators->append(KviShortcut::create(KVI_SHORTCUTS_WIN_PREV_HIGHLIGHT,this,SLOT(switchToPrevHighlightedWindow()),0,Qt::ApplicationShortcut));
311
m_pAccellerators->append(KviShortcut::create(KVI_SHORTCUTS_WIN_NEXT_HIGHLIGHT,this,SLOT(switchToNextHighlightedWindow()),0,Qt::ApplicationShortcut));
312
m_pAccellerators->append(KviShortcut::create(KVI_SHORTCUTS_WIN_MAXIMIZE,this,SLOT(maximizeWindow()),0,Qt::ApplicationShortcut));
313
m_pAccellerators->append(KviShortcut::create(KVI_SHORTCUTS_WIN_MINIMIZE,this,SLOT(minimizeWindow()),0,Qt::ApplicationShortcut));
313
315
static int accel_table[] = {
314
316
Qt::Key_1 + Qt::ControlModifier, // script accels...
339
341
while((keys = accel_table[i]))
341
new QShortcut(QKeySequence(keys),this,SLOT(accelActivated()),SLOT(accelActivated()),Qt::ApplicationShortcut);
343
m_pAccellerators->append(KviShortcut::create(keys,this,SLOT(accelActivated()),SLOT(accelActivated()),Qt::ApplicationShortcut));
348
void KviMainWindow::freeAccelleratorKeySequence(QString & key)
350
QKeySequence kS(key);
351
for(QShortcut * pS = m_pAccellerators->first();pS;pS = m_pAccellerators->next())
355
m_pAccellerators->removeRef(pS);
346
361
void KviMainWindow::accelActivated()
348
363
KVS_TRIGGER_EVENT_1(KviEvent_OnAccelKeyPressed,g_pActiveWindow,(QString)(((QShortcut *)sender())->key()));
897
917
#ifdef COMPILE_PSEUDO_TRANSPARENCY
898
918
uint uOpacity = KVI_OPTION_UINT(KviOption_uintGlobalWindowOpacityPercent) < 50 ? 50 : KVI_OPTION_UINT(KviOption_uintGlobalWindowOpacityPercent);
899
919
setWindowOpacity((float) uOpacity / 100);
920
#if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW)
921
#ifndef Q_WS_EX_LAYERED
922
#define Q_WS_EX_LAYERED WS_EX_LAYERED
926
SetWindowLong(effectiveWinId(), GWL_EXSTYLE,
927
GetWindowLong(effectiveWinId(), GWL_EXSTYLE) | Q_WS_EX_LAYERED);
929
SetWindowLong(effectiveWinId(), GWL_EXSTYLE,
930
GetWindowLong(effectiveWinId(), GWL_EXSTYLE) & ~Q_WS_EX_LAYERED);
900
933
if(g_pShadedParentGlobalDesktopBackground)m_pMdi->viewport()->update();
902
935
if(g_pShadedChildGlobalDesktopBackground)