Skip to content

Commit

Permalink
Better text aligning
Browse files Browse the repository at this point in the history
  • Loading branch information
SeriousAlexej committed Mar 12, 2018
1 parent 14ae0b4 commit 1d9304e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/TabToolbar/CompactToolButton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ CompactToolButton::CompactToolButton(QAction* action, QMenu* menu, QWidget* pare
upButton->setIconSize(QSize(iconSize, iconSize));
upButton->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum);
upButton->setStyle(new TTToolButtonStyle());
upButton->setMaximumHeight(iconSize + 5);

QVBoxLayout* l = new QVBoxLayout(this);
l->setMargin(0);
Expand Down
2 changes: 1 addition & 1 deletion src/TabToolbar/ToolButtonStyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void TTToolButtonStyle::drawControl(ControlElement element, const QStyleOption*
proxy()->drawItemPixmap(p, QStyle::visualRect(opt->direction, rect, pr), Qt::AlignTop | Qt::AlignHCenter, pm);
alignment |= Qt::AlignTop | Qt::AlignHCenter;
}
tr.translate(shiftX, shiftY + 1);
tr.translate(shiftX, shiftY);
proxy()->drawItemText(p, QStyle::visualRect(opt->direction, rect, tr), alignment, toolbutton->palette,
toolbutton->state & State_Enabled, toolbutton->text,
QPalette::ButtonText);
Expand Down

0 comments on commit 1d9304e

Please sign in to comment.