]> git.lyx.org Git - features.git/commitdiff
Make command buffer icons same size as QLineEdit height
authorEnrico Forestieri <forenr@lyx.org>
Sun, 26 Jun 2016 14:58:18 +0000 (16:58 +0200)
committerEnrico Forestieri <forenr@lyx.org>
Sun, 26 Jun 2016 14:58:18 +0000 (16:58 +0200)
Part of bug #10125

src/frontends/qt4/GuiCommandBuffer.cpp

index b3f56c7444ccac06960cb36cfa322630df9378c6..4e442f630a9159bb6e9aa7cb83df84011227804d 100644 (file)
@@ -94,20 +94,26 @@ GuiCommandBuffer::GuiCommandBuffer(GuiView * view)
        QVBoxLayout * top = new QVBoxLayout(this);
        QHBoxLayout * layout = new QHBoxLayout(0);
 
+       edit_ = new GuiCommandEdit(this);
+       edit_->setMinimumSize(edit_->sizeHint());
+       edit_->setFocusPolicy(Qt::ClickFocus);
+
+       int height = max(24, 2 * (edit_->sizeHint().height() / 2));
+       QSize button_size = QSize(height, height);
+       QSize icon_size = button_size - QSize(4, 4);
+
        upPB = new QPushButton(qpup, "", this);
        upPB->setToolTip(qt_("List of previous commands"));
-       upPB->setMaximumSize(24, 24);
+       upPB->setMaximumSize(button_size);
+       upPB->setIconSize(icon_size);
        downPB = new QPushButton(qpdown, "", this);
        downPB->setToolTip(qt_("Next command"));
-       downPB->setMaximumSize(24, 24);
+       downPB->setMaximumSize(button_size);
+       downPB->setIconSize(icon_size);
        downPB->setEnabled(false);
        connect(downPB, SIGNAL(clicked()), this, SLOT(down()));
        connect(upPB, SIGNAL(pressed()), this, SLOT(listHistoryUp()));
 
-       edit_ = new GuiCommandEdit(this);
-       edit_->setMinimumSize(edit_->sizeHint());
-       edit_->setFocusPolicy(Qt::ClickFocus);
-
        connect(edit_, SIGNAL(returnPressed()), this, SLOT(dispatch()));
        connect(edit_, SIGNAL(tabPressed()), this, SLOT(complete()));
        connect(edit_, SIGNAL(upPressed()), this, SLOT(up()));