Skip to content

Commit

Permalink
feat: fixed the width of the DTabBar add button to 48
Browse files Browse the repository at this point in the history
Change-Id: I0278d6d1b2bfc14a51ef5020d1acd7cd0094d234
  • Loading branch information
zccrs committed Feb 6, 2018
1 parent 9aaa158 commit ec32258
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/widgets/dtabbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ class DTabBarPrivate : public QTabBar, public DObjectPrivate

addButton = new DTabBarAddButton(qq);
addButton->setObjectName("AddButton");
addButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
addButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
addButton->setFixedWidth(48);

connect(addButton, &DTabBarAddButton::clicked,
qq, &DTabBar::tabAddRequested);
Expand All @@ -134,11 +135,11 @@ class DTabBarPrivate : public QTabBar, public DObjectPrivate
leftScrollButton->setVisible(d->leftB->isVisible());
leftScrollButton->setAutoRepeat(true);
leftScrollButton->setArrowType(Qt::LeftArrow);
leftScrollButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
leftScrollButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
rightScrollButton->setVisible(d->rightB->isVisible());
rightScrollButton->setAutoRepeat(true);
rightScrollButton->setArrowType(Qt::RightArrow);
rightScrollButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
rightScrollButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);

d->leftB->setFixedSize(0, 0);
d->leftB->installEventFilter(this);
Expand Down

0 comments on commit ec32258

Please sign in to comment.