mirror of
https://github.com/YACReader/yacreader
synced 2025-07-18 21:14:33 -04:00
Format code using clang-format
This commit is contained in:
@ -8,62 +8,63 @@
|
||||
#include "goto_flow_toolbar.h"
|
||||
#include "configuration.h"
|
||||
|
||||
GoToFlowWidget::GoToFlowWidget(QWidget * parent)
|
||||
:QWidget(parent)
|
||||
GoToFlowWidget::GoToFlowWidget(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
{
|
||||
mainLayout = new QVBoxLayout;
|
||||
mainLayout->setMargin(0);
|
||||
mainLayout->setSpacing(0);
|
||||
mainLayout = new QVBoxLayout;
|
||||
mainLayout->setMargin(0);
|
||||
mainLayout->setSpacing(0);
|
||||
|
||||
toolBar = new GoToFlowToolBar(this);
|
||||
toolBar = new GoToFlowToolBar(this);
|
||||
|
||||
setLayout(mainLayout);
|
||||
setLayout(mainLayout);
|
||||
|
||||
//toolBar->installEventFilter(this);
|
||||
//toolBar->installEventFilter(this);
|
||||
}
|
||||
|
||||
GoToFlowWidget::~GoToFlowWidget() {
|
||||
delete toolBar;
|
||||
delete mainLayout;
|
||||
GoToFlowWidget::~GoToFlowWidget()
|
||||
{
|
||||
delete toolBar;
|
||||
delete mainLayout;
|
||||
}
|
||||
|
||||
void GoToFlowWidget::setPageNumber(int page)
|
||||
{
|
||||
toolBar->setPage(page);
|
||||
toolBar->setPage(page);
|
||||
}
|
||||
|
||||
void GoToFlowWidget::keyPressEvent(QKeyEvent* event)
|
||||
void GoToFlowWidget::keyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
switch (event->key())
|
||||
{
|
||||
case Qt::Key_Return: case Qt::Key_Enter:
|
||||
toolBar->goTo();
|
||||
toolBar->centerSlide();
|
||||
break;
|
||||
case Qt::Key_Space:
|
||||
toolBar->centerSlide();
|
||||
break;
|
||||
case Qt::Key_S:
|
||||
QCoreApplication::sendEvent(this->parent(),event);
|
||||
break;
|
||||
}
|
||||
switch (event->key()) {
|
||||
case Qt::Key_Return:
|
||||
case Qt::Key_Enter:
|
||||
toolBar->goTo();
|
||||
toolBar->centerSlide();
|
||||
break;
|
||||
case Qt::Key_Space:
|
||||
toolBar->centerSlide();
|
||||
break;
|
||||
case Qt::Key_S:
|
||||
QCoreApplication::sendEvent(this->parent(), event);
|
||||
break;
|
||||
}
|
||||
|
||||
event->accept();
|
||||
event->accept();
|
||||
}
|
||||
|
||||
void GoToFlowWidget::updateConfig(QSettings * settings)
|
||||
void GoToFlowWidget::updateConfig(QSettings *settings)
|
||||
{
|
||||
Q_UNUSED(settings)
|
||||
Q_UNUSED(settings)
|
||||
toolBar->updateOptions();
|
||||
}
|
||||
|
||||
void GoToFlowWidget::updateSize()
|
||||
{
|
||||
// called by parent in resizeEvent
|
||||
// no need to update width when QuickNaviMode disabled
|
||||
// height is set in updateConfig
|
||||
if (Configuration::getConfiguration().getQuickNaviMode() && parentWidget() != nullptr)
|
||||
resize(parentWidget()->width(),height());
|
||||
// called by parent in resizeEvent
|
||||
// no need to update width when QuickNaviMode disabled
|
||||
// height is set in updateConfig
|
||||
if (Configuration::getConfiguration().getQuickNaviMode() && parentWidget() != nullptr)
|
||||
resize(parentWidget()->width(), height());
|
||||
}
|
||||
|
||||
/*bool GoToFlowWidget::eventFilter(QObject * target, QEvent * event)
|
||||
|
Reference in New Issue
Block a user