summaryrefslogtreecommitdiffstats
path: root/src/linklabel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/linklabel.cpp')
-rw-r--r--src/linklabel.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/linklabel.cpp b/src/linklabel.cpp
index c2060f7..fa67c54 100644
--- a/src/linklabel.cpp
+++ b/src/linklabel.cpp
@@ -269,19 +269,19 @@ void LinkLabel::setAlign(int hAlign, int vAlign)
m_layout->remove(m_title);
m_layout->removeItem(m_spacer2);
- // Otherwise, tqminimumSize will be incoherent (last size ? )
+ // Otherwise, minimumSize will be incoherent (last size ? )
m_layout->setResizeMode(TQLayout::Minimum);
// And re-populate the widget with the appropriates things and order
bool addSpacers = hAlign == 1;
m_layout->setDirection(TQBoxLayout::LeftToRight);
- //m_title->tqsetSizePolicy( TQSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Maximum/*Expanding*/, 0, 0, false) );
- m_icon->tqsetSizePolicy( TQSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Preferred/*Expanding*/, 0, 0, false) );
+ //m_title->setSizePolicy( TQSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Maximum/*Expanding*/, 0, 0, false) );
+ m_icon->setSizePolicy( TQSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Preferred/*Expanding*/, 0, 0, false) );
m_spacer1->changeSize( 0, 0, TQSizePolicy::Expanding, TQSizePolicy::Preferred/*Expanding*/ );
m_spacer2->changeSize( 0, 0, TQSizePolicy::Expanding, TQSizePolicy::Preferred/*Expanding*/ );
- m_icon->tqsetAlignment( hFlag | vFlag );
- m_title->tqsetAlignment( hFlag | vFlag | wBreak );
+ m_icon->setAlignment( hFlag | vFlag );
+ m_title->setAlignment( hFlag | vFlag | wBreak );
if ( addSpacers && (vAlign != 0) ||
(m_title->text().isEmpty() && hAlign == 2) )
m_layout->addItem(m_spacer1);
@@ -392,7 +392,7 @@ void LinkDisplay::setLink(const TQString &title, const TQString &icon, const TQP
m_font = font;
// "Constants":
- int BUTTON_MARGIN = kapp->tqstyle().tqpixelMetric(TQStyle::PM_ButtonMargin);
+ int BUTTON_MARGIN = kapp->tqstyle().pixelMetric(TQStyle::PM_ButtonMargin);
int LINK_MARGIN = BUTTON_MARGIN + 2;
// Recompute m_minWidth:
@@ -422,15 +422,15 @@ void LinkDisplay::setWidth(int width)
/** Paint on @p painter
* in (@p x, @p y, @p width, @p height)
- * using @p tqcolorGroup for the button drawing (if @p isHovered)
+ * using @p colorGroup for the button drawing (if @p isHovered)
* and the LinkLook color() for the text,
- * unless [the LinkLook !color.isValid() and it does not useLinkColor()] or [@p isDefaultColor is false]: in this case it will use @p tqcolorGroup.text().
+ * unless [the LinkLook !color.isValid() and it does not useLinkColor()] or [@p isDefaultColor is false]: in this case it will use @p colorGroup.text().
* It will draw the button if @p isIconButtonHovered.
*/
-void LinkDisplay::paint(TQPainter *painter, int x, int y, int width, int height, const TQColorGroup &tqcolorGroup,
+void LinkDisplay::paint(TQPainter *painter, int x, int y, int width, int height, const TQColorGroup &colorGroup,
bool isDefaultColor, bool isSelected, bool isHovered, bool isIconButtonHovered) const
{
- int BUTTON_MARGIN = kapp->tqstyle().tqpixelMetric(TQStyle::PM_ButtonMargin);
+ int BUTTON_MARGIN = kapp->tqstyle().pixelMetric(TQStyle::PM_ButtonMargin);
int LINK_MARGIN = BUTTON_MARGIN + 2;
TQPixmap pixmap;
@@ -450,7 +450,7 @@ void LinkDisplay::paint(TQPainter *painter, int x, int y, int width, int height,
// Draw the button (if any) and the icon:
if (isHovered)
kapp->tqstyle().tqdrawPrimitive(TQStyle::PE_ButtonCommand, painter, TQRect(-1, -1, iconPreviewWidth + 2*BUTTON_MARGIN, height + 2),
- tqcolorGroup, TQStyle::Style_Enabled | (isIconButtonHovered ? TQStyle::Style_MouseOver : 0));
+ colorGroup, TQStyle::Style_Enabled | (isIconButtonHovered ? TQStyle::Style_MouseOver : 0));
painter->drawPixmap(x + BUTTON_MARGIN - 1 + pixmapX, y + pixmapY, pixmap);
// Figure out the text color:
@@ -459,7 +459,7 @@ void LinkDisplay::paint(TQPainter *painter, int x, int y, int width, int height,
else if (isIconButtonHovered)
painter->setPen(m_look->effectiveHoverColor());
else if (!isDefaultColor || (!m_look->color().isValid() && !m_look->useLinkColor())) // If the color is FORCED or if the link color default to the text color:
- painter->setPen(tqcolorGroup.text());
+ painter->setPen(colorGroup.text());
else
painter->setPen(m_look->effectiveColor());
// Draw the text:
@@ -468,14 +468,14 @@ void LinkDisplay::paint(TQPainter *painter, int x, int y, int width, int height,
TQt::AlignAuto | TQt::AlignVCenter | TQt::WordBreak, m_title);
}
-TQPixmap LinkDisplay::feedbackPixmap(int width, int height, const TQColorGroup &tqcolorGroup, bool isDefaultColor)
+TQPixmap LinkDisplay::feedbackPixmap(int width, int height, const TQColorGroup &colorGroup, bool isDefaultColor)
{
int theWidth = TQMIN(width, maxWidth());
int theHeight = TQMIN(height, heightForWidth(theWidth));
TQPixmap pixmap(theWidth, theHeight);
- pixmap.fill(tqcolorGroup.background());
+ pixmap.fill(colorGroup.background());
TQPainter painter(&pixmap);
- paint(&painter, 0, 0, theWidth, theHeight, tqcolorGroup, isDefaultColor,
+ paint(&painter, 0, 0, theWidth, theHeight, colorGroup, isDefaultColor,
/*isSelected=*/false, /*isHovered=*/false, /*isIconButtonHovered=*/false);
painter.end();
return pixmap;
@@ -483,7 +483,7 @@ TQPixmap LinkDisplay::feedbackPixmap(int width, int height, const TQColorGroup &
bool LinkDisplay::iconButtonAt(const TQPoint &pos) const
{
- int BUTTON_MARGIN = kapp->tqstyle().tqpixelMetric(TQStyle::PM_ButtonMargin);
+ int BUTTON_MARGIN = kapp->tqstyle().pixelMetric(TQStyle::PM_ButtonMargin);
// int LINK_MARGIN = BUTTON_MARGIN + 2;
int iconPreviewWidth = TQMAX(m_look->iconSize(), (m_look->previewEnabled() ? m_preview.width() : 0));
@@ -492,7 +492,7 @@ bool LinkDisplay::iconButtonAt(const TQPoint &pos) const
TQRect LinkDisplay::iconButtonRect() const
{
- int BUTTON_MARGIN = kapp->tqstyle().tqpixelMetric(TQStyle::PM_ButtonMargin);
+ int BUTTON_MARGIN = kapp->tqstyle().pixelMetric(TQStyle::PM_ButtonMargin);
// int LINK_MARGIN = BUTTON_MARGIN + 2;
int iconPreviewWidth = TQMAX(m_look->iconSize(), (m_look->previewEnabled() ? m_preview.width() : 0));
@@ -517,7 +517,7 @@ TQFont LinkDisplay::labelFont(TQFont font, bool isIconButtonHovered) const
int LinkDisplay::heightForWidth(int width) const
{
- int BUTTON_MARGIN = kapp->tqstyle().tqpixelMetric(TQStyle::PM_ButtonMargin);
+ int BUTTON_MARGIN = kapp->tqstyle().pixelMetric(TQStyle::PM_ButtonMargin);
int LINK_MARGIN = BUTTON_MARGIN + 2;
int iconPreviewWidth = TQMAX(m_look->iconSize(), (m_look->previewEnabled() ? m_preview.width() : 0));
int iconPreviewHeight = TQMAX(m_look->iconSize(), (m_look->previewEnabled() ? m_preview.height() : 0));
@@ -623,7 +623,7 @@ LinkLookEditWidget::LinkLookEditWidget(KCModule *module, const TQString exTitle,
TQGroupBox *gb = new TQHGroupBox(i18n("Example"), this);
m_exLook = new LinkLook;
m_example = new LinkLabel(exTitle, exIcon, m_exLook, 1, 1, gb);
- m_example->tqsetSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Expanding);
+ m_example->setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Expanding);
m_example->setCursor(TQCursor(TQt::PointingHandCursor));
tqlayout->addWidget(gb);
m_exTitle = exTitle;