Automated update from Qt3

pull/1/head
Timothy Pearson 12 years ago
parent ff2caed1b8
commit 0e044c1a92

@ -63,26 +63,26 @@ class TQStyleOption {
public:
enum StyleOptionDefault { Default };
TQStyleOption(StyleOptionDefault=Default) : def(TRUE), tb(NULL), cli(NULL) {}
TQStyleOption(StyleOptionDefault=Default) : def(TRUE), tb(NULL), cli(NULL), tbh(NULL) {}
// Note: we don't use default arguments since that is unnecessary
// initialization.
TQStyleOption(int in1) :
def(FALSE), tb(NULL), i1(in1), cli(NULL) {}
def(FALSE), tb(NULL), i1(in1), cli(NULL), tbh(NULL) {}
TQStyleOption(int in1, int in2) :
def(FALSE), tb(NULL), i1(in1), i2(in2), cli(NULL) {}
def(FALSE), tb(NULL), i1(in1), i2(in2), cli(NULL), tbh(NULL) {}
TQStyleOption(int in1, int in2, int in3, int in4) :
def(FALSE), tb(NULL), i1(in1), i2(in2), i3(in3), i4(in4), cli(NULL) {}
TQStyleOption(TQMenuItem* m) : def(FALSE), mi(m), tb(NULL), cli(NULL) {}
TQStyleOption(TQMenuItem* m, int in1) : def(FALSE), mi(m), tb(NULL), i1(in1), cli(NULL) {}
TQStyleOption(TQMenuItem* m, int in1, int in2) : def(FALSE), mi(m), tb(NULL), i1(in1), i2(in2), cli(NULL) {}
TQStyleOption(const TQColor& c) : def(FALSE), tb(NULL), cl(&c), cli(NULL) {}
TQStyleOption(TQTab* t) : def(FALSE), tb(t), cli(NULL) {}
TQStyleOption(TQListViewItem* i) : def(FALSE), tb(NULL), li(i), cli(NULL) {}
TQStyleOption(TQCheckListItem* i) : def(FALSE), tb(NULL), cli(i) {}
TQStyleOption(TQt::ArrowType a) : def(FALSE), tb(NULL), i1((int)a), cli(NULL) {}
TQStyleOption(const TQRect& r) : def(FALSE), tb(NULL), i1(r.x()), i2(r.y()), i3(r.width()), i4(r.height()), cli(NULL) {}
TQStyleOption(TQWidget *w) : def(FALSE), tb(NULL), cli(NULL), p1((void*)w) {}
def(FALSE), tb(NULL), i1(in1), i2(in2), i3(in3), i4(in4), cli(NULL), tbh(NULL) {}
TQStyleOption(TQMenuItem* m) : def(FALSE), mi(m), tb(NULL), cli(NULL), tbh(NULL) {}
TQStyleOption(TQMenuItem* m, int in1) : def(FALSE), mi(m), tb(NULL), i1(in1), cli(NULL), tbh(NULL) {}
TQStyleOption(TQMenuItem* m, int in1, int in2) : def(FALSE), mi(m), tb(NULL), i1(in1), i2(in2), cli(NULL), tbh(NULL) {}
TQStyleOption(const TQColor& c) : def(FALSE), tb(NULL), cl(&c), cli(NULL), tbh(NULL) {}
TQStyleOption(TQTab* t) : def(FALSE), tb(t), cli(NULL), tbh(NULL) {}
TQStyleOption(TQListViewItem* i) : def(FALSE), tb(NULL), li(i), cli(NULL), tbh(NULL) {}
TQStyleOption(TQCheckListItem* i) : def(FALSE), tb(NULL), cli(i), tbh(NULL) {}
TQStyleOption(TQt::ArrowType a) : def(FALSE), tb(NULL), i1((int)a), cli(NULL), tbh(NULL) {}
TQStyleOption(const TQRect& r) : def(FALSE), tb(NULL), i1(r.x()), i2(r.y()), i3(r.width()), i4(r.height()), cli(NULL), tbh(NULL) {}
TQStyleOption(TQWidget *w) : def(FALSE), tb(NULL), cli(NULL), p1((void*)w), tbh(NULL) {}
bool isDefault() const { return def; }
@ -109,6 +109,9 @@ public:
TQRect rect() const { return TQRect( i1, i2, i3, i4 ); }
TQWidget* widget() const { return (TQWidget*)p1; }
TQStyleOption(TQTab* t, TQTab* h) : def(FALSE), tb(t), cli(NULL), tbh(h) {}
TQTab* hoverTab() const { return tbh; }
private:
// NOTE: none of these components have constructors.
bool def;
@ -121,6 +124,7 @@ private:
int i5, i6; // reserved
TQCheckListItem* cli;
void *p1, *p2, *p3, *p4; // reserved
TQTab* tbh;
// (padded to 64 bytes on some architectures)
};
@ -200,7 +204,7 @@ class TQStyleControlElementGenericWidgetData {
TQFont font;
};
class TQStyleControlElementData {
class Q_EXPORT TQStyleControlElementData {
public:
TQStringList widgetObjectTypes;
bool allDataPopulated;
@ -315,6 +319,7 @@ public:
CEF_IsActiveWindow = 0x00200000,
CEF_IsTopLevel = 0x00400000,
CEF_IsVisible = 0x00800000,
CEF_HasMouse = 0x01000000
};
// New TQStyle API - most of these should probably be pure virtual

@ -2557,6 +2557,21 @@ bool TQApplication::event( TQEvent *e )
return TQObject::event(e);
}
#define HOVER_SENSITIVE_WIDGET_SELECT if ( widget->inherits("TQPushButton") \
|| widget->inherits("TQComboBox") \
|| widget->inherits("TQSpinWidget") \
|| widget->inherits("TQCheckBox") \
|| widget->inherits("TQRadioButton") \
|| widget->inherits("TQToolButton") \
|| widget->inherits("TQSlider") \
|| widget->inherits("TQScrollBar") \
|| widget->inherits("TQTabBar") \
|| widget->inherits("TQDockWindowHandle") \
|| widget->inherits("TQSplitterHandle") )
#define FOCUS_SENSITIVE_WIDGET_SELECT if ( widget->inherits("TQLineEdit") )
#define FOCUS_SENSITIVE_PARENT_WIDGET_SELECT if ( widget->parentWidget() && widget->parentWidget()->inherits("TQSpinWidget") )
/*!\internal
Helper function called by notify()
@ -2579,10 +2594,28 @@ bool TQApplication::internalNotify( TQObject *receiver, TQEvent * e)
TQWidget *widget = (TQWidget*)receiver;
// toggle HasMouse widget state on enter and leave
if ( e->type() == TQEvent::Enter || e->type() == TQEvent::DragEnter )
if ( e->type() == TQEvent::Enter || e->type() == TQEvent::DragEnter ) {
widget->setWState( WState_HasMouse );
else if ( e->type() == TQEvent::Leave || e->type() == TQEvent::DragLeave )
HOVER_SENSITIVE_WIDGET_SELECT {
widget->repaint(false);
}
}
else if ( e->type() == TQEvent::Leave || e->type() == TQEvent::DragLeave ) {
widget->clearWState( WState_HasMouse );
HOVER_SENSITIVE_WIDGET_SELECT {
widget->repaint(false);
}
}
// repaint information entry widgets on focus set/unset
if ( e->type() == TQEvent::FocusIn || e->type() == TQEvent::FocusOut ) {
FOCUS_SENSITIVE_WIDGET_SELECT {
widget->repaint(false);
}
FOCUS_SENSITIVE_PARENT_WIDGET_SELECT {
widget->parentWidget()->repaint(false);
}
}
// throw away any mouse-tracking-only mouse events
if ( e->type() == TQEvent::MouseMove &&

@ -226,6 +226,7 @@ TQStyle::ControlElementFlags getControlElementFlagsForObject(const TQObject* obj
if (widget->parentWidget()) cef = cef | TQStyle::CEF_HasParentWidget;
if (widget->focusProxy()) cef = cef | TQStyle::CEF_HasFocusProxy;
if (widget->hasFocus()) cef = cef | TQStyle::CEF_HasFocus;
if (widget->hasMouse()) cef = cef | TQStyle::CEF_HasMouse;
if (populateReliantFields) {
if (widget->isActiveWindow()) cef = cef | TQStyle::CEF_IsActiveWindow;
if (widget->isTopLevel()) cef = cef | TQStyle::CEF_IsTopLevel;

@ -65,13 +65,10 @@
struct TQMotifPlusStylePrivate
{
TQMotifPlusStylePrivate()
: hoverWidget(0), hovering(FALSE), sliderActive(FALSE), mousePressed(FALSE),
: hovering(FALSE), sliderActive(FALSE), mousePressed(FALSE),
scrollbarElement(0), lastElement(0), ref(1)
{ ; }
void* hoverWidget;
TQStyleControlElementData hoverWidgetData;
TQStyle::ControlElementFlags hoverWidgetFlags;
bool hovering, sliderActive, mousePressed;
int scrollbarElement, lastElement, ref;
TQPoint mousePos;
@ -660,9 +657,6 @@ void TQMotifPlusStyle::drawControl( ControlElement element,
const TQStyleOption& opt,
const TQWidget *widget) const
{
if (widget == singleton->hoverWidget)
flags |= Style_MouseOver;
switch (element) {
case CE_PushButton:
{
@ -1108,9 +1102,6 @@ void TQMotifPlusStyle::drawComplexControl(ComplexControl control,
const TQStyleOption& opt,
const TQWidget *widget ) const
{
if (widget == singleton->hoverWidget)
flags |= Style_MouseOver;
switch (control) {
case CC_ScrollBar:
{
@ -1516,30 +1507,22 @@ bool TQMotifPlusStyle::objectEventHandler( TQStyleControlElementData ceData, Con
if (!ceData.widgetObjectTypes.contains("TQWidget"))
break;
singleton->hoverWidget = source;
singleton->hoverWidgetData = ceData;
singleton->hoverWidgetFlags = elementFlags;
if (!(singleton->hoverWidgetFlags & CEF_IsEnabled)) {
singleton->hoverWidget = 0;
break;
}
widgetActionRequest(singleton->hoverWidgetData, singleton->hoverWidgetFlags, singleton->hoverWidget, WAR_Repaint);
widgetActionRequest(ceData, elementFlags, source, WAR_Repaint);
break;
}
case TQEvent::Leave:
{
if (source != singleton->hoverWidget)
if (!ceData.widgetObjectTypes.contains("TQWidget"))
break;
void *w = singleton->hoverWidget;
singleton->hoverWidget = 0;
widgetActionRequest(singleton->hoverWidgetData, singleton->hoverWidgetFlags, w, WAR_Repaint);
widgetActionRequest(ceData, elementFlags, source, WAR_Repaint);
break;
}
case TQEvent::MouseMove:
{
if ((!ceData.widgetObjectTypes.contains("TQWidget")) || source != singleton->hoverWidget)
if ((!ceData.widgetObjectTypes.contains("TQWidget")))
break;
if ((!ceData.widgetObjectTypes.contains("TQScrollBar")) && (!ceData.widgetObjectTypes.contains("TQSlider")))
@ -1548,7 +1531,7 @@ bool TQMotifPlusStyle::objectEventHandler( TQStyleControlElementData ceData, Con
singleton->mousePos = ((TQMouseEvent *) event)->pos();
if (! singleton->mousePressed) {
singleton->hovering = TRUE;
widgetActionRequest(singleton->hoverWidgetData, singleton->hoverWidgetFlags, singleton->hoverWidget, WAR_Repaint);
widgetActionRequest(ceData, elementFlags, source, WAR_Repaint);
singleton->hovering = FALSE;
}

@ -178,6 +178,16 @@ private: // Disabled copy constructor and operator=
TQTabBar( const TQTabBar & );
TQTabBar& operator=( const TQTabBar & );
#endif
protected:
void enterEvent ( TQEvent * );
void leaveEvent ( TQEvent * );
private:
TQTab *hoverTab;
public:
TQTab *mouseHoverTab() const;
};

@ -1244,6 +1244,8 @@ void TQComboBox::paintEvent( TQPaintEvent * )
flags |= TQStyle::Style_Enabled;
if (hasFocus())
flags |= TQStyle::Style_HasFocus;
if (hasMouse())
flags |= TQStyle::Style_MouseOver;
if ( width() < 5 || height() < 5 ) {
qDrawShadePanel( &p, rect(), g, FALSE, 2,

@ -390,6 +390,8 @@ void TQProgressBar::drawContents( TQPainter *p )
flags |= TQStyle::Style_Enabled;
if (hasFocus())
flags |= TQStyle::Style_HasFocus;
if (hasMouse())
flags |= TQStyle::Style_MouseOver;
style().drawControl(TQStyle::CE_ProgressBarGroove, buffer.painter(), this,
TQStyle::visualRect(style().subRect(TQStyle::SR_ProgressBarGroove, this), this ),

@ -555,6 +555,8 @@ void TQPushButton::drawButton( TQPainter *paint )
flags |= TQStyle::Style_Raised;
if (isDefault())
flags |= TQStyle::Style_ButtonDefault;
if (hasMouse())
flags |= TQStyle::Style_MouseOver;
style().drawControl(TQStyle::CE_PushButton, paint, this, rect(), colorGroup(), flags);
drawButtonLabel( paint );

@ -940,6 +940,8 @@ void TQScrollBar::drawControls( uint controls, uint activeControl,
flags |= TQStyle::Style_Enabled;
if (hasFocus())
flags |= TQStyle::Style_HasFocus;
if (hasMouse())
flags |= TQStyle::Style_MouseOver;
if ( orientation() == Horizontal )
flags |= TQStyle::Style_Horizontal;

@ -415,10 +415,13 @@ void TQSlider::paintEvent( TQPaintEvent * )
flags |= TQStyle::Style_Enabled;
if (hasFocus())
flags |= TQStyle::Style_HasFocus;
if (hasMouse())
flags |= TQStyle::Style_MouseOver;
TQStyle::SCFlags sub = TQStyle::SC_SliderGroove | TQStyle::SC_SliderHandle;
if ( tickmarks() != NoMarks )
if ( tickmarks() != NoMarks ) {
sub |= TQStyle::SC_SliderTickmarks;
}
style().drawComplexControl( TQStyle::CC_Slider, &p, this, rect(), colorGroup(),
flags, sub, state == Dragging ? TQStyle::SC_SliderHandle : TQStyle::SC_None );

@ -323,6 +323,8 @@ void TQSpinWidget::paintEvent( TQPaintEvent * )
TQStyle::SFlags flags = TQStyle::Style_Default;
if (isEnabled())
flags |= TQStyle::Style_Enabled;
if (hasMouse())
flags |= TQStyle::Style_MouseOver;
if (hasFocus() || (focusProxy() && focusProxy()->hasFocus()))
flags |= TQStyle::Style_HasFocus;

@ -141,11 +141,15 @@ void TQSplitterHandle::mouseReleaseEvent( TQMouseEvent *e )
void TQSplitterHandle::paintEvent( TQPaintEvent * )
{
TQStyle::SFlags flags = (orientation() == Horizontal ? TQStyle::Style_Horizontal : 0);
if (hasMouse()) {
flags |= TQStyle::Style_MouseOver;
}
TQPainter p( this );
parentWidget()->style().drawPrimitive( TQStyle::PE_Splitter, &p, rect(),
colorGroup(),
(orientation() == Horizontal ?
TQStyle::Style_Horizontal : 0) );
flags );
}
TQCOORD TQSplitterLayoutStruct::getSizer( Orientation orient )

@ -335,7 +335,7 @@ private:
*/
TQTabBar::TQTabBar( TQWidget * parent, const char *name )
: TQWidget( parent, name, WNoAutoErase | WNoMousePropagation ), l(NULL)
: TQWidget( parent, name, WNoAutoErase | WNoMousePropagation ), l(NULL), hoverTab( 0 )
{
d = new TQTabPrivate;
d->pressed = 0;
@ -581,45 +581,49 @@ TQSize TQTabBar::minimumSizeHint() const
void TQTabBar::paint( TQPainter * p, TQTab * t, bool selected ) const
{
TQStyle::SFlags flags = TQStyle::Style_Default;
if (isEnabled() && t->isEnabled())
flags |= TQStyle::Style_Enabled;
if (topLevelWidget() == tqApp->activeWindow())
flags |= TQStyle::Style_Active;
if ( selected )
flags |= TQStyle::Style_Selected;
else if(t == d->pressed)
flags |= TQStyle::Style_Sunken;
//selection flags
if(t->rect().contains(mapFromGlobal(TQCursor::pos())))
flags |= TQStyle::Style_MouseOver;
style().drawControl( TQStyle::CE_TabBarTab, p, this, t->rect(),
colorGroup(), flags, TQStyleOption(t) );
TQRect r( t->r );
p->setFont( font() );
int iw = 0;
int ih = 0;
if ( t->iconset != 0 ) {
iw = t->iconset->pixmap( TQIconSet::Small, TQIconSet::Normal ).width() + 4;
ih = t->iconset->pixmap( TQIconSet::Small, TQIconSet::Normal ).height();
}
TQFontMetrics fm = p->fontMetrics();
int fw = fm.width( t->label );
fw -= t->label.contains('&') * fm.width('&');
fw += t->label.contains("&&") * fm.width('&');
int w = iw + fw + 4;
int h = TQMAX(fm.height() + 4, ih );
int offset = 3;
TQStyle::SFlags flags = TQStyle::Style_Default;
if (isEnabled() && t->isEnabled()) {
flags |= TQStyle::Style_Enabled;
}
if (topLevelWidget() == tqApp->activeWindow()) {
flags |= TQStyle::Style_Active;
}
if ( selected ) {
flags |= TQStyle::Style_Selected;
}
else if (t == d->pressed) {
flags |= TQStyle::Style_Sunken;
}
//selection flags
if (t->rect().contains(mapFromGlobal(TQCursor::pos()))) {
flags |= TQStyle::Style_MouseOver;
}
style().drawControl( TQStyle::CE_TabBarTab, p, this, t->rect(), colorGroup(), flags, TQStyleOption(t, hoverTab) );
TQRect r( t->r );
p->setFont( font() );
int iw = 0;
int ih = 0;
if ( t->iconset != 0 ) {
iw = t->iconset->pixmap( TQIconSet::Small, TQIconSet::Normal ).width() + 4;
ih = t->iconset->pixmap( TQIconSet::Small, TQIconSet::Normal ).height();
}
TQFontMetrics fm = p->fontMetrics();
int fw = fm.width( t->label );
fw -= t->label.contains('&') * fm.width('&');
fw += t->label.contains("&&") * fm.width('&');
int w = iw + fw + 4;
int h = TQMAX(fm.height() + 4, ih );
int offset = 3;
#ifdef Q_WS_MAC
if (::tqt_cast<TQMacStyle *>(&style()))
offset = 0;
if (::tqt_cast<TQMacStyle *>(&style())) {
offset = 0;
}
#endif
paintLabel( p, TQRect( r.left() + (r.width()-w)/2 - offset,
r.top() + (r.height()-h)/2,
w, h ), t, t->id == keyboardFocusTab() );
paintLabel( p, TQRect( r.left() + (r.width()-w)/2 - offset, r.top() + (r.height()-h)/2, w, h ), t, t->id == keyboardFocusTab() );
}
/*!
@ -630,43 +634,48 @@ void TQTabBar::paint( TQPainter * p, TQTab * t, bool selected ) const
void TQTabBar::paintLabel( TQPainter* p, const TQRect& br,
TQTab* t, bool has_focus ) const
{
TQRect r = br;
bool selected = currentTab() == t->id;
if ( t->iconset) {
// the tab has an iconset, draw it in the right mode
TQIconSet::Mode mode = (t->enabled && isEnabled())
? TQIconSet::Normal : TQIconSet::Disabled;
if ( mode == TQIconSet::Normal && has_focus )
mode = TQIconSet::Active;
TQPixmap pixmap = t->iconset->pixmap( TQIconSet::Small, mode );
int pixw = pixmap.width();
int pixh = pixmap.height();
r.setLeft( r.left() + pixw + 4 );
r.setRight( r.right() + 2 );
int xoff = 0, yoff = 0;
if(!selected) {
xoff = style().pixelMetric(TQStyle::PM_TabBarTabShiftHorizontal, this);
yoff = style().pixelMetric(TQStyle::PM_TabBarTabShiftVertical, this);
TQRect r = br;
bool selected = currentTab() == t->id;
if ( t->iconset) {
// the tab has an iconset, draw it in the right mode
TQIconSet::Mode mode = (t->enabled && isEnabled())
? TQIconSet::Normal : TQIconSet::Disabled;
if ( mode == TQIconSet::Normal && has_focus )
mode = TQIconSet::Active;
TQPixmap pixmap = t->iconset->pixmap( TQIconSet::Small, mode );
int pixw = pixmap.width();
int pixh = pixmap.height();
r.setLeft( r.left() + pixw + 4 );
r.setRight( r.right() + 2 );
int xoff = 0, yoff = 0;
if(!selected) {
xoff = style().pixelMetric(TQStyle::PM_TabBarTabShiftHorizontal, this);
yoff = style().pixelMetric(TQStyle::PM_TabBarTabShiftVertical, this);
}
p->drawPixmap( br.left() + 2 + xoff, br.center().y()-pixh/2 + yoff, pixmap );
}
p->drawPixmap( br.left() + 2 + xoff, br.center().y()-pixh/2 + yoff, pixmap );
}
TQStyle::SFlags flags = TQStyle::Style_Default;
if (isEnabled() && t->isEnabled())
flags |= TQStyle::Style_Enabled;
if (has_focus)
flags |= TQStyle::Style_HasFocus;
if ( selected )
flags |= TQStyle::Style_Selected;
else if(t == d->pressed)
flags |= TQStyle::Style_Sunken;
if(t->rect().contains(mapFromGlobal(TQCursor::pos())))
flags |= TQStyle::Style_MouseOver;
style().drawControl( TQStyle::CE_TabBarLabel, p, this, r,
t->isEnabled() ? colorGroup(): palette().disabled(),
flags, TQStyleOption(t) );
TQStyle::SFlags flags = TQStyle::Style_Default;
if (isEnabled() && t->isEnabled()) {
flags |= TQStyle::Style_Enabled;
}
if (has_focus) {
flags |= TQStyle::Style_HasFocus;
}
if ( selected ) {
flags |= TQStyle::Style_Selected;
}
else if(t == d->pressed) {
flags |= TQStyle::Style_Sunken;
}
if(t->rect().contains(mapFromGlobal(TQCursor::pos()))) {
flags |= TQStyle::Style_MouseOver;
}
style().drawControl( TQStyle::CE_TabBarLabel, p, this, r,
t->isEnabled() ? colorGroup(): palette().disabled(),
flags, TQStyleOption(t, hoverTab) );
}
@ -689,8 +698,9 @@ void TQTabBar::paintEvent( TQPaintEvent * e )
t = l->first();
do {
TQTab * n = l->next();
if ( t && t->r.intersects( e->rect() ) )
if ( t && t->r.intersects( e->rect() ) ) {
paint( buffer.painter(), t, n == 0 );
}
t = n;
} while ( t != 0 );
@ -776,19 +786,38 @@ void TQTabBar::mousePressEvent( TQMouseEvent * e )
void TQTabBar::mouseMoveEvent ( TQMouseEvent *e )
{
if ( e->state() != LeftButton ) {
e->ignore();
return;
}
if(style().styleHint( TQStyle::SH_TabBar_SelectMouseType, this ) == TQEvent::MouseButtonRelease) {
TQTab *t = selectTab( e->pos() );
if(t != d->pressed) {
if(d->pressed)
repaint(d->pressed->rect(), FALSE);
if((d->pressed = t))
repaint(t->rect(), FALSE);
// Repaint hover indicator(s)
// Also, avoid unnecessary repaints which otherwise would occour on every MouseMove event causing high cpu load
bool forceRepaint = true;
if (hoverTab == t) {
forceRepaint = false;
}
hoverTab = t;
if (forceRepaint) {
repaint(false);
}
if ( e->state() != LeftButton ) {
e->ignore();
return;
}
if(style().styleHint( TQStyle::SH_TabBar_SelectMouseType, this ) == TQEvent::MouseButtonRelease) {
if(t != d->pressed) {
if (d->pressed) {
if (!forceRepaint) {
repaint(d->pressed->rect(), FALSE);
}
}
if ((d->pressed = t)) {
if (!forceRepaint) {
repaint(t->rect(), FALSE);
}
}
}
}
}
}
/*!
@ -797,16 +826,28 @@ void TQTabBar::mouseMoveEvent ( TQMouseEvent *e )
void TQTabBar::mouseReleaseEvent( TQMouseEvent *e )
{
if ( e->button() != LeftButton )
e->ignore();
if(d->pressed) {
TQTab *t = selectTab( e->pos() ) == d->pressed ? d->pressed : 0;
d->pressed = 0;
if(t && t->enabled && e->type() == style().styleHint( TQStyle::SH_TabBar_SelectMouseType, this ))
setCurrentTab( t );
}
if (e->button() != LeftButton) {
e->ignore();
}
if (d->pressed) {
TQTab *t = selectTab( e->pos() ) == d->pressed ? d->pressed : 0;
d->pressed = 0;
if(t && t->enabled && e->type() == style().styleHint( TQStyle::SH_TabBar_SelectMouseType, this )) {
setCurrentTab( t );
}
}
}
void TQTabBar::enterEvent( TQEvent * )
{
hoverTab = 0;
}
void TQTabBar::leaveEvent( TQEvent * )
{
hoverTab = 0;
}
/*!
\reimp
@ -1119,7 +1160,7 @@ void TQTabBar::layoutTabs()
h += vframe;
t->r = TQRect(TQPoint(x, 0), style().sizeFromContents(TQStyle::CT_TabBarTab, this,
TQSize( TQMAX( lw + hframe + iw, TQApplication::globalStrut().width() ), h ),
TQStyleOption(t) ));
TQStyleOption(t, hoverTab) ));
x += t->r.width() - overlap;
r = r.unite( t->r );
if ( reverse )
@ -1375,4 +1416,12 @@ void TQTabBar::fontChange( const TQFont & oldFont )
TQWidget::fontChange( oldFont );
}
/*!
Returns the tab currently under the mouse pointer, or NULL if no tab is under the cursor
*/
TQTab *TQTabBar::mouseHoverTab() const
{
return hoverTab;
}
#endif

@ -1123,7 +1123,7 @@ bool TQTextEdit::event( TQEvent *e )
{
if ( e->type() == TQEvent::AccelOverride && !isReadOnly() ) {
TQKeyEvent* ke = (TQKeyEvent*) e;
switch(ke->state()) {
switch((int)(ke->state())) {
case NoButton:
case Keypad:
case ShiftButton:

@ -484,6 +484,8 @@ void TQToolButton::drawButton( TQPainter * p )
flags |= TQStyle::Style_Down;
if (isOn())
flags |= TQStyle::Style_On;
if (hasMouse())
flags |= TQStyle::Style_MouseOver;
if (autoRaise()) {
flags |= TQStyle::Style_AutoRaise;
if (uses3D()) {

Loading…
Cancel
Save