Adding a few cleanups by Melchior
svn path=/trunk/kdebase/kwin/; revision=96754icc-effect-5.14.5
parent
dc874cdc2f
commit
070353f3f5
|
@ -1,3 +1,4 @@
|
||||||
|
// $Id$
|
||||||
// Melchior FRANZ <a8603365@unet.univie.ac.at> -- 2001-04-22
|
// Melchior FRANZ <a8603365@unet.univie.ac.at> -- 2001-04-22
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
// $Id$
|
||||||
#ifndef __KDE_MODSYSTEMCONFIG_H
|
#ifndef __KDE_MODSYSTEMCONFIG_H
|
||||||
#define __KDE_MODSYSTEMCONFIG_H
|
#define __KDE_MODSYSTEMCONFIG_H
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
|
// $Id$
|
||||||
// Daniel M. DULEY <mosfet@kde.org> original work
|
// Daniel M. DULEY <mosfet@kde.org> original work
|
||||||
// Melchior FRANZ <a8603365@unet.univie.ac.at> configuration options & modification
|
// Melchior FRANZ <a8603365@unet.univie.ac.at> configuration options
|
||||||
|
|
||||||
#include <kconfig.h>
|
#include <kconfig.h>
|
||||||
#include <kglobal.h>
|
#include <kglobal.h>
|
||||||
|
@ -191,37 +192,37 @@ static void delete_pixmaps()
|
||||||
|
|
||||||
static bool read_config()
|
static bool read_config()
|
||||||
{
|
{
|
||||||
bool sh, changed = false;
|
bool showh;
|
||||||
int hs, hw;
|
int hsize, hwidth;
|
||||||
QString bp;
|
QString bpatt;
|
||||||
|
|
||||||
KConfig* conf = KGlobal::config();
|
KConfig* conf = KGlobal::config();
|
||||||
conf->setGroup("ModernSystem");
|
conf->setGroup("ModernSystem");
|
||||||
sh = conf->readBoolEntry("ShowHandle", true);
|
showh = conf->readBoolEntry("ShowHandle", true);
|
||||||
|
|
||||||
hw = conf->readUnsignedNumEntry("HandleWidth", 6);
|
hwidth = conf->readUnsignedNumEntry("HandleWidth", 6);
|
||||||
hs = conf->readUnsignedNumEntry("HandleSize", 30);
|
hsize = conf->readUnsignedNumEntry("HandleSize", 30);
|
||||||
if (!(sh && hs && hw)) {
|
if (!(showh && hsize && hwidth)) {
|
||||||
sh = false;
|
showh = false;
|
||||||
hw = hs = 0;
|
hwidth = hsize = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options->customButtonPositions()) {
|
if (options->customButtonPositions()) {
|
||||||
bp = "2" + options->titleButtonsLeft() + "3t3"
|
bpatt = "2" + options->titleButtonsLeft() + "3t3"
|
||||||
+ options->titleButtonsRight() + "2";
|
+ options->titleButtonsRight() + "2";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
bp = "2X3t3HSIA2";
|
bpatt = "2X3t3HSIA2";
|
||||||
|
|
||||||
if (sh != show_handle || hw != handle_width || hs != handle_size
|
if (showh == show_handle && hwidth == handle_width && hsize == handle_size
|
||||||
|| bp != *button_pattern)
|
&& bpatt == *button_pattern)
|
||||||
changed = true;
|
return false;
|
||||||
|
|
||||||
show_handle = sh;
|
show_handle = showh;
|
||||||
handle_width = hw;
|
handle_width = hwidth;
|
||||||
handle_size = hs;
|
handle_size = hsize;
|
||||||
*button_pattern = bp;
|
*button_pattern = bpatt;
|
||||||
return changed;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
ModernButton::ModernButton(Client *parent, const char *name,
|
ModernButton::ModernButton(Client *parent, const char *name,
|
||||||
|
@ -554,9 +555,9 @@ void ModernSys::doShape()
|
||||||
mask -= QRect(width()-2, height()-2, 1, 1);
|
mask -= QRect(width()-2, height()-2, 1, 1);
|
||||||
mask -= QRect(width()-2, height()-hs, 1, 1);
|
mask -= QRect(width()-2, height()-hs, 1, 1);
|
||||||
mask -= QRect(width()-hs, height()-2, 1, 1);
|
mask -= QRect(width()-hs, height()-2, 1, 1);
|
||||||
} else {
|
} else
|
||||||
mask -= QRect(width()-1, height()-1, 1, 1);
|
mask -= QRect(width()-1, height()-1, 1, 1);
|
||||||
}
|
|
||||||
setMask(mask);
|
setMask(mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -607,12 +608,15 @@ Client::MousePosition ModernSys::mousePosition( const QPoint& p) const
|
||||||
|
|
||||||
if ( show_handle && m == Center ) {
|
if ( show_handle && m == Center ) {
|
||||||
int border = handle_width + 4;
|
int border = handle_width + 4;
|
||||||
if ( p.x() >= width()-border && p.y() >= height()-border )
|
bool hx = (p.x() >= width() - border);
|
||||||
|
bool hy = (p.y() >= height() - border);
|
||||||
|
|
||||||
|
if (hx && hy)
|
||||||
m = BottomRight;
|
m = BottomRight;
|
||||||
else if ( p.y() >= height()-border )
|
else if (hx)
|
||||||
m = Bottom;
|
|
||||||
else if ( p.x() >= width()-border )
|
|
||||||
m = Right;
|
m = Right;
|
||||||
|
else if (hy)
|
||||||
|
m = Bottom;
|
||||||
}
|
}
|
||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
// $Id$
|
||||||
#ifndef __MODSYSTEMCLIENT_H
|
#ifndef __MODSYSTEMCLIENT_H
|
||||||
#define __MODSYSTEMCLIENT_H
|
#define __MODSYSTEMCLIENT_H
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue