mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-13 03:40:34 +00:00
* frontends/qt3/QtView.C: use QRect ctor, coding style
* frontends/qt4/lyx_gui.C: coding style * frontends/qt4/GuiView.C: use QRect ctor, coding style git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14183 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
0d3d439195
commit
0afff7f598
@ -58,7 +58,7 @@ int const statusbar_timer_value = 3000;
|
||||
|
||||
|
||||
QtView::QtView()
|
||||
: QMainWindow(), LyXView(), commandbuffer_(0), frontend_(*this)
|
||||
: QMainWindow(), LyXView(), commandbuffer_(0), frontend_(*this)
|
||||
{
|
||||
qApp->setMainWidget(this);
|
||||
|
||||
@ -157,36 +157,35 @@ bool QtView::hasFocus() const
|
||||
return qApp->activeWindow() == this;
|
||||
}
|
||||
|
||||
|
||||
void QtView::initFloatingGeometry(QRect const & g)
|
||||
{
|
||||
floatingGeometry_ = g;
|
||||
maxWidth = QApplication::desktop()->width() - 20;
|
||||
}
|
||||
|
||||
|
||||
void QtView::updateFloatingGeometry()
|
||||
{
|
||||
if (width() < maxWidth && frameGeometry().x() > 0)
|
||||
{
|
||||
// setX/Y changes the size!
|
||||
floatingGeometry_.setX(x());
|
||||
floatingGeometry_.setY(y());
|
||||
floatingGeometry_.setWidth(width());
|
||||
floatingGeometry_.setHeight(height());
|
||||
}
|
||||
floatingGeometry_ = QRect(x(), y(), width(), height());
|
||||
}
|
||||
|
||||
|
||||
void QtView::resizeEvent(QResizeEvent *)
|
||||
{
|
||||
maxWidth = std::max(width(), maxWidth);
|
||||
|
||||
updateFloatingGeometry();
|
||||
|
||||
updateFloatingGeometry();
|
||||
}
|
||||
|
||||
|
||||
void QtView::moveEvent(QMoveEvent *)
|
||||
{
|
||||
updateFloatingGeometry();
|
||||
}
|
||||
|
||||
|
||||
void QtView::closeEvent(QCloseEvent *)
|
||||
{
|
||||
updateFloatingGeometry();
|
||||
|
@ -111,6 +111,7 @@ void GuiView::updateMenu(QAction *action)
|
||||
menubar_->update();
|
||||
}
|
||||
|
||||
|
||||
void GuiView::setWindowTitle(string const & t, string const & it)
|
||||
{
|
||||
QMainWindow::setWindowTitle(toqstr(t));
|
||||
@ -175,22 +176,20 @@ bool GuiView::hasFocus() const
|
||||
return qApp->activeWindow() == this;
|
||||
}
|
||||
|
||||
|
||||
void GuiView::updateFloatingGeometry()
|
||||
{
|
||||
if (!isMaximized()) {
|
||||
// setX/Y changes the size!
|
||||
floatingGeometry_.setX(x());
|
||||
floatingGeometry_.setY(y());
|
||||
floatingGeometry_.setWidth(width());
|
||||
floatingGeometry_.setHeight(height());
|
||||
}
|
||||
if (!isMaximized())
|
||||
floatingGeometry_ = QRect(x(), y(), width(), height());
|
||||
}
|
||||
|
||||
|
||||
void GuiView::resizeEvent(QResizeEvent *)
|
||||
{
|
||||
updateFloatingGeometry();
|
||||
}
|
||||
|
||||
|
||||
void GuiView::moveEvent(QMoveEvent *)
|
||||
{
|
||||
updateFloatingGeometry();
|
||||
@ -243,6 +242,7 @@ void GuiView::busy(bool yes) const
|
||||
QApplication::restoreOverrideCursor();
|
||||
}
|
||||
|
||||
|
||||
QMainWindow* GuiView::mainWidget()
|
||||
{
|
||||
return mainWidget_;
|
||||
|
@ -203,10 +203,8 @@ void start(string const & batch, vector<string> const & files,
|
||||
view.init();
|
||||
|
||||
// only true when the -geometry option was NOT used
|
||||
if (width != -1 && height != -1)
|
||||
{
|
||||
if (posx != -1 && posy != -1)
|
||||
{
|
||||
if (width != -1 && height != -1) {
|
||||
if (posx != -1 && posy != -1) {
|
||||
#ifdef Q_OS_WIN32
|
||||
// FIXME: use only setGeoemtry when Trolltech has
|
||||
// fixed the qt4/X11 bug
|
||||
|
Loading…
Reference in New Issue
Block a user