#include <iostream>
+#include <QtGui/QDesktopWidget>
+#include <QtGui/QX11Info>
+
#include <kapplication.h>
-#include <dcopclient.h>
-#include <kwin.h>
-#include <Xlib.h>
-#include <Xutil.h>
+#include <kwindowsystem.h>
#include <netwm_def.h>
#include "kwingrid.h"
#include "kwingrid.moc"
-KWinGrid::KWinGrid(int hgap__, int vgap__, int hsplit__, int vsplit__, int split__)
- : DCOPObject("grid"), split_(split__),
- hgap_(hgap__), vgap_(vgap__), hsplit_(hsplit__), vsplit_(vsplit__)
+KWinGrid::KWinGrid(int hgap__, int vgap__, int hsplit__, int vsplit__, int split__,
+ int ignorestruts__)
+ : split_(split__), ignorestruts_(ignorestruts__), hgap_(hgap__), vgap_(vgap__), hsplit_(hsplit__),
+ vsplit_(vsplit__)
+
{
- module_ = new KWinModule(KApplication::kApplication());
- connect(module_,SIGNAL(activeWindowChanged(WId)),this,SLOT(activeWindowChanged(WId)));
+ connect(KWindowSystem::self(),SIGNAL(activeWindowChanged(WId)),
+ this,SLOT(activeWindowChanged(WId)));
}
void KWinGrid::move(int __xslot, int __yslot)
void KWinGrid::toDesk(int __desk)
{
int w = activeWindow();
- if (w)
- KWin::setOnDesktop(w,__desk);
+ if (w)
+ KWindowSystem::setOnDesktop(w,__desk);
}
void KWinGrid::quit()
int KWinGrid::activeWindow()
{
- int av = module_->activeWindow();
- KWin::WindowInfo info = KWin::windowInfo(av,NET::WMWindowType);
+ int av = KWindowSystem::activeWindow();
+ KWindowInfo info = KWindowSystem::windowInfo(av,NET::WMWindowType);
if (info.windowType(NET::AllTypesMask) == NET::Desktop) return 0;
return av;
}
int deltaDays = timestamp_.date().daysTo(tm.date());
int deltaMSecs = timestamp_.time().msecsTo(tm.time());
-
+
if (deltaDays>2 || deltaDays<0) {
activeWindow_ = 0;
return;
}
-
+
deltaMSecs += deltaDays * 1000*(60*60*24);
if (deltaMSecs <= 300 && deltaMSecs > 0)
- KWin::forceActiveWindow(activeWindow_);
+ KWindowSystem::forceActiveWindow(activeWindow_);
else
activeWindow_ = 0;
}
xSlot += __xdiff;
ySlot += __ydiff;
if (xSlot<0) {
- if (numScreens_ > 1 and screen_ > 0) {
- initGeometry(screen_-1);
- xSlot = hsplit_-1;
- ySlot = (outer_.top()-region_.top()+vsize_/2)/vsize_ + __ydiff;
- } else
+ QPoint p (outer_.topLeft());
+ if (numScreens_ > 1 && p.x() > hsize_) {
+ p.rx() -= hsize_;
+ initGeometry( QApplication::desktop()->screenNumber(p) );
+ } else
xSlot = 0;
} else if (xSlot >= hsplit_) {
- if (numScreens_ > 1 and screen_ < numScreens_-1) {
- initGeometry(screen_+1);
+ QPoint p (outer_.topLeft());
+ QRect wa = KWindowSystem::workArea();
+ if (numScreens_ > 1 && p.x() + 2* hsize_ < wa.right()) {
+ p.rx() += 2*hsize_;
+ initGeometry( QApplication::desktop()->screenNumber(p) );
xSlot = 0;
ySlot = (outer_.top()-region_.top()+vsize_/2)/vsize_ + __ydiff;
} else
int __xsize, int __ysize)
{
QRect newGeometry(outer_);
-
+
if (__xsize == -1) {
__xsize = (outer_.width()+hsize_/2)/hsize_;
if (__xsize<1) __xsize = 1;
if (__ysize<1) __ysize = 1;
if (__ysize>vsplit_) __ysize = vsplit_;
}
-
+
newGeometry.setWidth(__xsize*hsize_-hgap_);
newGeometry.setHeight(__ysize*vsize_-vgap_);
if (activeWindow_ == 0)
activeWindow_ = activeWindow();
if (activeWindow_) {
- KWin::WindowInfo info(KWin::windowInfo(activeWindow_));
+ KWindowInfo info(KWindowSystem::windowInfo(activeWindow_,NET::WMGeometry|NET::WMFrameExtents));
inner_ = info.geometry();
outer_ = info.frameGeometry();
orig_ = outer_;
region_ = QApplication::desktop()->screenGeometry(screen_);
numScreens_ = QApplication::desktop()->numScreens();
}
- QRect wa = module_->workArea();
- region_ = region_ & wa;
+ if (screen_ != ignorestruts_) {
+ QRect wa = KWindowSystem::workArea();
+ region_ = region_ & wa;
+ }
hsize_ = (region_.width()-hgap_)/hsplit_;
vsize_ = (region_.height()-vgap_)/vsplit_;
topLeft+=QPoint(hdelta/2,vdelta/2);
region_.moveTopLeft(topLeft);
region_.setSize(QSize(hsize_*hsplit_,vsize_*vsplit_));
+
+ long supplied;
+ if (XGetWMNormalHints(QX11Info::display(), activeWindow_, &hints_, &supplied))
+ hints_.flags &= supplied;
+ else
+ hints_.flags = 0;
}
}
inner_ = newInner;
outer_ = __new;
- XSizeHints hints;
- long supplied;
- if (XGetWMNormalHints(KApplication::kApplication()->getDisplay(),
- activeWindow_, &hints, &supplied)) {
- hints.flags &= supplied;
- if (hints.flags & PResizeInc && hints.width_inc != 0 && hints.height_inc != 0) {
- QSize base(0,0);
- if (hints.flags & PBaseSize) {
- base.setWidth(hints.base_width);
- base.setHeight(hints.base_height);
- } else if (hints.flags & PMinSize) {
- base.setWidth(hints.min_width);
- base.setHeight(hints.min_height);
- }
- QSize newSize(((inner_.width()-base.width())/hints.width_inc)*hints.width_inc + base.width(),
- ((inner_.height()-base.height())/hints.height_inc)*hints.height_inc + base.height());
- QSize delta(inner_.size() - newSize);
- QPoint offset(delta.width()/2,delta.height()/2);
- inner_.setSize(newSize);
- outer_.setSize(outer_.size() - delta);
- inner_.moveTopLeft(inner_.topLeft() + offset);
- outer_.moveTopLeft(outer_.topLeft() + offset);
+ if (hints_.flags & PResizeInc && hints_.width_inc != 0 && hints_.height_inc != 0) {
+ QSize base(0,0);
+ if (hints_.flags & PBaseSize) {
+ base.setWidth(hints_.base_width);
+ base.setHeight(hints_.base_height);
+ } else if (hints_.flags & PMinSize) {
+ base.setWidth(hints_.min_width);
+ base.setHeight(hints_.min_height);
}
+ QSize newSize(((inner_.width()-base.width())/hints_.width_inc)*hints_.width_inc
+ + base.width(),
+ ((inner_.height()-base.height())/hints_.height_inc)*hints_.height_inc
+ + base.height());
+ QSize delta(inner_.size() - newSize);
+ QPoint offset(delta.width()/2,delta.height()/2);
+ inner_.setSize(newSize);
+ outer_.setSize(outer_.size() - delta);
+ inner_.moveTopLeft(inner_.topLeft() + offset);
+ outer_.moveTopLeft(outer_.topLeft() + offset);
}
}
// XMoveResizeWindow sometimes still moves the window a little
// bit. Seems to have something todo with window gravity
// ... we just leave the position allone in that case.
- XResizeWindow(KApplication::kApplication()->getDisplay(),activeWindow_,
- inner_.width(),inner_.height());
+ XResizeWindow(QX11Info::display(),activeWindow_, inner_.width(),inner_.height());
else {
// I don't really know, whats all this stuff concerning window
// gravity. I only know, this works for my openoffice windows,
// NorthWestGravity on my desktop so did not check other
// window gravities.
QPoint pos = outer_.topLeft();
- XWindowAttributes winAttributes;
- if (XGetWindowAttributes(KApplication::kApplication()->getDisplay(),activeWindow_,
- &winAttributes) && winAttributes.win_gravity == StaticGravity)
+ if (hints_.flags & PWinGravity && hints_.win_gravity == StaticGravity)
pos = inner_.topLeft();
- XMoveResizeWindow(KApplication::kApplication()->getDisplay(),activeWindow_,
+ XMoveResizeWindow(QX11Info::display(),activeWindow_,
pos.x(),pos.y(), inner_.width(),inner_.height());
}
}
move(hsplit_/2,vsplit_/2);
}
-
void KWinGrid::resize_Q()
{
resize(vsplit_/2,hsplit_/2);
resize(vsplit_,hsplit_);
}
-
void KWinGrid::move_L()
{
moveRelative(-1,0);
moveRelative(0,1);
}
-
void KWinGrid::resize_IH()
{
resizeRelative(1,0);
-#include <stdlib.h>
+#include <iostream>
#include <kuniqueapplication.h>
#include <klocale.h>
#include <kcmdlineargs.h>
#include <kaboutdata.h>
#include <kdebug.h>
#include <kglobalaccel.h>
-#include <qnamespace.h>
+#include <kactioncollection.h>
#include "kwingrid.h"
-static KCmdLineOptions winGridOpts[] =
-{
- { "split <width>", I18N_NOOP("split"), 0 },
- { "+hgap", I18N_NOOP("hgap"), 0 },
- { "+vgap", I18N_NOOP("vgap"), 0 },
- { "+hsplit", I18N_NOOP("hsplit"), 0 },
- { "+vsplit", I18N_NOOP("vsplit"), 0 },
- { 0,0,0 }
-};
-
/* Die optimalen werte für hgap und vgap berechnen sich zu:
*
* gap = size%split + n*split
int main(int argc, char **argv)
{
- KAboutData * aboutdata = new KAboutData("kwingrid","KWinGrid","0.5",
- I18N_NOOP("Window Grid"),
+ KAboutData * aboutdata = new KAboutData("kwingrid",
+ "KWinGrid",
+ ki18n("Window Grid"),
+ "0.1",
+ KLocalizedString(),
KAboutData::License_GPL,
- "(C) 1999,2000,2002,2004 Stefan Bund",
- "", "http://www.j32.de/");
- aboutdata->addAuthor("Stefan Bund",I18N_NOOP("Developer"),"stefab@j32.de",
+ ki18n("(C) 1999,2000,2002,2004 Stefan Bund"));
+ aboutdata->addAuthor(ki18n("Stefan Bund"),ki18n("Developer"),"stefab@j32.de",
"http://www.j32.de");
+ KCmdLineOptions winGridOpts;
+ winGridOpts.add("split <width>", ki18n("split"), 0);
+ winGridOpts.add("ignorestruts <screen>", ki18n("ignorestruts"), "");
+ winGridOpts.add("+hgap", ki18n("hgap"), 0);
+ winGridOpts.add("+vgap", ki18n("vgap"), 0);
+ winGridOpts.add("+hsplit", ki18n("hsplit"), 0);
+ winGridOpts.add("+vsplit", ki18n("vsplit"), 0);
+
KCmdLineArgs::init(argc, argv, aboutdata);
KCmdLineArgs::addCmdLineOptions(winGridOpts);
KUniqueApplication::addCmdLineOptions();
}
int split = 0;
+ int ignorestruts = -1;
if (args->isSet("split"))
- split=args->getOption("split").toInt();
+ split = args->getOption("split").toInt();
+
+ if (args->isSet("ignorestruts"))
+ ignorestruts = args->getOption("ignorestruts").toInt();
- int hgap = atoi(args->arg(0));
- int vgap = atoi(args->arg(1));
- int hsplit = atoi(args->arg(2));
- int vsplit = atoi(args->arg(3));
+ if (args->count() != 4) {
+ std::cerr << "invalid number of arguments" << std::endl;
+ return 1;
+ }
+ int hgap = args->arg(0).toInt();
+ int vgap = args->arg(1).toInt();
+ int hsplit = args->arg(2).toInt();
+ int vsplit = args->arg(3).toInt();
args->clear();
- KWinGrid * winGrid = new KWinGrid(hgap,vgap,hsplit,vsplit,split);
-
- KGlobalAccel * accel = new KGlobalAccel(app);
-
- accel->insert("move_TL",
- I18N_NOOP("Move top-left"),
- I18N_NOOP("Move active window top-left"),
- Qt::ALT+Qt::SHIFT+Qt::Key_I, KKey::QtWIN+Qt::SHIFT+Qt::Key_I,
- winGrid, SLOT ( move_TL() ));
- accel->insert("move_TR",
- I18N_NOOP("Move top-right"),
- I18N_NOOP("Move active window top-right"),
- Qt::ALT+Qt::SHIFT+Qt::Key_O, KKey::QtWIN+Qt::SHIFT+Qt::Key_O,
- winGrid, SLOT ( move_TR() ));
- accel->insert("move_BL",
- I18N_NOOP("Move bottom-left"),
- I18N_NOOP("Move active window bottom-left"),
- Qt::ALT+Qt::SHIFT+Qt::Key_K, KKey::QtWIN+Qt::SHIFT+Qt::Key_K,
- winGrid, SLOT ( move_BL() ));
- accel->insert("move_BR",
- I18N_NOOP("Move bottom-right"),
- I18N_NOOP("Move active window bottom-right"),
- Qt::ALT+Qt::SHIFT+Qt::Key_L, KKey::QtWIN+Qt::SHIFT+Qt::Key_L,
- winGrid, SLOT ( move_BR() ));
-
- accel->insert("resize_Q",
- I18N_NOOP("Resize quarter"), I18N_NOOP("Resize quarter"),
- Qt::ALT+Qt::CTRL+Qt::SHIFT+Qt::Key_I, KKey::QtWIN+Qt::CTRL+Qt::SHIFT+Qt::Key_I,
- winGrid, SLOT ( resize_Q() ));
- accel->insert("resize_H",
- I18N_NOOP("Resize horizontal"), I18N_NOOP("Resize horizontal"),
- Qt::ALT+Qt::CTRL+Qt::SHIFT+Qt::Key_O, KKey::QtWIN+Qt::CTRL+Qt::SHIFT+Qt::Key_O,
- winGrid, SLOT ( resize_H() ));
- accel->insert("resize_V",
- I18N_NOOP("Resize vertical"), I18N_NOOP("Resize vertical"),
- Qt::ALT+Qt::CTRL+Qt::SHIFT+Qt::Key_K, KKey::QtWIN+Qt::CTRL+Qt::SHIFT+Qt::Key_K,
- winGrid, SLOT ( resize_V() ));
- accel->insert("resize_F",
- I18N_NOOP("Resize full"), I18N_NOOP("Resize full"),
- Qt::ALT+Qt::CTRL+Qt::SHIFT+Qt::Key_L, KKey::QtWIN+Qt::CTRL+Qt::SHIFT+Qt::Key_L,
- winGrid, SLOT ( resize_F() ));
-
- accel->insert("move_L",
- I18N_NOOP("Move left"), I18N_NOOP("Move left"),
- Qt::ALT+Qt::SHIFT+Qt::Key_Left, KKey::QtWIN+Qt::SHIFT+Qt::Key_Left,
- winGrid, SLOT ( move_L() ));
- accel->insert("move_R",
- I18N_NOOP("Move right"), I18N_NOOP("Move right"),
- Qt::ALT+Qt::SHIFT+Qt::Key_Right, KKey::QtWIN+Qt::SHIFT+Qt::Key_Right,
- winGrid, SLOT ( move_R() ));
- accel->insert("move_U",
- I18N_NOOP("Move up"), I18N_NOOP("Move up"),
- Qt::ALT+Qt::SHIFT+Qt::Key_Up, KKey::QtWIN+Qt::SHIFT+Qt::Key_Up,
- winGrid, SLOT ( move_U() ));
- accel->insert("move_D",
- I18N_NOOP("Move down"), I18N_NOOP("Move down"),
- Qt::ALT+Qt::SHIFT+Qt::Key_Down, KKey::QtWIN+Qt::SHIFT+Qt::Key_Down,
- winGrid, SLOT ( move_D() ));
-
- accel->insert("resize_IH",
- I18N_NOOP("Increase horizontal size"), I18N_NOOP("Increase horizontal size"),
- Qt::ALT+Qt::CTRL+Qt::SHIFT+Qt::Key_Right,KKey::QtWIN+Qt::CTRL+Qt::SHIFT+Qt::Key_Right,
- winGrid, SLOT ( resize_IH() ));
- accel->insert("resize_IV",
- I18N_NOOP("Increase vertical size"), I18N_NOOP("Increase vertical size"),
- Qt::ALT+Qt::CTRL+Qt::SHIFT+Qt::Key_Down,KKey::QtWIN+Qt::CTRL+Qt::SHIFT+Qt::Key_Down,
- winGrid, SLOT ( resize_IV() ));
- accel->insert("resize_DH",
- I18N_NOOP("Decrease horizontal size"), I18N_NOOP("Decrease horizontal size"),
- Qt::ALT+Qt::CTRL+Qt::SHIFT+Qt::Key_Left,KKey::QtWIN+Qt::CTRL+Qt::SHIFT+Qt::Key_Left,
- winGrid, SLOT ( resize_DH() ));
- accel->insert("resize_DV",
- I18N_NOOP("Decrease vertical size"), I18N_NOOP("Decrease vertical size"),
- Qt::ALT+Qt::CTRL+Qt::SHIFT+Qt::Key_Up,KKey::QtWIN+Qt::CTRL+Qt::SHIFT+Qt::Key_Up,
- winGrid, SLOT ( resize_DV() ));
-
-
- accel->updateConnections();
+ KWinGrid * winGrid = new KWinGrid(hgap,vgap,hsplit,vsplit,split,ignorestruts);
+ KActionCollection * actions = new KActionCollection(winGrid);
+
+ KAction * move_TL = new KAction(winGrid);
+ actions->addAction("Move top-left", move_TL);
+ move_TL->setHelpText("Move active window top-left");
+ move_TL->setGlobalShortcut(KShortcut(
+ Qt::ALT+Qt::SHIFT+Qt::Key_I, Qt::META+Qt::SHIFT+Qt::Key_I));
+ QObject::connect(move_TL, SIGNAL(triggered(bool)), winGrid, SLOT(move_TL()));
+
+ KAction * move_TR = new KAction(winGrid);
+ actions->addAction("Move top-right", move_TR);
+ move_TR->setHelpText("Move active window top-right");
+ move_TR->setGlobalShortcut(KShortcut(
+ Qt::ALT+Qt::SHIFT+Qt::Key_O, Qt::META+Qt::SHIFT+Qt::Key_O));
+ QObject::connect(move_TR, SIGNAL(triggered(bool)), winGrid, SLOT(move_TR()));
+
+ KAction * move_BL = new KAction(winGrid);
+ actions->addAction("Move bottom-left", move_BL);
+ move_BL->setHelpText("Move active window bottom-left");
+ move_BL->setGlobalShortcut(KShortcut(
+ Qt::ALT+Qt::SHIFT+Qt::Key_K, Qt::META+Qt::SHIFT+Qt::Key_K));
+ QObject::connect(move_BL, SIGNAL(triggered(bool)), winGrid, SLOT(move_BL()));
+
+ KAction * move_BR = new KAction(winGrid);
+ actions->addAction("Move bottom-right", move_BR);
+ move_BR->setHelpText("Move active window bottom-right");
+ move_BR->setGlobalShortcut(KShortcut(
+ Qt::ALT+Qt::SHIFT+Qt::Key_L, Qt::META+Qt::SHIFT+Qt::Key_L));
+ QObject::connect(move_BR, SIGNAL(triggered(bool)), winGrid, SLOT(move_BR()));
+
+ KAction * resize_Q = new KAction(winGrid);
+ actions->addAction("Resize quarter", resize_Q);
+ resize_Q->setHelpText("Resize quarter");
+ resize_Q->setGlobalShortcut(KShortcut(
+ Qt::ALT+Qt::CTRL+Qt::SHIFT+Qt::Key_I, Qt::META+Qt::CTRL+Qt::SHIFT+Qt::Key_I));
+ QObject::connect(resize_Q, SIGNAL(triggered(bool)), winGrid, SLOT(resize_Q()));
+
+ KAction * resize_H = new KAction(winGrid);
+ actions->addAction("Resize horizontal", resize_H);
+ resize_H->setHelpText("Resize horizontal");
+ resize_H->setGlobalShortcut(KShortcut(
+ Qt::ALT+Qt::CTRL+Qt::SHIFT+Qt::Key_O, Qt::META+Qt::CTRL+Qt::SHIFT+Qt::Key_O));
+ QObject::connect(resize_H, SIGNAL(triggered(bool)), winGrid, SLOT(resize_H()));
+
+ KAction * resize_V = new KAction(winGrid);
+ actions->addAction("Resize vertical", resize_V);
+ resize_V->setHelpText("Resize vertical");
+ resize_V->setGlobalShortcut(KShortcut(
+ Qt::ALT+Qt::CTRL+Qt::SHIFT+Qt::Key_K, Qt::META+Qt::CTRL+Qt::SHIFT+Qt::Key_K));
+ QObject::connect(resize_V, SIGNAL(triggered(bool)), winGrid, SLOT(resize_V()));
+
+ KAction * resize_F = new KAction(winGrid);
+ actions->addAction("Resize full", resize_F);
+ resize_F->setHelpText("Resize full");
+ resize_F->setGlobalShortcut(KShortcut(
+ Qt::ALT+Qt::CTRL+Qt::SHIFT+Qt::Key_L, Qt::META+Qt::CTRL+Qt::SHIFT+Qt::Key_L));
+ QObject::connect(resize_F, SIGNAL(triggered(bool)), winGrid, SLOT(resize_F()));
+
+ KAction * move_L = new KAction(winGrid);
+ actions->addAction("Move left", move_L);
+ move_L->setHelpText("Move left");
+ move_L->setGlobalShortcut(KShortcut(
+ Qt::ALT+Qt::SHIFT+Qt::Key_Left, Qt::META+Qt::SHIFT+Qt::Key_Left));
+ QObject::connect(move_L, SIGNAL(triggered(bool)), winGrid, SLOT(move_L()));
+
+ KAction * move_R = new KAction(winGrid);
+ actions->addAction("Move right", move_R);
+ move_R->setHelpText("Move right");
+ move_R->setGlobalShortcut(KShortcut(
+ Qt::ALT+Qt::SHIFT+Qt::Key_Right, Qt::META+Qt::SHIFT+Qt::Key_Right));
+ QObject::connect(move_R, SIGNAL(triggered(bool)), winGrid, SLOT(move_R()));
+
+ KAction * move_U = new KAction(winGrid);
+ actions->addAction("Move up", move_U);
+ move_U->setHelpText("Move up");
+ move_U->setGlobalShortcut(KShortcut(
+ Qt::ALT+Qt::SHIFT+Qt::Key_Up, Qt::META+Qt::SHIFT+Qt::Key_Up));
+ QObject::connect(move_U, SIGNAL(triggered(bool)), winGrid, SLOT(move_U()));
+
+ KAction * move_D = new KAction(winGrid);
+ actions->addAction("Move down", move_D);
+ move_D->setHelpText("Move down");
+ move_D->setGlobalShortcut(KShortcut(
+ Qt::ALT+Qt::SHIFT+Qt::Key_Down, Qt::META+Qt::SHIFT+Qt::Key_Down));
+ QObject::connect(move_D, SIGNAL(triggered(bool)), winGrid, SLOT(move_D()));
+
+ KAction * resize_IH = new KAction(winGrid);
+ actions->addAction("Increase horizontal size", resize_IH);
+ resize_IH->setHelpText("Increase horizontal size");
+ resize_IH->setGlobalShortcut(KShortcut(
+ Qt::ALT+Qt::CTRL+Qt::SHIFT+Qt::Key_Right,Qt::META+Qt::CTRL+Qt::SHIFT+Qt::Key_Right));
+ QObject::connect(resize_IH, SIGNAL(triggered(bool)), winGrid, SLOT(resize_IH()));
+
+ KAction * resize_IV = new KAction(winGrid);
+ actions->addAction("Increase vertical size", resize_IV);
+ resize_IV->setHelpText("Increase vertical size");
+ resize_IV->setGlobalShortcut(KShortcut(
+ Qt::ALT+Qt::CTRL+Qt::SHIFT+Qt::Key_Down,Qt::META+Qt::CTRL+Qt::SHIFT+Qt::Key_Down));
+ QObject::connect(resize_IV, SIGNAL(triggered(bool)), winGrid, SLOT(resize_IV()));
+
+ KAction * resize_DH = new KAction(winGrid);
+ actions->addAction("Decrease horizontal size", resize_DH);
+ resize_DH->setHelpText("Decrease horizontal size");
+ resize_DH->setGlobalShortcut(KShortcut(
+ Qt::ALT+Qt::CTRL+Qt::SHIFT+Qt::Key_Left,Qt::META+Qt::CTRL+Qt::SHIFT+Qt::Key_Left));
+ QObject::connect(resize_DH, SIGNAL(triggered(bool)), winGrid, SLOT(resize_DH()));
+
+ KAction * resize_DV = new KAction(resize_DV);
+ actions->addAction("Decrease vertical size", resize_DV);
+ resize_DV->setHelpText("Decrease vertical size");
+ resize_DV->setGlobalShortcut(KShortcut(
+ Qt::ALT+Qt::CTRL+Qt::SHIFT+Qt::Key_Up,Qt::META+Qt::CTRL+Qt::SHIFT+Qt::Key_Up));
+ QObject::connect(resize_DV, SIGNAL(triggered(bool)), winGrid, SLOT(resize_DV()));
int ret = app->exec();