mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
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:
parent
7fd83b7f02
commit
82c70b62a2
Binary file not shown.
Before Width: | Height: | Size: 736 B After Width: | Height: | Size: 406 B |
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user