taskbar: fix text positioning when changing from icons only to text&icons

Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
pull/266/head
Mavridis Philippe 2 years ago committed by Michele Calgaro
parent 3f98571ee0
commit a70540e7ac
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -392,9 +392,13 @@ TQSizePolicy TaskContainer::sizePolicy() const
void TaskContainer::resizeEvent( TQResizeEvent * ) void TaskContainer::resizeEvent( TQResizeEvent * )
{ {
int iconSize = READ_MERGED_TASKBAR_SETTING(iconSize); recalculateIconRect();
}
void TaskContainer::recalculateIconRect()
{
iconSize = READ_MERGED_TASKBAR_SETTING(iconSize);
// calculate the icon rect
if(taskBar->showText()) if(taskBar->showText())
{ {
TQRect br( style().subRect( TQStyle::SR_PushButtonContents, this ) ); TQRect br( style().subRect( TQStyle::SR_PushButtonContents, this ) );
@ -599,7 +603,7 @@ void TaskContainer::drawButton(TQPainter *p)
(m_mouseOver && !halo && isEnabled() && (m_mouseOver && !halo && isEnabled() &&
READ_MERGED_TASKBAR_SETTING(showButtonOnHover)); READ_MERGED_TASKBAR_SETTING(showButtonOnHover));
TQFont font(TDEGlobalSettings::taskbarFont()); TQFont font(TDEGlobalSettings::taskbarFont());
int iconSize = READ_MERGED_TASKBAR_SETTING(iconSize); recalculateIconRect();
// draw sunken if we contain the active task // draw sunken if we contain the active task
bool active = false; bool active = false;
@ -628,7 +632,7 @@ void TaskContainer::drawButton(TQPainter *p)
font.setBold(active); font.setBold(active);
TQColorGroup colors = palette().active(); TQColorGroup colors = palette().active();
if (READ_MERGED_TASKBAR_SETTING(useCustomColors)) if (READ_MERGED_TASKBAR_SETTING(useCustomColors))
{ {
colors.setColor( TQColorGroup::Button, READ_MERGED_TASKBAR_SETTING(taskBackgroundColor)); colors.setColor( TQColorGroup::Button, READ_MERGED_TASKBAR_SETTING(taskBackgroundColor));
@ -636,7 +640,7 @@ void TaskContainer::drawButton(TQPainter *p)
colors.setColor( TQColorGroup::ButtonText, READ_MERGED_TASKBAR_SETTING(inactiveTaskTextColor) ); colors.setColor( TQColorGroup::ButtonText, READ_MERGED_TASKBAR_SETTING(inactiveTaskTextColor) );
colors.setColor( TQColorGroup::Text, READ_MERGED_TASKBAR_SETTING(inactiveTaskTextColor) ); colors.setColor( TQColorGroup::Text, READ_MERGED_TASKBAR_SETTING(inactiveTaskTextColor) );
} }
if (demandsAttention) if (demandsAttention)
{ {
if (!drawButton) if (!drawButton)

@ -118,6 +118,7 @@ protected:
void updateFilteredTaskList(); void updateFilteredTaskList();
void updateIconSize(); void updateIconSize();
void recalculateIconRect();
protected slots: protected slots:
void animationTimerFired(); void animationTimerFired();
@ -145,6 +146,7 @@ private:
PixmapList frames; PixmapList frames;
int attentionState; int attentionState;
TQRect iconRect; TQRect iconRect;
int iconSize;
TQPixmap animBg; TQPixmap animBg;
Task::List tasks; Task::List tasks;
Task::List m_filteredTasks; Task::List m_filteredTasks;

Loading…
Cancel
Save