]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiCommandBuffer.cpp
Use <cstdint> instead of <boost/cstdint.hpp>
[lyx.git] / src / frontends / qt4 / GuiCommandBuffer.cpp
index b3f56c7444ccac06960cb36cfa322630df9378c6..4d94d97738af0af4d8aac90d9487bdd6abf1686e 100644 (file)
@@ -79,7 +79,7 @@ protected:
        }
 };
 
-} // end of anon
+} // namespace
 
 
 GuiCommandBuffer::GuiCommandBuffer(GuiView * view)
@@ -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()));
@@ -122,11 +128,11 @@ GuiCommandBuffer::GuiCommandBuffer(GuiView * view)
        top->setMargin(0);
        setFocusProxy(edit_);
 
-       LastCommandsSection::LastCommands last_commands 
+       LastCommandsSection::LastCommands last_commands
                = theSession().lastCommands().getcommands();
-       LastCommandsSection::LastCommands::const_iterator it 
+       LastCommandsSection::LastCommands::const_iterator it
                = last_commands.begin();
-       LastCommandsSection::LastCommands::const_iterator end 
+       LastCommandsSection::LastCommands::const_iterator end
                = last_commands.end();
 
        upPB->setEnabled(it != end);
@@ -246,7 +252,7 @@ void GuiCommandBuffer::down()
                           && history_pos_ != history_.end() - 1);
        upPB->setEnabled(history_pos_ != history_.begin());
 }
-       
+
 
 void GuiCommandBuffer::hideParent()
 {
@@ -266,7 +272,7 @@ public:
        bool operator()(string const & s) const { return prefixIs(s, p); }
 };
 
-} // end of anon namespace
+} // namespace
 
 
 string const GuiCommandBuffer::historyUp()
@@ -289,12 +295,6 @@ string const GuiCommandBuffer::historyDown()
 }
 
 
-docstring const GuiCommandBuffer::getCurrentState() const
-{
-       return view_->currentBufferView()->cursor().currentState();
-}
-
-
 vector<string> const
 GuiCommandBuffer::completions(string const & prefix, string & new_prefix)
 {