]> git.lyx.org Git - features.git/commitdiff
* make close tab button smaller
authorStefan Schimanski <sts@lyx.org>
Thu, 14 Jun 2007 17:57:07 +0000 (17:57 +0000)
committerStefan Schimanski <sts@lyx.org>
Thu, 14 Jun 2007 17:57:07 +0000 (17:57 +0000)
* remove spacing in the layout of the tab bar and the central widget

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18770 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiView.cpp

index 41254339581eb85fea142d74c549d7f7c50b5f42..a3073d4833c817b890f4f04e8d3a7ad9860ae663 100644 (file)
@@ -54,7 +54,7 @@
 #include <QDesktopWidget>
 #include <QVBoxLayout>
 #include <QHBoxLayout>
-#include <QToolButton>
+#include <QPushButton>
 
 
 #include <boost/bind.hpp>
@@ -81,7 +81,7 @@ class TabWidget : public QWidget
        QHBoxLayout* hlayout;
 public:
        QTabBar* tabbar;
-       QToolButton* closeTabButton;
+       QPushButton* closeTabButton;
 
        void hideTabsIfNecessary()
        {
@@ -96,24 +96,27 @@ public:
 
        TabWidget(QWidget* w, bool topTabBar)
        {
-               closeTabButton = new QToolButton(this);
+               closeTabButton = new QPushButton(this);
                FileName const file = support::libFileSearch("images", "closetab", "xpm");
                if (!file.empty()) {
                        QPixmap pm(toqstr(file.absFilename()));
                        closeTabButton->setIcon(QIcon(pm));
+                       closeTabButton->setMaximumSize(pm.size());
+                       closeTabButton->setFlat(true);
                } else {
                        closeTabButton->setText("Close");
                }
                closeTabButton->setCursor(Qt::ArrowCursor);
-               closeTabButton->setAutoRaise(true);
                closeTabButton->setToolTip(tr("Close tab"));
                closeTabButton->setEnabled(true);
 
                tabbar = new QTabBar;
+#if QT_VERSION >= 0x040200
+               tabbar->setUsesScrollButtons(true);
+#endif
                hlayout = new QHBoxLayout;
                QVBoxLayout* vlayout = new QVBoxLayout;
                hlayout->addWidget(tabbar);
-               hlayout->addStretch(1);
                hlayout->addWidget(closeTabButton);
                if (topTabBar) {
                        vlayout->addLayout(hlayout);
@@ -124,6 +127,7 @@ public:
                        vlayout->addLayout(hlayout);
                }
                vlayout->setMargin(0);
+               vlayout->setSpacing(0);
                hlayout->setMargin(0);
                setLayout(vlayout);
                hideTabsIfNecessary();