Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
isv:hp:education
kdelibs3
fix-kurllabel-regression.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File fix-kurllabel-regression.diff of Package kdelibs3
Index: kurllabel.cpp =================================================================== --- kdeui/kurllabel.cpp (revision 504495) +++ kdeui/kurllabel.cpp (working copy) @@ -405,6 +405,8 @@ QRect KURLLabel::activeRect() const { QRect r( contentsRect() ); + if (text().isEmpty() || (!d->MarginAltered && sizePolicy() == QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed))) + return r; //fixed size is sometimes used with pixmap int hAlign = QApplication::horizontalAlignment( alignment() ); int indentX = (hAlign && indent()>0) ? indent() : 0; QFontMetrics fm(font()); @@ -422,18 +424,26 @@ void KURLLabel::setMargin( int margin ) { - QLabel::setMargin(margin); - d->MarginAltered = true; + QLabel::setMargin(margin); + d->MarginAltered = true; } void KURLLabel::setFocusPolicy( FocusPolicy policy ) { - QLabel::setFocusPolicy(policy); - if (!d->MarginAltered) { - QLabel::setMargin(policy == NoFocus ? 0 : 3); //better default : better look when focused - } + QLabel::setFocusPolicy(policy); + if (!d->MarginAltered) { + QLabel::setMargin(policy == NoFocus ? 0 : 3); //better default : better look when focused + } } +void KURLLabel::setSizePolicy ( QSizePolicy policy ) +{ + QLabel::setSizePolicy(policy); + if (!d->MarginAltered && policy.horData()==QSizePolicy::Fixed && policy.verData()==QSizePolicy::Fixed) { + QLabel::setMargin(0); //better default : better look when fixed size + } +} + void KURLLabel::virtual_hook( int, void* ) { /*BASE::virtual_hook( id, data );*/ } Index: kurllabel.h =================================================================== --- kdeui/kurllabel.h (revision 504494) +++ kdeui/kurllabel.h (working copy) @@ -163,6 +163,11 @@ */ virtual void setFocusPolicy ( FocusPolicy policy ); + /** + * Reimplemented for internal reasons, the API is not affected. + */ + virtual void setSizePolicy ( QSizePolicy ); + public slots: /** * Turns on or off the underlining.
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor