|
|
@ -13,11 +13,11 @@
|
|
|
|
#include <klocale.h>
|
|
|
|
#include <klocale.h>
|
|
|
|
#include <kstandarddirs.h>
|
|
|
|
#include <kstandarddirs.h>
|
|
|
|
|
|
|
|
|
|
|
|
#include <qbitmap.h>
|
|
|
|
#include <ntqbitmap.h>
|
|
|
|
#include <qlabel.h>
|
|
|
|
#include <ntqlabel.h>
|
|
|
|
#include <qlayout.h>
|
|
|
|
#include <ntqlayout.h>
|
|
|
|
#include <qpainter.h>
|
|
|
|
#include <ntqpainter.h>
|
|
|
|
#include <qtooltip.h>
|
|
|
|
#include <ntqtooltip.h>
|
|
|
|
|
|
|
|
|
|
|
|
#include "fahrenheitclient.h"
|
|
|
|
#include "fahrenheitclient.h"
|
|
|
|
|
|
|
|
|
|
|
@ -33,7 +33,7 @@ int titleHeight_ = 24;
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
bool FahrenheitFactory::initialized_ = false;
|
|
|
|
bool FahrenheitFactory::initialized_ = false;
|
|
|
|
Qt::AlignmentFlags FahrenheitFactory::titlealign_ = Qt::AlignLeft;
|
|
|
|
TQt::AlignmentFlags FahrenheitFactory::titlealign_ = TQt::AlignLeft;
|
|
|
|
|
|
|
|
|
|
|
|
extern "C" KDecorationFactory* create_factory()
|
|
|
|
extern "C" KDecorationFactory* create_factory()
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -102,11 +102,11 @@ bool FahrenheitFactory::readConfig()
|
|
|
|
config.setGroup("General");
|
|
|
|
config.setGroup("General");
|
|
|
|
|
|
|
|
|
|
|
|
// grab settings
|
|
|
|
// grab settings
|
|
|
|
Qt::AlignmentFlags oldalign = titlealign_;
|
|
|
|
TQt::AlignmentFlags oldalign = titlealign_;
|
|
|
|
QString value = config.readEntry("TitleAlignment", "AlignLeft");
|
|
|
|
TQString value = config.readEntry("TitleAlignment", "AlignLeft");
|
|
|
|
if (value == "AlignLeft") titlealign_ = Qt::AlignLeft;
|
|
|
|
if (value == "AlignLeft") titlealign_ = TQt::AlignLeft;
|
|
|
|
else if (value == "AlignHCenter") titlealign_ = Qt::AlignHCenter;
|
|
|
|
else if (value == "AlignHCenter") titlealign_ = TQt::AlignHCenter;
|
|
|
|
else if (value == "AlignRight") titlealign_ = Qt::AlignRight;
|
|
|
|
else if (value == "AlignRight") titlealign_ = TQt::AlignRight;
|
|
|
|
|
|
|
|
|
|
|
|
if (oldalign == titlealign_)
|
|
|
|
if (oldalign == titlealign_)
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
@ -124,16 +124,16 @@ bool FahrenheitFactory::readConfig()
|
|
|
|
// Constructor
|
|
|
|
// Constructor
|
|
|
|
|
|
|
|
|
|
|
|
FahrenheitButton::FahrenheitButton(FahrenheitClient *parent, const char *name,
|
|
|
|
FahrenheitButton::FahrenheitButton(FahrenheitClient *parent, const char *name,
|
|
|
|
const QString& tip, ButtonType type,
|
|
|
|
const TQString& tip, ButtonType type,
|
|
|
|
QString pixmap)
|
|
|
|
TQString pixmap)
|
|
|
|
: QButton(parent->widget(), name), client_(parent), type_(type),
|
|
|
|
: TQButton(parent->widget(), name), client_(parent), type_(type),
|
|
|
|
deco_(0), lastmouse_(0)
|
|
|
|
deco_(0), lastmouse_(0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
setBackgroundMode(NoBackground);
|
|
|
|
setBackgroundMode(NoBackground);
|
|
|
|
setFixedWidth(16);
|
|
|
|
setFixedWidth(16);
|
|
|
|
setCursor(arrowCursor);
|
|
|
|
setCursor(arrowCursor);
|
|
|
|
if (pixmap) setPixmap(pixmap);
|
|
|
|
if (pixmap) setPixmap(pixmap);
|
|
|
|
QToolTip::add(this, tip);
|
|
|
|
TQToolTip::add(this, tip);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
FahrenheitButton::~FahrenheitButton()
|
|
|
|
FahrenheitButton::~FahrenheitButton()
|
|
|
@ -146,15 +146,15 @@ FahrenheitButton::~FahrenheitButton()
|
|
|
|
// -----------
|
|
|
|
// -----------
|
|
|
|
// Create pixmap button decorations
|
|
|
|
// Create pixmap button decorations
|
|
|
|
|
|
|
|
|
|
|
|
void FahrenheitButton::setPixmap(QString pixmap)
|
|
|
|
void FahrenheitButton::setPixmap(TQString pixmap)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!pixmap) return; // probably the menu button
|
|
|
|
if (!pixmap) return; // probably the menu button
|
|
|
|
|
|
|
|
|
|
|
|
QString buttonLocation_ = KGlobal::dirs()->findResource ("data",
|
|
|
|
TQString buttonLocation_ = KGlobal::dirs()->findResource ("data",
|
|
|
|
QString("kwin/fahrenheit/") + pixmap + ".png");
|
|
|
|
TQString("kwin/fahrenheit/") + pixmap + ".png");
|
|
|
|
|
|
|
|
|
|
|
|
if (deco_) delete deco_;
|
|
|
|
if (deco_) delete deco_;
|
|
|
|
deco_ = new QPixmap(buttonLocation_);
|
|
|
|
deco_ = new TQPixmap(buttonLocation_);
|
|
|
|
repaint(false);
|
|
|
|
repaint(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -163,9 +163,9 @@ void FahrenheitButton::setPixmap(QString pixmap)
|
|
|
|
// ----------
|
|
|
|
// ----------
|
|
|
|
// Return size hint
|
|
|
|
// Return size hint
|
|
|
|
|
|
|
|
|
|
|
|
QSize FahrenheitButton::sizeHint() const
|
|
|
|
TQSize FahrenheitButton::sizeHint() const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return QSize(11, 9);
|
|
|
|
return TQSize(11, 9);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
@ -173,10 +173,10 @@ QSize FahrenheitButton::sizeHint() const
|
|
|
|
// ------------
|
|
|
|
// ------------
|
|
|
|
// Mouse has entered the button
|
|
|
|
// Mouse has entered the button
|
|
|
|
|
|
|
|
|
|
|
|
void FahrenheitButton::enterEvent(QEvent *e)
|
|
|
|
void FahrenheitButton::enterEvent(TQEvent *e)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// if we wanted to do mouseovers, we would keep track of it here
|
|
|
|
// if we wanted to do mouseovers, we would keep track of it here
|
|
|
|
QButton::enterEvent(e);
|
|
|
|
TQButton::enterEvent(e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
@ -184,10 +184,10 @@ void FahrenheitButton::enterEvent(QEvent *e)
|
|
|
|
// ------------
|
|
|
|
// ------------
|
|
|
|
// Mouse has left the button
|
|
|
|
// Mouse has left the button
|
|
|
|
|
|
|
|
|
|
|
|
void FahrenheitButton::leaveEvent(QEvent *e)
|
|
|
|
void FahrenheitButton::leaveEvent(TQEvent *e)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// if we wanted to do mouseovers, we would keep track of it here
|
|
|
|
// if we wanted to do mouseovers, we would keep track of it here
|
|
|
|
QButton::leaveEvent(e);
|
|
|
|
TQButton::leaveEvent(e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
@ -195,7 +195,7 @@ void FahrenheitButton::leaveEvent(QEvent *e)
|
|
|
|
// -----------------
|
|
|
|
// -----------------
|
|
|
|
// Button has been pressed
|
|
|
|
// Button has been pressed
|
|
|
|
|
|
|
|
|
|
|
|
void FahrenheitButton::mousePressEvent(QMouseEvent* e)
|
|
|
|
void FahrenheitButton::mousePressEvent(TQMouseEvent* e)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
lastmouse_ = e->button();
|
|
|
|
lastmouse_ = e->button();
|
|
|
|
|
|
|
|
|
|
|
@ -204,9 +204,9 @@ void FahrenheitButton::mousePressEvent(QMouseEvent* e)
|
|
|
|
if ((type_ != ButtonMax) && (e->button() != LeftButton)) {
|
|
|
|
if ((type_ != ButtonMax) && (e->button() != LeftButton)) {
|
|
|
|
button = NoButton; // middle & right buttons inappropriate
|
|
|
|
button = NoButton; // middle & right buttons inappropriate
|
|
|
|
}
|
|
|
|
}
|
|
|
|
QMouseEvent me(e->type(), e->pos(), e->globalPos(),
|
|
|
|
TQMouseEvent me(e->type(), e->pos(), e->globalPos(),
|
|
|
|
button, e->state());
|
|
|
|
button, e->state());
|
|
|
|
QButton::mousePressEvent(&me);
|
|
|
|
TQButton::mousePressEvent(&me);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
@ -214,7 +214,7 @@ void FahrenheitButton::mousePressEvent(QMouseEvent* e)
|
|
|
|
// -----------------
|
|
|
|
// -----------------
|
|
|
|
// Button has been released
|
|
|
|
// Button has been released
|
|
|
|
|
|
|
|
|
|
|
|
void FahrenheitButton::mouseReleaseEvent(QMouseEvent* e)
|
|
|
|
void FahrenheitButton::mouseReleaseEvent(TQMouseEvent* e)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
lastmouse_ = e->button();
|
|
|
|
lastmouse_ = e->button();
|
|
|
|
|
|
|
|
|
|
|
@ -223,8 +223,8 @@ void FahrenheitButton::mouseReleaseEvent(QMouseEvent* e)
|
|
|
|
if ((type_ != ButtonMax) && (e->button() != LeftButton)) {
|
|
|
|
if ((type_ != ButtonMax) && (e->button() != LeftButton)) {
|
|
|
|
button = NoButton; // middle & right buttons inappropriate
|
|
|
|
button = NoButton; // middle & right buttons inappropriate
|
|
|
|
}
|
|
|
|
}
|
|
|
|
QMouseEvent me(e->type(), e->pos(), e->globalPos(), button, e->state());
|
|
|
|
TQMouseEvent me(e->type(), e->pos(), e->globalPos(), button, e->state());
|
|
|
|
QButton::mouseReleaseEvent(&me);
|
|
|
|
TQButton::mouseReleaseEvent(&me);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
@ -232,12 +232,12 @@ void FahrenheitButton::mouseReleaseEvent(QMouseEvent* e)
|
|
|
|
// ------------
|
|
|
|
// ------------
|
|
|
|
// Draw the button
|
|
|
|
// Draw the button
|
|
|
|
|
|
|
|
|
|
|
|
void FahrenheitButton::drawButton(QPainter *painter)
|
|
|
|
void FahrenheitButton::drawButton(TQPainter *painter)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!FahrenheitFactory::initialized()) return;
|
|
|
|
if (!FahrenheitFactory::initialized()) return;
|
|
|
|
|
|
|
|
|
|
|
|
QColorGroup titleColor;
|
|
|
|
TQColorGroup titleColor;
|
|
|
|
QColorGroup borderColor;
|
|
|
|
TQColorGroup borderColor;
|
|
|
|
int dx, dy;
|
|
|
|
int dx, dy;
|
|
|
|
|
|
|
|
|
|
|
|
if (type_ == ButtonMenu) {
|
|
|
|
if (type_ == ButtonMenu) {
|
|
|
@ -250,8 +250,8 @@ void FahrenheitButton::drawButton(QPainter *painter)
|
|
|
|
painter->drawLine(0, 0, width(), 0);
|
|
|
|
painter->drawLine(0, 0, width(), 0);
|
|
|
|
painter->setPen(titleColor.light());
|
|
|
|
painter->setPen(titleColor.light());
|
|
|
|
painter->drawLine(0, 1, width(), 1);
|
|
|
|
painter->drawLine(0, 1, width(), 1);
|
|
|
|
painter->drawPixmap(0, 3, client_->icon().pixmap(QIconSet::Small,
|
|
|
|
painter->drawPixmap(0, 3, client_->icon().pixmap(TQIconSet::Small,
|
|
|
|
QIconSet::Normal));
|
|
|
|
TQIconSet::Normal));
|
|
|
|
} else if (deco_) {
|
|
|
|
} else if (deco_) {
|
|
|
|
// otherwise we paint the deco
|
|
|
|
// otherwise we paint the deco
|
|
|
|
borderColor = KDecoration::options()->colorGroup(
|
|
|
|
borderColor = KDecoration::options()->colorGroup(
|
|
|
@ -307,27 +307,27 @@ void FahrenheitClient::init()
|
|
|
|
// setup layout
|
|
|
|
// setup layout
|
|
|
|
delete mainLayout_;
|
|
|
|
delete mainLayout_;
|
|
|
|
|
|
|
|
|
|
|
|
mainLayout_ = new QVBoxLayout(widget(), 0, 0);
|
|
|
|
mainLayout_ = new TQVBoxLayout(widget(), 0, 0);
|
|
|
|
topLayout_ = new QBoxLayout(mainLayout_, QBoxLayout::LeftToRight, 0, 0);
|
|
|
|
topLayout_ = new TQBoxLayout(mainLayout_, TQBoxLayout::LeftToRight, 0, 0);
|
|
|
|
|
|
|
|
|
|
|
|
titleSpacer_ = new QSpacerItem ( 0, 24,
|
|
|
|
titleSpacer_ = new TQSpacerItem ( 0, 24,
|
|
|
|
QSizePolicy::Preferred,
|
|
|
|
TQSizePolicy::Preferred,
|
|
|
|
QSizePolicy::Fixed);
|
|
|
|
TQSizePolicy::Fixed);
|
|
|
|
barSpacer_ = new QSpacerItem ( 14, 24,
|
|
|
|
barSpacer_ = new TQSpacerItem ( 14, 24,
|
|
|
|
QSizePolicy::MinimumExpanding,
|
|
|
|
TQSizePolicy::MinimumExpanding,
|
|
|
|
QSizePolicy::Fixed);
|
|
|
|
TQSizePolicy::Fixed);
|
|
|
|
|
|
|
|
|
|
|
|
menuLayout_ = new QBoxLayout(topLayout_, QBoxLayout::LeftToRight, 0, 0);
|
|
|
|
menuLayout_ = new TQBoxLayout(topLayout_, TQBoxLayout::LeftToRight, 0, 0);
|
|
|
|
menuLayout_->addSpacing(16);
|
|
|
|
menuLayout_->addSpacing(16);
|
|
|
|
|
|
|
|
|
|
|
|
recalcTitlebar();
|
|
|
|
recalcTitlebar();
|
|
|
|
|
|
|
|
|
|
|
|
QBoxLayout * titleLayout_ = new QBoxLayout(topLayout_,
|
|
|
|
TQBoxLayout * titleLayout_ = new TQBoxLayout(topLayout_,
|
|
|
|
QBoxLayout::LeftToRight, 0, 0);
|
|
|
|
TQBoxLayout::LeftToRight, 0, 0);
|
|
|
|
buttonLayout_ = new QBoxLayout(topLayout_,
|
|
|
|
buttonLayout_ = new TQBoxLayout(topLayout_,
|
|
|
|
QBoxLayout::LeftToRight, 0, 0);
|
|
|
|
TQBoxLayout::LeftToRight, 0, 0);
|
|
|
|
QBoxLayout * barLayout_ = new QBoxLayout(topLayout_,
|
|
|
|
TQBoxLayout * barLayout_ = new TQBoxLayout(topLayout_,
|
|
|
|
QBoxLayout::LeftToRight, 0, 0);
|
|
|
|
TQBoxLayout::LeftToRight, 0, 0);
|
|
|
|
titleLayout_->addItem(titleSpacer_);
|
|
|
|
titleLayout_->addItem(titleSpacer_);
|
|
|
|
|
|
|
|
|
|
|
|
for (int n=0; n<ButtonTypeCount; n++) {
|
|
|
|
for (int n=0; n<ButtonTypeCount; n++) {
|
|
|
@ -338,15 +338,15 @@ void FahrenheitClient::init()
|
|
|
|
addButtons(buttonLayout_, options()->titleButtonsRight());
|
|
|
|
addButtons(buttonLayout_, options()->titleButtonsRight());
|
|
|
|
barLayout_->addItem(barSpacer_);
|
|
|
|
barLayout_->addItem(barSpacer_);
|
|
|
|
|
|
|
|
|
|
|
|
QHBoxLayout * midLayout = new QHBoxLayout(mainLayout_, 0, 0);
|
|
|
|
TQHBoxLayout * midLayout = new TQHBoxLayout(mainLayout_, 0, 0);
|
|
|
|
|
|
|
|
|
|
|
|
midLayout->addSpacing(borderSize_ + 9);
|
|
|
|
midLayout->addSpacing(borderSize_ + 9);
|
|
|
|
if( isPreview()) {
|
|
|
|
if( isPreview()) {
|
|
|
|
midLayout->addWidget(
|
|
|
|
midLayout->addWidget(
|
|
|
|
new QLabel( i18n( "<center><b>Fahrenheit</b></center>" ),
|
|
|
|
new TQLabel( i18n( "<center><b>Fahrenheit</b></center>" ),
|
|
|
|
widget()));
|
|
|
|
widget()));
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
midLayout->addItem( new QSpacerItem( 0, 0 ));
|
|
|
|
midLayout->addItem( new TQSpacerItem( 0, 0 ));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
midLayout->addSpacing(borderSize_ + (isResizable() ? 2 : 0));
|
|
|
|
midLayout->addSpacing(borderSize_ + (isResizable() ? 2 : 0));
|
|
|
@ -365,14 +365,14 @@ void FahrenheitClient::init()
|
|
|
|
|
|
|
|
|
|
|
|
void FahrenheitClient::recalcTitlebar()
|
|
|
|
void FahrenheitClient::recalcTitlebar()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QFontMetrics fm(options()->font(isActive()));
|
|
|
|
TQFontMetrics fm(options()->font(isActive()));
|
|
|
|
titleHeight_ = fm.height();
|
|
|
|
titleHeight_ = fm.height();
|
|
|
|
QString cap = caption();
|
|
|
|
TQString cap = caption();
|
|
|
|
if (cap.length() < 5) // make sure the titlebar has sufficiently wide
|
|
|
|
if (cap.length() < 5) // make sure the titlebar has sufficiently wide
|
|
|
|
cap = "XXXXX"; // area for dragging the window
|
|
|
|
cap = "XXXXX"; // area for dragging the window
|
|
|
|
int textLen_ = fm.width( cap );
|
|
|
|
int textLen_ = fm.width( cap );
|
|
|
|
titleSpacer_->changeSize(4 + textLen_ + 16,
|
|
|
|
titleSpacer_->changeSize(4 + textLen_ + 16,
|
|
|
|
24, QSizePolicy::Preferred, QSizePolicy::Fixed);
|
|
|
|
24, TQSizePolicy::Preferred, TQSizePolicy::Fixed);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -382,10 +382,10 @@ void FahrenheitClient::recalcTitlebar()
|
|
|
|
// ------------
|
|
|
|
// ------------
|
|
|
|
// Add buttons to title layout
|
|
|
|
// Add buttons to title layout
|
|
|
|
|
|
|
|
|
|
|
|
void FahrenheitClient::addButtons(QBoxLayout *layout, const QString& s)
|
|
|
|
void FahrenheitClient::addButtons(TQBoxLayout *layout, const TQString& s)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QString pixmap;
|
|
|
|
TQString pixmap;
|
|
|
|
QString tip;
|
|
|
|
TQString tip;
|
|
|
|
|
|
|
|
|
|
|
|
if (s.length() > 0) {
|
|
|
|
if (s.length() > 0) {
|
|
|
|
for (unsigned n=0; n < s.length(); n++) {
|
|
|
|
for (unsigned n=0; n < s.length(); n++) {
|
|
|
@ -399,7 +399,7 @@ void FahrenheitClient::addButtons(QBoxLayout *layout, const QString& s)
|
|
|
|
this, SLOT(menuButtonPressed()));
|
|
|
|
this, SLOT(menuButtonPressed()));
|
|
|
|
button[ButtonMenu]->setFixedHeight(19);
|
|
|
|
button[ButtonMenu]->setFixedHeight(19);
|
|
|
|
menuLayout_->insertWidget(-1, button[ButtonMenu],
|
|
|
|
menuLayout_->insertWidget(-1, button[ButtonMenu],
|
|
|
|
0, Qt::AlignTop);
|
|
|
|
0, TQt::AlignTop);
|
|
|
|
menuLayout_->addSpacing(4);
|
|
|
|
menuLayout_->addSpacing(4);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -420,7 +420,7 @@ void FahrenheitClient::addButtons(QBoxLayout *layout, const QString& s)
|
|
|
|
this, SLOT(toggleOnAllDesktops()));
|
|
|
|
this, SLOT(toggleOnAllDesktops()));
|
|
|
|
button[ButtonSticky]->setFixedHeight(11);
|
|
|
|
button[ButtonSticky]->setFixedHeight(11);
|
|
|
|
layout->insertWidget(-1, button[ButtonSticky],
|
|
|
|
layout->insertWidget(-1, button[ButtonSticky],
|
|
|
|
0, Qt::AlignBottom);
|
|
|
|
0, TQt::AlignBottom);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
@ -433,7 +433,7 @@ void FahrenheitClient::addButtons(QBoxLayout *layout, const QString& s)
|
|
|
|
this, SLOT(showContextHelp()));
|
|
|
|
this, SLOT(showContextHelp()));
|
|
|
|
button[ButtonHelp]->setFixedHeight(11);
|
|
|
|
button[ButtonHelp]->setFixedHeight(11);
|
|
|
|
layout->insertWidget(-1, button[ButtonHelp],
|
|
|
|
layout->insertWidget(-1, button[ButtonHelp],
|
|
|
|
0, Qt::AlignBottom);
|
|
|
|
0, TQt::AlignBottom);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
@ -447,7 +447,7 @@ void FahrenheitClient::addButtons(QBoxLayout *layout, const QString& s)
|
|
|
|
this, SLOT(minimize()));
|
|
|
|
this, SLOT(minimize()));
|
|
|
|
button[ButtonMin]->setFixedHeight(11);
|
|
|
|
button[ButtonMin]->setFixedHeight(11);
|
|
|
|
layout->insertWidget(-1, button[ButtonMin],
|
|
|
|
layout->insertWidget(-1, button[ButtonMin],
|
|
|
|
0, Qt::AlignBottom);
|
|
|
|
0, TQt::AlignBottom);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
@ -467,7 +467,7 @@ void FahrenheitClient::addButtons(QBoxLayout *layout, const QString& s)
|
|
|
|
this, SLOT(maxButtonPressed()));
|
|
|
|
this, SLOT(maxButtonPressed()));
|
|
|
|
button[ButtonMax]->setFixedHeight(11);
|
|
|
|
button[ButtonMax]->setFixedHeight(11);
|
|
|
|
layout->insertWidget(-1, button[ButtonMax],
|
|
|
|
layout->insertWidget(-1, button[ButtonMax],
|
|
|
|
0, Qt::AlignBottom);
|
|
|
|
0, TQt::AlignBottom);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
@ -480,7 +480,7 @@ void FahrenheitClient::addButtons(QBoxLayout *layout, const QString& s)
|
|
|
|
this, SLOT(closeWindow()));
|
|
|
|
this, SLOT(closeWindow()));
|
|
|
|
button[ButtonClose]->setFixedHeight(11);
|
|
|
|
button[ButtonClose]->setFixedHeight(11);
|
|
|
|
layout->insertWidget(-1, button[ButtonClose],
|
|
|
|
layout->insertWidget(-1, button[ButtonClose],
|
|
|
|
0, Qt::AlignBottom);
|
|
|
|
0, TQt::AlignBottom);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
@ -527,8 +527,8 @@ void FahrenheitClient::desktopChange()
|
|
|
|
if (button[ButtonSticky]) {
|
|
|
|
if (button[ButtonSticky]) {
|
|
|
|
//button[ButtonSticky]->setBitmap(d ? stickydown_bits : sticky_bits);
|
|
|
|
//button[ButtonSticky]->setBitmap(d ? stickydown_bits : sticky_bits);
|
|
|
|
button[ButtonSticky]->setPixmap(d ? "unsticky" : "sticky");
|
|
|
|
button[ButtonSticky]->setPixmap(d ? "unsticky" : "sticky");
|
|
|
|
QToolTip::remove(button[ButtonSticky]);
|
|
|
|
TQToolTip::remove(button[ButtonSticky]);
|
|
|
|
QToolTip::add(button[ButtonSticky], d ? i18n("Un-Sticky") : i18n("Sticky"));
|
|
|
|
TQToolTip::add(button[ButtonSticky], d ? i18n("Un-Sticky") : i18n("Sticky"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -556,8 +556,8 @@ void FahrenheitClient::maximizeChange()
|
|
|
|
if (button[ButtonMax]) {
|
|
|
|
if (button[ButtonMax]) {
|
|
|
|
//button[ButtonMax]->setBitmap(m ? minmax_bits : max_bits);
|
|
|
|
//button[ButtonMax]->setBitmap(m ? minmax_bits : max_bits);
|
|
|
|
button[ButtonMax]->setPixmap(m ? "minmax" : "maximize");
|
|
|
|
button[ButtonMax]->setPixmap(m ? "minmax" : "maximize");
|
|
|
|
QToolTip::remove(button[ButtonMax]);
|
|
|
|
TQToolTip::remove(button[ButtonMax]);
|
|
|
|
QToolTip::add(button[ButtonMax], m ? i18n("Restore") : i18n("Maximize"));
|
|
|
|
TQToolTip::add(button[ButtonMax], m ? i18n("Restore") : i18n("Maximize"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -592,7 +592,7 @@ void FahrenheitClient::borders(int &l, int &r, int &t, int &b) const
|
|
|
|
// --------
|
|
|
|
// --------
|
|
|
|
// Called to resize the window
|
|
|
|
// Called to resize the window
|
|
|
|
|
|
|
|
|
|
|
|
void FahrenheitClient::resize(const QSize &size)
|
|
|
|
void FahrenheitClient::resize(const TQSize &size)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
widget()->resize(size);
|
|
|
|
widget()->resize(size);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -602,9 +602,9 @@ void FahrenheitClient::resize(const QSize &size)
|
|
|
|
// -------------
|
|
|
|
// -------------
|
|
|
|
// Return the minimum allowable size for this decoration
|
|
|
|
// Return the minimum allowable size for this decoration
|
|
|
|
|
|
|
|
|
|
|
|
QSize FahrenheitClient::minimumSize() const
|
|
|
|
TQSize FahrenheitClient::minimumSize() const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return QSize(100, 50);
|
|
|
|
return TQSize(100, 50);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
@ -612,7 +612,7 @@ QSize FahrenheitClient::minimumSize() const
|
|
|
|
// ---------------
|
|
|
|
// ---------------
|
|
|
|
// Return logical mouse position
|
|
|
|
// Return logical mouse position
|
|
|
|
|
|
|
|
|
|
|
|
KDecoration::Position FahrenheitClient::mousePosition(const QPoint &point) const
|
|
|
|
KDecoration::Position FahrenheitClient::mousePosition(const TQPoint &point) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//const int corner = 24;
|
|
|
|
//const int corner = 24;
|
|
|
|
Position pos;
|
|
|
|
Position pos;
|
|
|
@ -665,29 +665,29 @@ bool FahrenheitClient::isTool()
|
|
|
|
// -------------
|
|
|
|
// -------------
|
|
|
|
// Event filter
|
|
|
|
// Event filter
|
|
|
|
|
|
|
|
|
|
|
|
bool FahrenheitClient::eventFilter(QObject *obj, QEvent *e)
|
|
|
|
bool FahrenheitClient::eventFilter(TQObject *obj, TQEvent *e)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (obj != widget()) return false;
|
|
|
|
if (obj != widget()) return false;
|
|
|
|
|
|
|
|
|
|
|
|
switch (e->type()) {
|
|
|
|
switch (e->type()) {
|
|
|
|
case QEvent::MouseButtonDblClick: {
|
|
|
|
case TQEvent::MouseButtonDblClick: {
|
|
|
|
mouseDoubleClickEvent(static_cast<QMouseEvent *>(e));
|
|
|
|
mouseDoubleClickEvent(static_cast<TQMouseEvent *>(e));
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case QEvent::MouseButtonPress: {
|
|
|
|
case TQEvent::MouseButtonPress: {
|
|
|
|
processMousePressEvent(static_cast<QMouseEvent *>(e));
|
|
|
|
processMousePressEvent(static_cast<TQMouseEvent *>(e));
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case QEvent::Paint: {
|
|
|
|
case TQEvent::Paint: {
|
|
|
|
paintEvent(static_cast<QPaintEvent *>(e));
|
|
|
|
paintEvent(static_cast<TQPaintEvent *>(e));
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case QEvent::Resize: {
|
|
|
|
case TQEvent::Resize: {
|
|
|
|
resizeEvent(static_cast<QResizeEvent *>(e));
|
|
|
|
resizeEvent(static_cast<TQResizeEvent *>(e));
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case QEvent::Show: {
|
|
|
|
case TQEvent::Show: {
|
|
|
|
showEvent(static_cast<QShowEvent *>(e));
|
|
|
|
showEvent(static_cast<TQShowEvent *>(e));
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
default: {
|
|
|
|
default: {
|
|
|
@ -703,7 +703,7 @@ bool FahrenheitClient::eventFilter(QObject *obj, QEvent *e)
|
|
|
|
// -----------------------
|
|
|
|
// -----------------------
|
|
|
|
// Doubleclick on title
|
|
|
|
// Doubleclick on title
|
|
|
|
|
|
|
|
|
|
|
|
void FahrenheitClient::mouseDoubleClickEvent(QMouseEvent *e)
|
|
|
|
void FahrenheitClient::mouseDoubleClickEvent(TQMouseEvent *e)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (titleSpacer_->geometry().contains(e->pos())) titlebarDblClickOperation();
|
|
|
|
if (titleSpacer_->geometry().contains(e->pos())) titlebarDblClickOperation();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -713,15 +713,15 @@ void FahrenheitClient::mouseDoubleClickEvent(QMouseEvent *e)
|
|
|
|
// ------------
|
|
|
|
// ------------
|
|
|
|
// Repaint the window
|
|
|
|
// Repaint the window
|
|
|
|
|
|
|
|
|
|
|
|
void FahrenheitClient::paintEvent(QPaintEvent*)
|
|
|
|
void FahrenheitClient::paintEvent(TQPaintEvent*)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QColorGroup titleColor = options()->colorGroup(ColorTitleBar, isActive());
|
|
|
|
TQColorGroup titleColor = options()->colorGroup(ColorTitleBar, isActive());
|
|
|
|
QColorGroup handleColor = options()->colorGroup(ColorHandle, isActive());
|
|
|
|
TQColorGroup handleColor = options()->colorGroup(ColorHandle, isActive());
|
|
|
|
QColorGroup borderColor = options()->colorGroup(ColorFrame, isActive());
|
|
|
|
TQColorGroup borderColor = options()->colorGroup(ColorFrame, isActive());
|
|
|
|
|
|
|
|
|
|
|
|
QRect t = titleSpacer_->geometry();
|
|
|
|
TQRect t = titleSpacer_->geometry();
|
|
|
|
QRect buttonRect = buttonLayout_->geometry();
|
|
|
|
TQRect buttonRect = buttonLayout_->geometry();
|
|
|
|
QRect barRect = barSpacer_->geometry();
|
|
|
|
TQRect barRect = barSpacer_->geometry();
|
|
|
|
|
|
|
|
|
|
|
|
t.setTop(1);
|
|
|
|
t.setTop(1);
|
|
|
|
int handle = (isResizable() ? 2 : 0);
|
|
|
|
int handle = (isResizable() ? 2 : 0);
|
|
|
@ -732,9 +732,9 @@ void FahrenheitClient::paintEvent(QPaintEvent*)
|
|
|
|
int b = height() - handle;
|
|
|
|
int b = height() - handle;
|
|
|
|
int w = width();
|
|
|
|
int w = width();
|
|
|
|
int h = height();
|
|
|
|
int h = height();
|
|
|
|
QPainter p(widget());
|
|
|
|
TQPainter p(widget());
|
|
|
|
|
|
|
|
|
|
|
|
p.setPen(Qt::black);
|
|
|
|
p.setPen(TQt::black);
|
|
|
|
p.setBrush(borderColor.background());
|
|
|
|
p.setBrush(borderColor.background());
|
|
|
|
p.drawRect(9, 13, width() - 9 - handle, height() - 13 - handle); // Outer edge
|
|
|
|
p.drawRect(9, 13, width() - 9 - handle, height() - 13 - handle); // Outer edge
|
|
|
|
|
|
|
|
|
|
|
@ -752,7 +752,7 @@ void FahrenheitClient::paintEvent(QPaintEvent*)
|
|
|
|
// Draw edge of bottom-left corner inside the area removed by the mask.
|
|
|
|
// Draw edge of bottom-left corner inside the area removed by the mask.
|
|
|
|
// We draw this now, instead of later with the rest, so that it doesn't
|
|
|
|
// We draw this now, instead of later with the rest, so that it doesn't
|
|
|
|
// cover up part of the grip bar.
|
|
|
|
// cover up part of the grip bar.
|
|
|
|
p.setPen(Qt::black);
|
|
|
|
p.setPen(TQt::black);
|
|
|
|
p.drawPoint(10, b - 5);
|
|
|
|
p.drawPoint(10, b - 5);
|
|
|
|
p.drawPoint(10, b - 4);
|
|
|
|
p.drawPoint(10, b - 4);
|
|
|
|
p.drawPoint(11, b - 3);
|
|
|
|
p.drawPoint(11, b - 3);
|
|
|
@ -771,7 +771,7 @@ void FahrenheitClient::paintEvent(QPaintEvent*)
|
|
|
|
p.drawLine(12, 10, width() - handle - 6, 10); // Bevel edge to left of button area
|
|
|
|
p.drawLine(12, 10, width() - handle - 6, 10); // Bevel edge to left of button area
|
|
|
|
|
|
|
|
|
|
|
|
// Draw to the right of the button area
|
|
|
|
// Draw to the right of the button area
|
|
|
|
p.setPen(Qt::black);
|
|
|
|
p.setPen(TQt::black);
|
|
|
|
p.drawLine(r - barWidth, 10, r - barWidth + 5, 12);
|
|
|
|
p.drawLine(r - barWidth, 10, r - barWidth + 5, 12);
|
|
|
|
p.setPen(borderColor.mid());
|
|
|
|
p.setPen(borderColor.mid());
|
|
|
|
p.drawLine(r - barWidth, 11, r - barWidth + 5, 13);
|
|
|
|
p.drawLine(r - barWidth, 11, r - barWidth + 5, 13);
|
|
|
@ -838,7 +838,7 @@ void FahrenheitClient::paintEvent(QPaintEvent*)
|
|
|
|
p.drawLine(tr - 5, tt + 7, tr - 5, tt + 11);
|
|
|
|
p.drawLine(tr - 5, tt + 7, tr - 5, tt + 11);
|
|
|
|
|
|
|
|
|
|
|
|
// Draw top edge and left curve of title bar
|
|
|
|
// Draw top edge and left curve of title bar
|
|
|
|
//p.setPen(Qt::black);
|
|
|
|
//p.setPen(TQt::black);
|
|
|
|
p.setPen(titleColor.dark());
|
|
|
|
p.setPen(titleColor.dark());
|
|
|
|
p.drawPoint(3, 1);
|
|
|
|
p.drawPoint(3, 1);
|
|
|
|
p.drawPoint(4, 1);
|
|
|
|
p.drawPoint(4, 1);
|
|
|
@ -976,7 +976,7 @@ void FahrenheitClient::paintEvent(QPaintEvent*)
|
|
|
|
p.drawLine(8, 26, 5, 29);
|
|
|
|
p.drawLine(8, 26, 5, 29);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
p.setPen(Qt::black);
|
|
|
|
p.setPen(TQt::black);
|
|
|
|
//p.setPen(borderColor.dark());
|
|
|
|
//p.setPen(borderColor.dark());
|
|
|
|
|
|
|
|
|
|
|
|
// Draw edge of top-right corner inside the area removed by the mask.
|
|
|
|
// Draw edge of top-right corner inside the area removed by the mask.
|
|
|
@ -995,7 +995,7 @@ void FahrenheitClient::paintEvent(QPaintEvent*)
|
|
|
|
|
|
|
|
|
|
|
|
// Draw edge of bottom-right corner inside the area removed by the mask.
|
|
|
|
// Draw edge of bottom-right corner inside the area removed by the mask.
|
|
|
|
|
|
|
|
|
|
|
|
p.setPen(Qt::black);
|
|
|
|
p.setPen(TQt::black);
|
|
|
|
p.drawPoint(r - 2, b - 5);
|
|
|
|
p.drawPoint(r - 2, b - 5);
|
|
|
|
p.drawPoint(r - 2, b - 4);
|
|
|
|
p.drawPoint(r - 2, b - 4);
|
|
|
|
p.drawPoint(r - 3, b - 3);
|
|
|
|
p.drawPoint(r - 3, b - 3);
|
|
|
@ -1009,7 +1009,7 @@ void FahrenheitClient::paintEvent(QPaintEvent*)
|
|
|
|
|
|
|
|
|
|
|
|
if (isResizable()) {
|
|
|
|
if (isResizable()) {
|
|
|
|
if (!isShade()) { // Draw handle bar
|
|
|
|
if (!isShade()) { // Draw handle bar
|
|
|
|
p.setPen(Qt::black);
|
|
|
|
p.setPen(TQt::black);
|
|
|
|
p.fillRect(w - 5, h - 20, 3, 17, borderColor.background());
|
|
|
|
p.fillRect(w - 5, h - 20, 3, 17, borderColor.background());
|
|
|
|
p.fillRect(w - 20, h - 5, 17, 3, borderColor.background());
|
|
|
|
p.fillRect(w - 20, h - 5, 17, 3, borderColor.background());
|
|
|
|
|
|
|
|
|
|
|
@ -1037,10 +1037,10 @@ void FahrenheitClient::paintEvent(QPaintEvent*)
|
|
|
|
p.setFont(options()->font(isActive(), isTool()));
|
|
|
|
p.setFont(options()->font(isActive(), isTool()));
|
|
|
|
p.setPen(options()->color(ColorFont, isActive()));
|
|
|
|
p.setPen(options()->color(ColorFont, isActive()));
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
p.drawText(20, 0, t.width() - 36, 20, Qt::AlignVCenter, caption());
|
|
|
|
p.drawText(20, 0, t.width() - 36, 20, TQt::AlignVCenter, caption());
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
p.drawText(menuLayout_->geometry().width(), 0, t.width() - 16, 20,
|
|
|
|
p.drawText(menuLayout_->geometry().width(), 0, t.width() - 16, 20,
|
|
|
|
Qt::AlignVCenter, caption());
|
|
|
|
TQt::AlignVCenter, caption());
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1051,12 +1051,12 @@ void FahrenheitClient::paintEvent(QPaintEvent*)
|
|
|
|
|
|
|
|
|
|
|
|
void FahrenheitClient::doShape()
|
|
|
|
void FahrenheitClient::doShape()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QRegion mask(0, 0, width(), height());
|
|
|
|
TQRegion mask(0, 0, width(), height());
|
|
|
|
QRect t(titleSpacer_->geometry());
|
|
|
|
TQRect t(titleSpacer_->geometry());
|
|
|
|
int handle = (isResizable() ? 2 : 0);
|
|
|
|
int handle = (isResizable() ? 2 : 0);
|
|
|
|
int tr = t.right();
|
|
|
|
int tr = t.right();
|
|
|
|
QRect barRect(barSpacer_->geometry());
|
|
|
|
TQRect barRect(barSpacer_->geometry());
|
|
|
|
QRect buttonRect(buttonLayout_->geometry());
|
|
|
|
TQRect buttonRect(buttonLayout_->geometry());
|
|
|
|
|
|
|
|
|
|
|
|
int barWidth = barRect.width() - handle;
|
|
|
|
int barWidth = barRect.width() - handle;
|
|
|
|
int buttonWidth = buttonRect.width();
|
|
|
|
int buttonWidth = buttonRect.width();
|
|
|
@ -1067,77 +1067,77 @@ void FahrenheitClient::doShape()
|
|
|
|
|
|
|
|
|
|
|
|
// Remove top-left corner.
|
|
|
|
// Remove top-left corner.
|
|
|
|
|
|
|
|
|
|
|
|
mask -= QRegion(0, 0, 5, 1);
|
|
|
|
mask -= TQRegion(0, 0, 5, 1);
|
|
|
|
mask -= QRegion(0, 1, 3, 1);
|
|
|
|
mask -= TQRegion(0, 1, 3, 1);
|
|
|
|
mask -= QRegion(0, 2, 2, 1);
|
|
|
|
mask -= TQRegion(0, 2, 2, 1);
|
|
|
|
mask -= QRegion(0, 3, 1, 2);
|
|
|
|
mask -= TQRegion(0, 3, 1, 2);
|
|
|
|
|
|
|
|
|
|
|
|
// Remove area above rounded portion of title bar
|
|
|
|
// Remove area above rounded portion of title bar
|
|
|
|
mask -= QRegion(tr - 11, 0, 12, 1);
|
|
|
|
mask -= TQRegion(tr - 11, 0, 12, 1);
|
|
|
|
mask -= QRegion(tr - 8, 1, 9, 1);
|
|
|
|
mask -= TQRegion(tr - 8, 1, 9, 1);
|
|
|
|
mask -= QRegion(tr - 7, 2, 8, 1);
|
|
|
|
mask -= TQRegion(tr - 7, 2, 8, 1);
|
|
|
|
mask -= QRegion(tr - 6, 3, 7, 1);
|
|
|
|
mask -= TQRegion(tr - 6, 3, 7, 1);
|
|
|
|
mask -= QRegion(tr - 5, 4, 6, 1);
|
|
|
|
mask -= TQRegion(tr - 5, 4, 6, 1);
|
|
|
|
mask -= QRegion(tr - 4, 5, 5, 3);
|
|
|
|
mask -= TQRegion(tr - 4, 5, 5, 3);
|
|
|
|
mask -= QRegion(tr - 3, 8, 4, 1);
|
|
|
|
mask -= TQRegion(tr - 3, 8, 4, 1);
|
|
|
|
|
|
|
|
|
|
|
|
// Remove area above button area
|
|
|
|
// Remove area above button area
|
|
|
|
mask -= QRegion(r - buttonWidth - barWidth, 0, buttonWidth + 6, 9);
|
|
|
|
mask -= TQRegion(r - buttonWidth - barWidth, 0, buttonWidth + 6, 9);
|
|
|
|
|
|
|
|
|
|
|
|
// Remove top area above blank bar and top-right corner.
|
|
|
|
// Remove top area above blank bar and top-right corner.
|
|
|
|
mask -= QRegion(r - barWidth + 6, 0, barWidth, 13);
|
|
|
|
mask -= TQRegion(r - barWidth + 6, 0, barWidth, 13);
|
|
|
|
|
|
|
|
|
|
|
|
mask -= QRegion(r - barWidth, 9, 6, 1);
|
|
|
|
mask -= TQRegion(r - barWidth, 9, 6, 1);
|
|
|
|
mask -= QRegion(r - barWidth + 2, 10, 4, 1);
|
|
|
|
mask -= TQRegion(r - barWidth + 2, 10, 4, 1);
|
|
|
|
mask -= QRegion(r - barWidth + 4, 11, 2, 1);
|
|
|
|
mask -= TQRegion(r - barWidth + 4, 11, 2, 1);
|
|
|
|
mask -= QRegion(r - 5, 13, 5, 1);
|
|
|
|
mask -= TQRegion(r - 5, 13, 5, 1);
|
|
|
|
mask -= QRegion(r - 3, 14, 3, 1);
|
|
|
|
mask -= TQRegion(r - 3, 14, 3, 1);
|
|
|
|
mask -= QRegion(r - 2, 15, 2, 1);
|
|
|
|
mask -= TQRegion(r - 2, 15, 2, 1);
|
|
|
|
mask -= QRegion(r - 1, 16, 1, 2);
|
|
|
|
mask -= TQRegion(r - 1, 16, 1, 2);
|
|
|
|
|
|
|
|
|
|
|
|
// Remove left side below grip bar
|
|
|
|
// Remove left side below grip bar
|
|
|
|
if (isShade())
|
|
|
|
if (isShade())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mask -= QRegion(0, 20, 1, 5);
|
|
|
|
mask -= TQRegion(0, 20, 1, 5);
|
|
|
|
mask -= QRegion(1, 22, 1, 3);
|
|
|
|
mask -= TQRegion(1, 22, 1, 3);
|
|
|
|
mask -= QRegion(2, 23, 1, 2);
|
|
|
|
mask -= TQRegion(2, 23, 1, 2);
|
|
|
|
mask -= QRegion(3, 24, 2, 1);
|
|
|
|
mask -= TQRegion(3, 24, 2, 1);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
mask -= QRegion(0, 29, 1, 2);
|
|
|
|
mask -= TQRegion(0, 29, 1, 2);
|
|
|
|
mask -= QRegion(0, 31, 2, 1);
|
|
|
|
mask -= TQRegion(0, 31, 2, 1);
|
|
|
|
mask -= QRegion(0, 32, 3, 1);
|
|
|
|
mask -= TQRegion(0, 32, 3, 1);
|
|
|
|
mask -= QRegion(0, 33, 5, 1);
|
|
|
|
mask -= TQRegion(0, 33, 5, 1);
|
|
|
|
mask -= QRegion(0, 34, 7, 1);
|
|
|
|
mask -= TQRegion(0, 34, 7, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
mask -= QRegion(0, 35, 9, b - 35);
|
|
|
|
mask -= TQRegion(0, 35, 9, b - 35);
|
|
|
|
|
|
|
|
|
|
|
|
// Remove bottom-left corner
|
|
|
|
// Remove bottom-left corner
|
|
|
|
//mask -= QRegion(0, b - 5, 10, 3);
|
|
|
|
//mask -= TQRegion(0, b - 5, 10, 3);
|
|
|
|
mask -= QRegion(0, b - 4, 10, 3);
|
|
|
|
mask -= TQRegion(0, b - 4, 10, 3);
|
|
|
|
mask -= QRegion(0, b - 3, 11, 1);
|
|
|
|
mask -= TQRegion(0, b - 3, 11, 1);
|
|
|
|
mask -= QRegion(0, b - 2, 12, 1);
|
|
|
|
mask -= TQRegion(0, b - 2, 12, 1);
|
|
|
|
mask -= QRegion(0, b - 1, 14, 1);
|
|
|
|
mask -= TQRegion(0, b - 1, 14, 1);
|
|
|
|
|
|
|
|
|
|
|
|
// Remove bottom-right corner.
|
|
|
|
// Remove bottom-right corner.
|
|
|
|
|
|
|
|
|
|
|
|
mask -= QRegion(w - 5, h - 1, 5, 1);
|
|
|
|
mask -= TQRegion(w - 5, h - 1, 5, 1);
|
|
|
|
mask -= QRegion(w - 3, h - 2, 3, 1);
|
|
|
|
mask -= TQRegion(w - 3, h - 2, 3, 1);
|
|
|
|
mask -= QRegion(w - 2, h - 3, 2, 1);
|
|
|
|
mask -= TQRegion(w - 2, h - 3, 2, 1);
|
|
|
|
mask -= QRegion(w - 1, h - 5, 1, 2);
|
|
|
|
mask -= TQRegion(w - 1, h - 5, 1, 2);
|
|
|
|
|
|
|
|
|
|
|
|
if (isResizable()) {
|
|
|
|
if (isResizable()) {
|
|
|
|
if (isShade()) { // We don't have a handle bar to worry about
|
|
|
|
if (isShade()) { // We don't have a handle bar to worry about
|
|
|
|
mask -= QRect(w - 2, 0, w - 1, h); // right side
|
|
|
|
mask -= TQRect(w - 2, 0, w - 1, h); // right side
|
|
|
|
mask -= QRect(0, h - 2, w, h - 1); // bottom
|
|
|
|
mask -= TQRect(0, h - 2, w, h - 1); // bottom
|
|
|
|
mask -= QRegion(r - 5, b - 1, 5, 1);
|
|
|
|
mask -= TQRegion(r - 5, b - 1, 5, 1);
|
|
|
|
mask -= QRegion(r - 3, b - 2, 3, 1);
|
|
|
|
mask -= TQRegion(r - 3, b - 2, 3, 1);
|
|
|
|
mask -= QRegion(r - 2, b - 3, 2, 1);
|
|
|
|
mask -= TQRegion(r - 2, b - 3, 2, 1);
|
|
|
|
mask -= QRegion(r - 1, b - 5, 1, 2);
|
|
|
|
mask -= TQRegion(r - 1, b - 5, 1, 2);
|
|
|
|
} else { // Leave area for handle bar
|
|
|
|
} else { // Leave area for handle bar
|
|
|
|
mask -= QRect(w - 2, 0, w - 1, h - 20); // right side
|
|
|
|
mask -= TQRect(w - 2, 0, w - 1, h - 20); // right side
|
|
|
|
mask -= QRect(0, h - 2, w - 20, h - 1); // bottom
|
|
|
|
mask -= TQRect(0, h - 2, w - 20, h - 1); // bottom
|
|
|
|
mask -= QRegion(w - 1, h - 20, 1, 2);
|
|
|
|
mask -= TQRegion(w - 1, h - 20, 1, 2);
|
|
|
|
mask -= QRegion(w - 20, h - 1, 2, 1);
|
|
|
|
mask -= TQRegion(w - 20, h - 1, 2, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
setMask(mask);
|
|
|
|
setMask(mask);
|
|
|
@ -1148,10 +1148,10 @@ void FahrenheitClient::doShape()
|
|
|
|
// -------------
|
|
|
|
// -------------
|
|
|
|
// Window is being resized
|
|
|
|
// Window is being resized
|
|
|
|
|
|
|
|
|
|
|
|
void FahrenheitClient::resizeEvent(QResizeEvent *)
|
|
|
|
void FahrenheitClient::resizeEvent(TQResizeEvent *)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (widget()->isShown()) {
|
|
|
|
if (widget()->isShown()) {
|
|
|
|
QRegion region = widget()->rect();
|
|
|
|
TQRegion region = widget()->rect();
|
|
|
|
region = region.subtract(titleSpacer_->geometry());
|
|
|
|
region = region.subtract(titleSpacer_->geometry());
|
|
|
|
doShape();
|
|
|
|
doShape();
|
|
|
|
widget()->erase(region);
|
|
|
|
widget()->erase(region);
|
|
|
@ -1163,7 +1163,7 @@ void FahrenheitClient::resizeEvent(QResizeEvent *)
|
|
|
|
// -----------
|
|
|
|
// -----------
|
|
|
|
// Window is being shown
|
|
|
|
// Window is being shown
|
|
|
|
|
|
|
|
|
|
|
|
void FahrenheitClient::showEvent(QShowEvent *)
|
|
|
|
void FahrenheitClient::showEvent(TQShowEvent *)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
doShape();
|
|
|
|
doShape();
|
|
|
|
widget()->repaint();
|
|
|
|
widget()->repaint();
|
|
|
@ -1199,7 +1199,7 @@ void FahrenheitClient::maxButtonPressed()
|
|
|
|
void FahrenheitClient::menuButtonPressed()
|
|
|
|
void FahrenheitClient::menuButtonPressed()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (button[ButtonMenu]) {
|
|
|
|
if (button[ButtonMenu]) {
|
|
|
|
QPoint p(button[ButtonMenu]->rect().bottomLeft().x(),
|
|
|
|
TQPoint p(button[ButtonMenu]->rect().bottomLeft().x(),
|
|
|
|
button[ButtonMenu]->rect().bottomLeft().y());
|
|
|
|
button[ButtonMenu]->rect().bottomLeft().y());
|
|
|
|
KDecorationFactory* f = factory();
|
|
|
|
KDecorationFactory* f = factory();
|
|
|
|
showWindowMenu(button[ButtonMenu]->mapToGlobal(p));
|
|
|
|
showWindowMenu(button[ButtonMenu]->mapToGlobal(p));
|
|
|
|