small facelift for close button on tabwidget

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20917 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Edwin Leuven 2007-10-11 19:00:18 +00:00
parent 7fd83b7f02
commit 82c70b62a2
2 changed files with 10 additions and 4 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 736 B

After

Width:  |  Height:  |  Size: 406 B

View File

@ -39,7 +39,8 @@
#include <QLayout>
#include <QMainWindow>
#include <QPainter>
#include <QPushButton>
#include <QToolButton>
#include <QPalette>
#include <QScrollBar>
#include <QTabBar>
#include <QTimer>
@ -697,16 +698,21 @@ QVariant GuiWorkArea::inputMethodQuery(Qt::InputMethodQuery query) const
////////////////////////////////////////////////////////////////////
TabWorkArea::TabWorkArea(QWidget * parent): QTabWidget(parent)
{
QPushButton * closeTabButton = new QPushButton(this);
QPalette pal = palette();
pal.setColor(QPalette::Active, QPalette::Button, pal.color(QPalette::Active, QPalette::Window));
pal.setColor(QPalette::Disabled, QPalette::Button, pal.color(QPalette::Disabled, QPalette::Window));
pal.setColor(QPalette::Inactive, QPalette::Button, pal.color(QPalette::Inactive, QPalette::Window));
QToolButton * closeTabButton = new QToolButton(this);
closeTabButton->setPalette(pal);
FileName const file = support::libFileSearch("images", "closetab", "png");
if (!file.empty()) {
QPixmap pm(toqstr(file.absFilename()));
closeTabButton->setIcon(QIcon(pm));
closeTabButton->setMaximumSize(pm.size());
closeTabButton->setFlat(true);
} else {
closeTabButton->setText("Close");
}
closeTabButton->setAutoRaise(true);
closeTabButton->setCursor(Qt::ArrowCursor);
closeTabButton->setToolTip(tr("Close tab"));
closeTabButton->setEnabled(true);